Skip to main content

Node Operators

One of the main parts of Lido on Polygon protocol are node operators. Node operators are entities which are running Polygon PoS validators and are registered in the Lido on Polygon node operator registry contract. They are responsible for managing a secure and stable infrastructure for running Polygon validator infrastructure for the benefit of the protocol. They are professional staking providers who can ensure the safety of funds belonging to the protocol users and correctness of validator operations.

Note:

  • The Mainnet NodeOperatorRegistry Proxy address can be retrieved from here.
  • The Goerli NodeOperatorRegistry Proxy address can be retrieved from here.
  • The Mainnet StakingNFT Contract Address Proxy address can be retrieved from here
  • The Testnet StakingNFT Contract Address Proxy address can be retrieved from here

How to join as an Operator#

If you're joining with a pre-staked one, you should interact with joinOperator function in NodeOperatorRegistry contract. Import INodeOperator interface to remix and attach it to the NODE_OPERATOR_REGISTRY_PROXY address. After the voting process is over, the DAO will create a new operator for you by calling addOperator.

Next thing to do is to approve your NFT staking token to the newly created Operator. Call getNodeOperator function by interacting with the NodeOperatorRegistry to retrieve the address of the ValidatorProxy that was created. You will need to approve the NFT token to the retrieved address. After you've approved the token, call the joinOperator function. That's it! You are now a part of the Lido on Polygon system!

Guide:

  1. Ensure your staking NFT token is held by your reward address

    If this is not the case already, you will need to transfer the staking NFT to the reward address you provided to Lido beforehand. Otherwise, proceed to the next step.

    Transfer the NFT: Visit https://remix.ethereum.org/, and create a new contract with an arbitrary name.

    Paste the following code in the created contract:

    // SPDX-FileCopyrightText: 2021 Shardlabs
    // SPDX-License-Identifier: GPL-3.0
    pragma solidity 0.8.7;
    interface ERC721 {
    function transferFrom(
    address from,
    address to,
    uint256 tokenId
    ) external;
    }

    Enter the address of the Matic Validator ​ERC721​ contract 0x47Cbe25BbDB40a774cC37E1dA92d10C2C7Ec897F in the field, and then click on the blue At Address​ button. This will provide you with the interface to communicate with the Matic Validator.

    Set the following arguments:

    • from:​ current address (current NFT owner).

    • to: reward address.

    • tokenId: the validatorId on Polygon stakeManager.

    Warning: Make sure to transfer the NFT to the right reward address (you need to make sure you hold the private keys of this address)

    Then call transferFrom function and confirm the transaction.

  2. Fetching the address of the validator proxy

    Visit https://remix.ethereum.org/, and create a new contract with an arbitrary name.

    xd2imfoj79nwf4aa0eml

    Paste the following code in the created contract:

    // SPDX-FileCopyrightText: 2021 Shardlabs
    // SPDX-License-Identifier: GPL-3.0
    pragma solidity 0.8.7;
    enum NodeOperatorStatus {
    INACTIVE,
    ACTIVE,
    STOPPED,
    UNSTAKED,
    CLAIMED,
    JAILED,
    EJECTED
    }
    struct NodeOperator {
    NodeOperatorStatus status;
    string name;
    address rewardAddress;
    bytes signerPubkey;
    address validatorShare;
    address validatorProxy;
    uint256 validatorId;
    uint256 commissionRate;
    uint256 maxDelegateLimit;
    }
    interface INodeOperatorRegistry {
    function getNodeOperator(uint256 _operatorId) external view returns (NodeOperator memory);
    function getNodeOperator(address _owner) external view returns (NodeOperator memory);
    }

    Press CTRL + S to compile the code.

    After that, click on Deploy & Run transactions and make sure that INodeOperatorRegistry is selected in the CONTRACT drop down list. Also, make sure that Injected Web3 is selected in the ENVIRONMENT drop down list and that ACCOUNT corresponds to the address that owns the Operator (you can change the connected account via MetaMask).

    mgxkvjfkmjyys1mfsqi9

    Enter the address of the NODE_OPERATOR_REGISTRY_PROXY (please refer to the address in the deployment address table ) in the field like from image below, and then click on the blue At Address button. This will provide you the interface to communicate with the NodeOperator.

    fdunad10cz2y2fpnxp2o

    Expand the INODEOPERATORREGISTRY interface from the bottom left corner of the Remix by clicking on the ">".

    cvununqdej0wyk5oyqlc

    Call the getNodeOperator function and provide your rewardAddress that was provided to the Lido DAO during the first part of onboarding.

    Your result will be tupple looking like this:

    0:
    tuple(uint8,string,address,bytes,address,address,uint256,uint256,uint256): 1,shardlabs,0x481b63197922715893Ec4ed82ccdA4FaA4af570C,0xbe2d1cdedae233fee1f65abe5d64d9f8ecc42acf533caae558d306e8b43e5b55dc942263c46e2fc4892427f30bb684a5edcec7382f8aeb8b12eabbf3eaf41069,0x48d7c8a1ffE179bf4a8eA5aC90574A7D13b0fbfc,0x76b1187744e41b6fB7504c2357BDe7f600c0622b,54,5,50000000000000000000000000

    What you are looking for is the last address in the tupple (Validator Proxy address). You will approve your stakingNFT to that address in the next step. In the example above, that would be 0x76b1187744e41b6fB7504c2357BDe7f600c0622b. To confirm you are looking at the correct address, you can visit etherscan and check the verified contract. The name should be ValidatorProxy.

  3. Approving the NFT token to ValidatorProxy

    Visit https://remix.ethereum.org/, and create a new contract with the name IERC721.sol.

    xd2imfoj79nwf4aa0eml

    Paste the following code in the created contract:

    // SPDX-FileCopyrightText: 2021 Shardlabs
    // SPDX-License-Identifier: GPL-3.0
    pragma solidity 0.8.7;
    interface IERC721 {
    function approve(address to, uint256 tokenId) external;
    }

    Press CTRL + S to compile the code.

    After that, click on Deploy and make sure that IERC721 is selected in the CONTRACT drop down list. Also, make sure that Injected Web3 is selected in the ENVIRONMENT drop down list and that ACCOUNT corresponds to the address that owns the NFT, current validator owner account displayed on the Polygon staking dashboard (you can change the connected account via MetaMask).

    vox

    Enter the address of the NFT Contract Address 0x47Cbe25BbDB40a774cC37E1dA92d10C2C7Ec897F in the field like in the image below, and then click on the blue At Address button. This will provide you the interface to communicate with the NFT contract.

    154135589

    Expand the IERC721 interface from the bottom left corner of the Remix by clicking on the ">".

    154135946

    Expand the approve function arguments by clicking on the arrow that is pointing down.

    154413145

    Set the following arguments:

    • to: Validator Proxy address from the step above

    • tokenId: the validatorId on Polygon stakeManager

    Make sure that you are connected with the right address by checking the ACCOUNT field inside Remix. After confirming, click on approve and confirm the transaction. You have successfully approved the ValidatorProxy to transfer your NFT.

  4. Calling the joinOperator Function

    Visit https://remix.ethereum.org/, and create a new contract with an arbitrary name.

    xd2imfoj79nwf4aa0eml

    Paste the following code in the created contract:

    // SPDX-FileCopyrightText: 2021 Shardlabs
    // SPDX-License-Identifier: GPL-3.0
    pragma solidity 0.8.7;
    interface INodeOperatorRegistry {
    function joinOperator() external;
    }

    Press CTRL + S to compile the code.

    After that, click on Deploy & Run transactions and make sure that INodeOperatorRegistry is selected in the CONTRACT drop down list. Also, make sure that Injected Web3 is selected in the ENVIRONMENT drop down list and that ACCOUNT corresponds to the address that owns the Operator (you can change the connected account via MetaMask).

    mgxkvjfkmjyys1mfsqi9

    Enter the address of the NODE_OPERATOR_REGISTRY_PROXY (please refer to the address in the deployment address table ) in the field like in the image below, and then click on the blue At Address button. This will provide you the interface to communicate with the NodeOperator.

    fdunad10cz2y2fpnxp2o

    Expand the INODEOPERATORREGISTRY interface from the bottom left corner of the Remix by clicking on the ">".

    cvununqdej0wyk5oyqlc

    Expand the joinOperator function arguments by clicking on the arrow that is pointing down.

    al7yb6ggmvwcupoavy4g

    Make sure that you are connected with the right address by checking the ACCOUNT field inside the Remix. After you've made sure, click on joinOperator and confirm the transaction.

    You have successfully joined the Lido on Polygon platform!

