L2TBTC
L2TBTC
Canonical L2/sidechain token implementation. tBTC token is minted on L1 and locked there to be moved to L2/sidechain. By deploying a canonical token on each L2/sidechain, we can ensure the supply of tBTC remains sacrosanct, while enabling quick, interoperable cross-chain bridges and localizing ecosystem risk.
This contract is flexible enough to:
Delegate minting authority to a native bridge on the chain, if present.
Delegate minting authority to a short list of ecosystem bridges.
Have mints and burns paused by any one of n guardians, allowing avoidance of contagion in case of a chain- or bridge-specific incident.
Be governed and upgradeable.
The token is burnable by the token holder and supports EIP2612 permits. Token holder can authorize a transfer of their token with a signature conforming EIP712 standard instead of an on-chain transaction from their address. Anyone can submit this signature on the user's behalf by calling the permit function, paying gas fees, and possibly performing other actions in the same transaction. The governance can recover ERC20 and ERC721 tokens sent mistakenly to L2TBTC token contract.
isMinter
Indicates if the given address is a minter. Only minters can mint the token.
minters
List of all minters.
isGuardian
Indicates if the given address is a guardian. Only guardians can pause token mints and burns.
guardians
List of all guardians.
MinterAdded
MinterRemoved
GuardianAdded
GuardianRemoved
onlyMinter
onlyGuardian
initialize
Initializes the token contract.
Parameters
addMinter
Adds the address to the minters list.
Requirements:
The caller must be the contract owner.
minter
must not be a minter address already.
Parameters
removeMinter
Removes the address from the minters list.
Requirements:
The caller must be the contract owner.
minter
must be a minter address.
Parameters
addGuardian
Adds the address to the guardians list.
Requirements:
The caller must be the contract owner.
guardian
must not be a guardian address already.
Parameters
removeGuardian
Removes the address from the guardians list.
Requirements:
The caller must be the contract owner.
guardian
must be a guardian address.
Parameters
recoverERC20
Allows the governance of the token contract to recover any ERC20 sent mistakenly to the token contract address.
Parameters
recoverERC721
Allows the governance of the token contract to recover any ERC721 sent mistakenly to the token contract address.
Parameters
pause
Allows one of the guardians to pause mints and burns allowing avoidance of contagion in case of a chain- or bridge-specific incident.
Requirements:
The caller must be a guardian.
The contract must not be already paused.
unpause
Allows the governance to unpause mints and burns previously paused by one of the guardians.
Requirements:
The caller must be the contract owner.
The contract must be paused.
mint
Allows one of the minters to mint amount
tokens and assign them to account
, increasing the total supply. Emits a Transfer
event with from
set to the zero address.
Requirements:
The caller must be a minter.
account
must not be the zero address.
Parameters
burn
Destroys amount
tokens from the caller. Emits a Transfer
event with to
set to the zero address.
Requirements:
The caller must have at least
amount
tokens.
Parameters
burnFrom
Destroys amount
tokens from account
, deducting from the caller's allowance. Emits a Transfer
event with to
set to the zero address.
Requirements:
The che caller must have allowance for
accounts
's tokens of at leastamount
.account
must not be the zero address.account
must have at leastamount
tokens.
Parameters
getMinters
Allows to fetch a list of all minters.
getGuardians
Allows to fetch a list of all guardians.
Last updated