diff --git a/packages/contracts-bedrock/semver-lock.json b/packages/contracts-bedrock/semver-lock.json index e73dd3b4527e..433b6ce92a16 100644 --- a/packages/contracts-bedrock/semver-lock.json +++ b/packages/contracts-bedrock/semver-lock.json @@ -125,7 +125,7 @@ }, "src/L2/SuperchainERC20.sol": { "initCodeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", - "sourceCodeHash": "0x6a384ccfb6f2f7316c1b33873a1630b5179e52475951d31771656e06d2b11519" + "sourceCodeHash": "0x45b9afdc9e52c27f192673388868a803f54d8f0bffe9defd81d584642e282b6b" }, "src/L2/SuperchainTokenBridge.sol": { "initCodeHash": "0xef7590c30630a75f105384e339e52758569c25a5aa0a5934c521e004b8f86220", diff --git a/packages/contracts-bedrock/src/L2/SuperchainERC20.sol b/packages/contracts-bedrock/src/L2/SuperchainERC20.sol index d723ed8d992b..a824dd3f9018 100644 --- a/packages/contracts-bedrock/src/L2/SuperchainERC20.sol +++ b/packages/contracts-bedrock/src/L2/SuperchainERC20.sol @@ -12,22 +12,18 @@ import { Unauthorized } from "src/libraries/errors/CommonErrors.sol"; /// bridging to make it fungible across the Superchain. This construction allows the SuperchainTokenBridge to /// burn and mint tokens. abstract contract SuperchainERC20 is ERC20, ICrosschainERC20, ISemver { - /// @notice A modifier that only allows the SuperchainTokenBridge to call - modifier onlySuperchainTokenBridge() { - if (msg.sender != Predeploys.SUPERCHAIN_TOKEN_BRIDGE) revert Unauthorized(); - _; - } - /// @notice Semantic version. - /// @custom:semver 1.0.0-beta.2 + /// @custom:semver 1.0.0-beta.3 function version() external view virtual returns (string memory) { - return "1.0.0-beta.2"; + return "1.0.0-beta.3"; } /// @notice Allows the SuperchainTokenBridge to mint tokens. /// @param _to Address to mint tokens to. /// @param _amount Amount of tokens to mint. - function crosschainMint(address _to, uint256 _amount) external onlySuperchainTokenBridge { + function crosschainMint(address _to, uint256 _amount) external { + if (msg.sender != Predeploys.SUPERCHAIN_TOKEN_BRIDGE) revert Unauthorized(); + _mint(_to, _amount); emit CrosschainMinted(_to, _amount); @@ -36,7 +32,9 @@ abstract contract SuperchainERC20 is ERC20, ICrosschainERC20, ISemver { /// @notice Allows the SuperchainTokenBridge to burn tokens. /// @param _from Address to burn tokens from. /// @param _amount Amount of tokens to burn. - function crosschainBurn(address _from, uint256 _amount) external onlySuperchainTokenBridge { + function crosschainBurn(address _from, uint256 _amount) external { + if (msg.sender != Predeploys.SUPERCHAIN_TOKEN_BRIDGE) revert Unauthorized(); + _burn(_from, _amount); emit CrosschainBurnt(_from, _amount);