diff --git a/contracts/TenGransToken.sol b/contracts/TenGransToken.sol index e41a49b..c3f6257 100644 --- a/contracts/TenGransToken.sol +++ b/contracts/TenGransToken.sol @@ -34,6 +34,7 @@ error InvalidInitialSupply(); contract TenGransToken is ERC20, ERC20Permit, ERC20Votes, ERC20FlashMint, ERC20Capped, IERC7802 { address public signer; mapping(address => bool) public transitionMinted; + uint256 public immutable nativeChainId; event TransitionMint(address indexed holder, uint256 amount); @@ -42,11 +43,13 @@ contract TenGransToken is ERC20, ERC20Permit, ERC20Votes, ERC20FlashMint, ERC20C string memory symbol, uint256 initialSupplyWei, uint256 capWei, - address _signer + address _signer, + uint256 _nativeChainId ) ERC20(name, symbol) ERC20Permit(name) ERC20Capped(capWei) { require(initialSupplyWei <= capWei, InvalidInitialSupply()); _mint(msg.sender, initialSupplyWei); signer = _signer; + nativeChainId = _nativeChainId; } /// @notice Allows the SuperchainTokenBridge to mint tokens. @@ -82,7 +85,7 @@ contract TenGransToken is ERC20, ERC20Permit, ERC20Votes, ERC20FlashMint, ERC20C /// @param snapshotQuantity Amount of tokens to mint. /// @param signature Signature of the holder. function transitionMint(address holder, uint256 snapshotQuantity, bytes memory signature) external { - require(block.chainid == 8453, InvalidChain()); + require(block.chainid == nativeChainId, InvalidChain()); require(!transitionMinted[holder], AlreadyMinted()); require(TransitionMintLib.verifyMintSignature(holder, snapshotQuantity, signature, signer), InvalidSignature());