diff --git a/packages/contracts-bedrock/semver-lock.json b/packages/contracts-bedrock/semver-lock.json index 3aed12e4791e..bbfa7aeaae20 100644 --- a/packages/contracts-bedrock/semver-lock.json +++ b/packages/contracts-bedrock/semver-lock.json @@ -125,7 +125,7 @@ }, "src/L2/OptimismSuperchainERC20Factory.sol": { "initCodeHash": "0x98011045722178751e4a1112892f7d9a11bc1f5e42ac18205b6d30a1f1476d24", - "sourceCodeHash": "0x3206f4640662183bfbcd9c183b0d1c5d67c3ea670143daa731f23f62c0ae0855" + "sourceCodeHash": "0xc64e7f9719edf94a83ac8854b6236c451b8a0fb0e998621c41f4f1c94b5e46d3" }, "src/L2/SequencerFeeVault.sol": { "initCodeHash": "0xb94145f571e92ee615c6fe903b6568e8aac5fe760b6b65148ffc45d2fb0f5433", diff --git a/packages/contracts-bedrock/src/L2/OptimismSuperchainERC20Factory.sol b/packages/contracts-bedrock/src/L2/OptimismSuperchainERC20Factory.sol index 95ae5bc071a6..ea27b526af95 100644 --- a/packages/contracts-bedrock/src/L2/OptimismSuperchainERC20Factory.sol +++ b/packages/contracts-bedrock/src/L2/OptimismSuperchainERC20Factory.sol @@ -18,7 +18,7 @@ contract OptimismSuperchainERC20Factory is IOptimismERC20Factory, ISemver { /// This is used to keep track of the token deployments. mapping(address superchainToken => address remoteToken) public deployments; - /// @notice Emitted when a OptimismSuperchainERC20 is deployed. + /// @notice Emitted when an OptimismSuperchainERC20 is deployed. /// @param superchainToken Address of the SuperchainERC20 deployment. /// @param remoteToken Address of the corresponding token on the remote chain. /// @param deployer Address of the account that deployed the token. @@ -45,20 +45,16 @@ contract OptimismSuperchainERC20Factory is IOptimismERC20Factory, ISemver { external returns (address _superchainERC20) { - // Encode the `initialize` call data for the OptimismSuperchainERC20. bytes memory initCallData = abi.encodeCall(OptimismSuperchainERC20.initialize, (_remoteToken, _name, _symbol, _decimals)); - // Encode the BeaconProxy creation code with the beacon contract address and the `initialize` call data. bytes memory creationCode = bytes.concat( type(BeaconProxy).creationCode, abi.encode(Predeploys.OPTIMISM_SUPERCHAIN_ERC20_BEACON, initCallData) ); - // Use CREATE3 for deterministic deployment. bytes32 salt = keccak256(abi.encode(_remoteToken, _name, _symbol, _decimals)); _superchainERC20 = CREATE3.deploy({ salt: salt, creationCode: creationCode, value: 0 }); - // Store OptimismSuperchainERC20 and remote token addresses deployments[_superchainERC20] = _remoteToken; emit OptimismSuperchainERC20Created(_superchainERC20, _remoteToken, msg.sender);