How to exit the protocol as a Node Operator#

Exiting the Node Operator Registry by Migrating does not unstake a validator or remove a validator from a stake manager. However, the validator no longer becomes part of the Lido on Polygon protocol after migrating, and the validator ownership is transferred to the reward address.

  1. Call stopOperator() function in the NodeOperator contract.

  2. Call migrate() function in the NodeOperator contract.

    Visit https://remix.ethereum.org/, and create a new contract with the name NodeOperator.sol.

    xd2imfoj79nwf4aa0eml

    Paste the following code in the created contract:

    // SPDX-FileCopyrightText: 2021 Shardlabs
    // SPDX-License-Identifier: GPL-3.0
    pragma solidity 0.8.7;
    interface INodeOperatorRegistry {
    function migrate() external;
    function stopOperator(uint256 _operatorId) external;
    }

    Press CTRL + S to compile the code.

    After that, click on Deploy and make sure that INodeOperatorRegistry is selected in the CONTRACT drop down list. Also, make sure that Injected Web3 is selected in the ENVIRONMENT drop down list and that ACCOUNT corresponds to the address that owns the token (you can change the connected account via MetaMask).

    mgxkvjfkmjyys1mfsqi9

    Enter the address of the NODE_OPERATOR_REGISTRY_PROXY (please refer to the address in the deployment address table ) in the field like from image below, and then click on the blue At Address button. This will provide you the interface to communicate with the NodeOperator.

    fdunad10cz2y2fpnxp2o

    Expand the INODEOPERATORREGISTRY interface from the bottom left corner of the Remix by clicking on the ">".

    154491968

    1. Add your operatorId and click on stopOperator.
    2. Click on migrate to migrate the node operator from the node manager.