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
-
seqOwners
Retrieves comprehensive Sequencer status using the owner's address.- Parameter:
seqId (uint256)
- The Sequencer ID. - Response: Returns details of the Sequencer's operational state.
- Parameter:
-
seqSigners
Retrieves Sequencer information using the signer's address.- Parameter:
seqId (uint256)
- The Sequencer ID. - Response: Returns details of the Sequencer's operational state.
- Parameter:
-
sequencers
Accesses all detailed information about a Sequencer using its ID.-
Parameter:
seqId (uint256)
- The Sequencer ID. -
Response:
-
Writing Contract Information
lockFor
Locks 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:
lockWithRewardRecipient
Similar 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:
relock
Adds more tokens to an existing lock or locks accrued rewards.- Parameters:
_seqId (uint256)
: Sequencer ID._amount (uint256)
: Additional tokens to lock (can be0
if relocking rewards)._lockReward (bool)
: Whether to lock current rewards.
- Parameters:
setSequencerRewardRecipient
Updates or assigns a reward recipient address.- Parameters:
_seqId (uint256)
: Sequencer ID._recipient (address)
: New reward recipient address.
- Parameters:
withdrawRewards
Withdraws accrued rewards to the specified address.- Parameters:
_seqId (uint256)
: Sequencer ID._l2Gas (uint32)
: Gas limit for the operation.
- Parameters:
unlock
Initiates the unlocking process for METIS tokens.- Parameters:
_seqId (uint256)
: Sequencer ID._l2Gas (uint32)
: Gas limit for the bridge operation.
- Parameters:
unlockClaim
Claims unlocked tokens after the mandatory 21-day waiting period.- Parameters:
_seqId (uint256)
: Sequencer ID._l2Gas (uint32)
: Gas limit.
- Parameters:
withdraw
Partially withdraws locked tokens while maintaining the minimum lock balance.- Parameters:
_amount (uint256)
: Amount to withdraw._seqId (uint256)
: Sequencer ID.
- Parameters: