NatSpec
Smart Contracts play a critical role in the Metis Layer 2 ecosystem, enabling secure and decentralized management of Sequencer operations and network activities. This section provides detailed NatSpec (Ethereum Natural Specification Format) documentation for both Mainnet and Testnet contracts. By adhering to NatSpec standards, we ensure clarity and transparency for developers and auditors alike.
Key Contracts
| Contract | Ethereum Mainnet (ChainId: 1) | Sepolia Testnet (ChainId: 11155111) |
|---|---|---|
| LockingInfo | 0x0fe382b74c3894b65c10e5c12ae60bbd8faf5b48 | 0x390A6fE63385522E87e248BC5200f7d3a02F994b |
| LockingPool | 0xd54c868362c2098e0e46f12e7d924c6a332952dd | 0x7591940125cC0344a65D60319d1ADcD463B2D4c3 |
Sequencers can interact directly with these contracts to manage rewards, lock-ups, and related activities without requiring frontend tools.
Key Contract Functionality
The following methods are provided to manage Sequencers efficiently. These include querying and updating your Sequencer's status, locking tokens, and handling rewards.
Reading Contract Information
-
seqOwnersRetrieves comprehensive Sequencer status using the owner's address.- Parameter:
seqId (uint256)- The Sequencer ID. - Response: Returns details of the Sequencer's operational state.
- Parameter:
-
seqSignersRetrieves Sequencer information using the signer's address.- Parameter:
seqId (uint256)- The Sequencer ID. - Response: Returns details of the Sequencer's operational state.
- Parameter:
-
sequencersAccesses all detailed information about a Sequencer using its ID.-
Parameter:
seqId (uint256)- The Sequencer ID. -
Response:
-
Writing Contract Information
lockForLocks METIS tokens and assigns Sequencer ownership.- Parameters:
_signer (address): Sequencer signer address._amount (uint256): Amount of METIS tokens to lock._signerPubkey (bytes): Uncompressed public key of the signer.
- Parameters:
lockWithRewardRecipientSimilar tolockFor, but includes an additional parameter to specify a reward recipient.- Parameters:
_signer (address): Sequencer signer address._rewardRecipient (address): Reward recipient address._amount (uint256): Amount of METIS tokens to lock._signerPubkey (bytes): Uncompressed public key.
- Parameters:
relockAdds more tokens to an existing lock or locks accrued rewards.- Parameters:
_seqId (uint256): Sequencer ID._amount (uint256): Additional tokens to lock (can be0if relocking rewards)._lockReward (bool): Whether to lock current rewards.
- Parameters:
setSequencerRewardRecipientUpdates or assigns a reward recipient address.- Parameters:
_seqId (uint256): Sequencer ID._recipient (address): New reward recipient address.
- Parameters:
withdrawRewardsWithdraws accrued rewards to the specified address.- Parameters:
_seqId (uint256): Sequencer ID._l2Gas (uint32): Gas limit for the operation.
- Parameters:
unlockInitiates the unlocking process for METIS tokens.- Parameters:
_seqId (uint256): Sequencer ID._l2Gas (uint32): Gas limit for the bridge operation.
- Parameters:
unlockClaimClaims unlocked tokens after the mandatory 21-day waiting period.- Parameters:
_seqId (uint256): Sequencer ID._l2Gas (uint32): Gas limit.
- Parameters:
withdrawPartially withdraws locked tokens while maintaining the minimum lock balance.- Parameters:
_amount (uint256): Amount to withdraw._seqId (uint256): Sequencer ID.
- Parameters:
Guide
The Decentralized Sequencer Pool is a critical step towards complete decentralization of Metis’ Layer 2 network, eliminating single points of failure associated with centralized sequencers. By combining existing decentralized P2P validators and block producers, it enhances stability, scalability, and fault tolerance.
FAQs
Next Page