LegacyMintableERC20
Table of Contents
Overview
Deprecated legacy implementation of a mintable ERC20 token for cross-domain token bridging. This contract represents an L1 token on L2 and allows only the designated L2 bridge to mint and burn tokens. This contract should no longer be used for new deployments.
Definitions
N/A
Assumptions
N/A
Invariants
N/A
Function Specification
constructor
Initializes the token with bridge and L1 token addresses.
Parameters:
_l2Bridge: Address of the L2 standard bridge authorized to mint and burn tokens_l1Token: Address of the corresponding token on L1_name: ERC20 token name_symbol: ERC20 token symbol
Behavior:
- MUST set
l2Bridgeto_l2Bridge - MUST set
l1Tokento_l1Token - MUST initialize ERC20 with
_nameand_symbol
supportsInterface
Returns whether the contract supports a given interface ID per EIP165.
Parameters:
_interfaceId: 4-byte interface identifier to check
Behavior:
- MUST return
trueif_interfaceIdmatches the ERC165supportsInterface(bytes4)selector - MUST return
trueif_interfaceIdmatches the XOR ofILegacyMintableERC20.l1Token.selector,ILegacyMintableERC20.mint.selector, andILegacyMintableERC20.burn.selector - MUST return
falseotherwise
mint
Mints tokens to a specified address. Only callable by the L2 bridge.
Parameters:
_to: Address to receive the minted tokens_amount: Amount of tokens to mint
Behavior:
- MUST revert if
msg.senderis notl2Bridge - MUST mint
_amounttokens to_to - MUST emit
Mintevent with_toand_amount
burn
Burns tokens from a specified address. Only callable by the L2 bridge.
Parameters:
_from: Address from which tokens will be burned_amount: Amount of tokens to burn
Behavior:
- MUST revert if
msg.senderis notl2Bridge - MUST burn
_amounttokens from_from - MUST emit
Burnevent with_fromand_amount