# Lido on Polygon protocol upgrade

**URL:** https://research.lido.fi/t/lido-on-polygon-protocol-upgrade/3213
**Category:** Proposals
**Created:** [November 11, 2022, 6:38am UTC](https://research.lido.fi/t/lido-on-polygon-protocol-upgrade/3213 "2022-11-11T06:38:46Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Marin](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/marin/32/5448_2.png) [@Marin](https://research.lido.fi/u/Marin)
#### Post date: [November 11, 2022, 6:38am UTC](https://research.lido.fi/t/lido-on-polygon-protocol-upgrade/3213/1 "2022-11-11T06:38:46Z")

</div>

# **Lido on Polygon V2 upgrade proposal**

### **Reasoning:**

Following the successful launch of Lido on Polygon V1, we’ve been working hard incorporating stakeholder feedback to make marked improvements in reducing both staker as well as node operator friction. As a result, we’ve come up with a V2 of Lido on Polygon that makes fewer compromises, eases operator entry and exit, and provides a smoother flow for users and network participants. This version not only brings nice-to-have features for node operators participating in the Lido on Polygon protocol, but also reduces the gas needed for depositing and withdrawing tokens.

As we are committed to the values put forward by the community and the DAO, this upgrade will enable us to onboard a new set of node operators and further decentralise the Polygon network while providing options for more top tier node operators to join the Lido family.

### **Security:**

As Lido takes pride in its dedication to security and this upgrade is no exception. A full smart contract code audit was done by [Oxorio](https://oxor.io/) and is available for you to read [here](https://drive.google.com/file/d/1tGxZIhGD3vDVfiSW4YvEDODIV0KuOWRm/view?usp=sharing).

## **TL;DR change log:**

- Rebalancing stake among validators on deposits and withdrawals

- Simplified logic for node operator registry

- No need to transfer validator ownership to Lido’s smart contracts

- Finer role based access control

- Gas optimizations for delegations/withdrawals and node operator controls

- Code refactoring for readability and maintenance

- Small fixes and code improvements

# **Full Technical Changelog:**

### NodeOperatorRegistry

- New logic for NodeOperatorRegistry contract.

- The validatorFactory Contract is no longer used by the NodeOperatorRegistry logic.

- Removed validator proxy logic, the validator can join the protocol without transferring the validator slot to the protocol.

- Added logic to rebalance delegations.

- Added logic to delegate tokens between validators.

- Improved the logic to request a withdrawal from validators.

- Added ADD\_NODE\_OPERATOR\_ROLE and REMOVE\_NODE\_OPERATOR\_ROLE roles to manage operator life cycle

- Split the pause role into 2 sub roles PAUSE\_ROLE and UNPAUSE\_ROLE

- Added possibility to remove a validator by any wallet if its status is in UNSTAKE or EJECTED

- Added getProtocolStats function which allows to get info about if the system is balanced or not.

### stMATIC

- The requestWithdraw algorithm was changed to a new one that keeps the validators balanced.

- Each requestWithdraw will generate 1 NFT token even if the request will be distributed between multiple validators.

- Added token2WithdrawRequests to map 1 NFT token with multiple withdrawal requests.

- Added PAUSE\_ROLE and UNPAUSE\_ROLE

- The delegate function algorithm was improved to automatically do rebalance and delegate to the validators who have less delegation.

- The claimTokens function is compatible with NFTs generated by the requestWithdraw in V1 and V2.

- Added protocolFee setter.

- Added rebalanceDelegatedTokens; it rebalances the system.

## LidoNFT

- Delete the NFT from token2Index after request withdrawal, in V1 it was set to ZERO.

- Delete the NFT from tokenId2ApprovedIndex after approving the NFT, in V1 it was set to ZERO.

[ 1.0.0  
 ](https://github.com/shard-Labs/PoLido/)

# **Action plan**

### **Snapshot voting**

A snapshot vote will be started next week to measure the DAO sentiment towards the proposed changes.

### **Deployment:**

Deployment will go in 2 phases.

Phase one: Testnet release  
Phase two. Mainnet release (approx 2 weeks after the testnet launch)

### **Marketing**

Content will be released to inform the community about the upgrade and downtime of staking services and to address concerns with timely release.

### **Node Operator Operations**

- Validator slots will be retrieved by existing Lido on Polygon Node Operators from the contract

- Existing Node operators will be registered in the V2 contract

### **Validator onboarding**

Additions to the Lido on Polygon validator will be onboarded in Q4 or early Q1/2023. Depending on the TVL at a time, the Lido Node Operator Subgovernance Group (LNOSG) will decide on the number of node operators to be onboarded in the next round.

---

<div class="post-metadata">

### Author: ![DeFiYaco](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/defiyaco/32/2084_2.png) [@DeFiYaco](https://research.lido.fi/u/DeFiYaco)
#### Post date: [November 28, 2022, 10:48am UTC](https://research.lido.fi/t/lido-on-polygon-protocol-upgrade/3213/2 "2022-11-28T10:48:24Z")

</div>

To allow the community and governance to check this proposal in more details and improve transparency, we are going to first deploy our contracts, verify them on Etherscan and post those addresses here and inside the snapshot proposal itself.

Testnet smart contracts have already been live for some time and were verified on Goerli Etherscan.  
All addresses are visible here:

```auto
{
  "network": 5,
  "dao": "0x3E46BEFDA7112d8954b923ea6bd9f07c2e615e10",
  "treasury": "0x3E46BEFDA7112d8954b923ea6bd9f07c2e615e10",
  "matic_erc20_address": "0x499d11E0b6eAC7c0593d8Fb292DCBbF815Fb29Ae",
  "matic_stake_manager_proxy": "0x00200eA4Ee292E253E6Ca07dBA5EdC07c8Aa37A3",
  "proxy_admin": "0x13b954d5FC225eF64650A7D723de763F03e1dbD2",
  "lido_nft_proxy": "0xb7f0F701473458549768753F3176411105ec9693",
  "lido_nft_impl": "0xDfB4A0f4C1f39CCEad3851E4C99EB0DC32c8CdaF",
  "stMATIC_proxy": "0x9A7c69A167160C507602ecB3Df4911e8E98e1279",
  "stMATIC_impl": "0x54428212123c5de67ee776eefeb09ad44186d875",
  "node_operator_registry_proxy": "0xbba726ffc99828c7eaa1e4fE1Ed9115f178cD69B",
  "node_operator_registry_impl": "0x304acD621d4B394AdE4c805Cb7dC778756c79926",
  "fx_state_root_tunnel": "0x5C0e4a60Cb0cC9271994d834510e196e3985b616",
  "fx_state_child_tunnel": "0x2071947Fa4f823b7F9B21C78B0afD5EfFc2D968e"
}

```

The mainnet deployment is scheduled for this week.

---

<div class="post-metadata">

### Author: ![DeFiYaco](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/defiyaco/32/2084_2.png) [@DeFiYaco](https://research.lido.fi/u/DeFiYaco)
#### Post date: [November 29, 2022, 11:07am UTC](https://research.lido.fi/t/lido-on-polygon-protocol-upgrade/3213/3 "2022-11-29T11:07:06Z")

</div>

Lido on Polygon V2 contracts are deployed on Ethereum mainnet and verified on Etherscan.

```auto
{
    "network": 1,
    "dao": "0xd65Fa54F8DF43064dfd8dDF223A446fc638800A9",
    "treasury": "0xd65Fa54F8DF43064dfd8dDF223A446fc638800A9",
    "matic_erc20_address": "0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0",
    "matic_stake_manager_proxy": "0x5e3Ef299fDDf15eAa0432E6e66473ace8c13D908",
    "proxy_admin": "0x0833f5bD45803E05ef54E119a77E463cE6b1a963",
    "lido_nft_proxy": "0x60a91E2B7A1568f0848f3D43353C453730082E46",
    "lido_nft_impl": "0x8B747A13D2Af956Ea7B9a36E659807Ea5cF5E04A",
    "stMATIC_proxy": "0x9ee91F9f426fA633d227f7a9b000E28b9dfd8599",
    "stMATIC_impl": "0xCa7fB9581f1EFC89455D6B5B792E80726AC1Caaa",
    "stMATIC_child": "0x3A58a54C066FdC0f2D55FC9C89F0415C92eBf3C4",
    "node_operator_registry_proxy": "0x216B8b78e0632138dc38907dd089aAB601ED6EDC",
    "node_operator_registry_impl": "0x1b6c71EdbdB8174420Cf9B368B38A1B52bfDd7F3",
    "fx_state_root_tunnel": "0xc7dd5c30DcA04f487c9ede0c5AC580c91587fc66",
    "fx_state_child_tunnel": "0x0833f5bD45803E05ef54E119a77E463cE6b1a963",
}

```

All the existing node operators are added to the new Node Operator Registry, and that can be checked by calling this function: [getValidatorIds](https://etherscan.io/address/0x216B8b78e0632138dc38907dd089aAB601ED6EDC#readProxyContract#F16)

Remaining steps to conclude the upgrade process:

1. Snapshot proposal
2. Upgrade implementations from V1 to V2 after successful Snapshot voting
3. Coordinate with node operators to migrate staking NFTs back to their reward addresses

---

<div class="post-metadata">

### Author: ![zuzu\_eeka](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/zuzu_eeka/32/1157_2.png) [@zuzu\_eeka](https://research.lido.fi/u/zuzu_eeka)
#### Post date: [December 5, 2022, 6:35pm UTC](https://research.lido.fi/t/lido-on-polygon-protocol-upgrade/3213/4 "2022-12-05T18:35:55Z")

</div>

**Lido on Polygon V2 upgrade** snapshot voting is now live and ends on December 12 at 4PM UTC.  
The voting reaches a quorum if more than 50 million LDOs vote for one of the options and is supported if more votes choose the “For” option.  
[https://snapshot.org/#/lido-snapshot.eth/proposal/0xbb5c7f1b0ae30b502ec207cffa324b05f69d6024cc56d94b0ea8df69216de1c4](https://snapshot.org/#/lido-snapshot.eth/proposal/0xbb5c7f1b0ae30b502ec207cffa324b05f69d6024cc56d94b0ea8df69216de1c4)

---

<div class="post-metadata">

### Author: ![Anna\_Vareniuk](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/anna_vareniuk/32/965_2.png) [@Anna\_Vareniuk](https://research.lido.fi/u/Anna_Vareniuk)
#### Post date: [December 12, 2022, 6:58am UTC](https://research.lido.fi/t/lido-on-polygon-protocol-upgrade/3213/5 "2022-12-12T06:58:50Z")

</div>

Thank you for the update @DeFiYaco!

I have a question regarding the fee and infrastructure:

1. Earlier, it was discussed that the commission should be 5% to be able to join Lido on Polygon with its possible change in the future (in the next Onboarding Waves). How are things now? Will be Node Operators able to set any fee? or everyone should have the same rate?

2. Can the Node Operator (in case, it will be approved by DAO after evaluation) run on the existing Polygon node or should it be a separate setup?

TIA!

---

<div class="post-metadata">

### Author: ![DeFiYaco](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/defiyaco/32/2084_2.png) [@DeFiYaco](https://research.lido.fi/u/DeFiYaco)
#### Post date: [December 12, 2022, 7:30am UTC](https://research.lido.fi/t/lido-on-polygon-protocol-upgrade/3213/6 "2022-12-12T07:30:57Z")

</div>

Hey @Anna_Vareniuk,

1. The commission fee requirement is our policy, it is not written in the code. Any commission fee between 0% and 5% is acceptable. Different LoP NOs can have different commission fees set. That will not be an issue 🙂

2. The NO can run the existing Polygon node. No need to run the separate setup. After this protocol upgrade, accepted NOs will just be added to the Node Operator Registry and that is it. No need to transfer validator ownership to Lido contract like it was required in v1.

Thanks for your questions, please wait for our announcement of the NO onboarding round that we are targeting for the beginning of the next year.

---

<div class="post-metadata">

### Author: ![Anna\_Vareniuk](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/anna_vareniuk/32/965_2.png) [@Anna\_Vareniuk](https://research.lido.fi/u/Anna_Vareniuk)
#### Post date: [December 12, 2022, 7:47am UTC](https://research.lido.fi/t/lido-on-polygon-protocol-upgrade/3213/7 "2022-12-12T07:47:09Z")

</div>

@DeFiYaco, thank you for the quick response 🤗

So returning to the commission fee, so do I understand it right that NOs will not be allowed to set a commission fee above 5%, let’s say 7% or 10% or whatever? Only within 0%-5% range?

We will follow up on updates, thank you!

---

<div class="post-metadata">

### Author: ![DeFiYaco](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/defiyaco/32/2084_2.png) [@DeFiYaco](https://research.lido.fi/u/DeFiYaco)
#### Post date: [December 12, 2022, 8:36am UTC](https://research.lido.fi/t/lido-on-polygon-protocol-upgrade/3213/8 "2022-12-12T08:36:00Z")

</div>

That is the current policy, yes. We might revisit it after we receive all the applications for the second onboarding round if we see it makes sense. For now, we want to keep it capped at 5%.

Also, keep in mind that on top of these staking commission fees, Lido on Polygon NOs receive additional rewards from each reward distribution: [Fees | Lido On Polygon Docs](https://docs.polygon.lido.fi/fees/)

---

<div class="post-metadata">

### Author: ![Anna\_Vareniuk](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/anna_vareniuk/32/965_2.png) [@Anna\_Vareniuk](https://research.lido.fi/u/Anna_Vareniuk)
#### Post date: [December 12, 2022, 10:27am UTC](https://research.lido.fi/t/lido-on-polygon-protocol-upgrade/3213/9 "2022-12-12T10:27:21Z")

</div>

Okay I see, thank you for the detailed answers!

---

<div class="post-metadata">

### Author: ![DeFiYaco](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/defiyaco/32/2084_2.png) [@DeFiYaco](https://research.lido.fi/u/DeFiYaco)
#### Post date: [January 10, 2023, 11:04am UTC](https://research.lido.fi/t/lido-on-polygon-protocol-upgrade/3213/10 "2023-01-10T11:04:07Z")

</div>

Since the last proposal did not pass, we have used the extra time during the holidays to audit and upgrade stMATIC and lido nft contracts with extra logging and event data to enable easier analytics and integrations with third party protocols.  
All changes are audited and the reports are publicly available on Github: [polygon-contracts/audits/v2 at main · lidofinance/polygon-contracts · GitHub](https://github.com/lidofinance/polygon-contracts/tree/main/audits/v2)

```auto
{
    "network": 1,
    "dao": "0xd65Fa54F8DF43064dfd8dDF223A446fc638800A9",
    "treasury": "0xd65Fa54F8DF43064dfd8dDF223A446fc638800A9",
    "matic_erc20_address": "0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0",
    "matic_stake_manager_proxy": "0x5e3Ef299fDDf15eAa0432E6e66473ace8c13D908",
    "proxy_admin": "0x0833f5bD45803E05ef54E119a77E463cE6b1a963",
    "lido_nft_proxy": "0x60a91E2B7A1568f0848f3D43353C453730082E46",
    "lido_nft_impl": "0x4CA459DFC8b1cACa3763C954E889e6D644984385",
    "stMATIC_proxy": "0x9ee91F9f426fA633d227f7a9b000E28b9dfd8599",
    "stMATIC_impl": "0x15152eEE59752F18C2de8fbd4Bc83Ec20c448303",
    "stMATIC_child": "0x3A58a54C066FdC0f2D55FC9C89F0415C92eBf3C4",
    "node_operator_registry_proxy": "0x216B8b78e0632138dc38907dd089aAB601ED6EDC",
    "node_operator_registry_impl": "0x1b6c71EdbdB8174420Cf9B368B38A1B52bfDd7F3",
    "fx_state_root_tunnel": "0xc7dd5c30DcA04f487c9ede0c5AC580c91587fc66",
    "fx_state_child_tunnel": "0x0833f5bD45803E05ef54E119a77E463cE6b1a963",
}

```

Remaining steps to conclude the upgrade process:

1. Snapshot proposal rerun
2. Upgrade implementations from V1 to V2 after successful Snapshot voting
3. Coordinate with node operators to migrate staking NFTs back to their reward addresses

---

<div class="post-metadata">

### Author: ![governance-data-bot](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/governance-data-bot/32/2204_2.png) [@governance-data-bot](https://research.lido.fi/u/governance-data-bot)
#### Post date: [January 11, 2023, 12:14pm UTC](https://research.lido.fi/t/lido-on-polygon-protocol-upgrade/3213/11 "2023-01-11T12:14:16Z")

</div>

## Snapshot vote started

We’re starting the [Lido on Polygon V2 upgrade (restart)](https://snapshot.org/#/lido-snapshot.eth/proposal/0x32f6f095dc4f7b97665b560781d6e6795da11f9c8218936a505575040038d70f) Snapshot, active till Wed, 18 Jan 2023 15:00:00 GMT . Please don’t forget to cast your vote!

---

<div class="post-metadata">

### Author: ![zuzu\_eeka](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/zuzu_eeka/32/1157_2.png) [@zuzu\_eeka](https://research.lido.fi/u/zuzu_eeka)
#### Post date: [January 19, 2023, 8:29am UTC](https://research.lido.fi/t/lido-on-polygon-protocol-upgrade/3213/12 "2023-01-19T08:29:40Z")

</div>

🗳 [Snapshot vote](https://snapshot.org/#/lido-snapshot.eth/proposal/0x32f6f095dc4f7b97665b560781d6e6795da11f9c8218936a505575040038d70f) ended!  
Results are:  
For: 57,167,414.98  
Against: 7,676.63

---

<div class="post-metadata">

### Author: ![governance-data-bot](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/governance-data-bot/32/2204_2.png) [@governance-data-bot](https://research.lido.fi/u/governance-data-bot)
#### Post date: [January 19, 2023, 12:24pm UTC](https://research.lido.fi/t/lido-on-polygon-protocol-upgrade/3213/13 "2023-01-19T12:24:20Z")

</div>

## Snapshot vote ended

The [Lido on Polygon V2 upgrade (restart)](https://snapshot.org/#/lido-snapshot.eth/proposal/0x32f6f095dc4f7b97665b560781d6e6795da11f9c8218936a505575040038d70f) Snapshot has passed! 🥳  
The results are:  
**For** : 57.2M LDO  
**Against** : 7.7k LDO

---

<div class="post-metadata">

### Author: ![Justin\_Krogen](https://dub1.discourse-cdn.com/flex013/user_avatar/research.lido.fi/justin_krogen/32/2511_2.png) [@Justin\_Krogen](https://research.lido.fi/u/Justin_Krogen)
#### Post date: [March 2, 2023, 10:07am UTC](https://research.lido.fi/t/lido-on-polygon-protocol-upgrade/3213/14 "2023-03-02T10:07:35Z")

</div>

I’d just like to know how to get a code for unicorn party please
