-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
abf4834
commit 2586607
Showing
13 changed files
with
969 additions
and
975 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,55 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.25; | ||
|
||
import {OptimismSuperchainERC20} from "@contracts-bedrock/L2/OptimismSuperchainERC20.sol"; | ||
import {ZeroAddress} from "@contracts-bedrock/libraries/errors/CommonErrors.sol"; | ||
import {SuperchainERC20} from "@contracts-bedrock/L2/OptimismSuperchainERC20.sol"; | ||
|
||
/// @title L2NativeSuperchainERC20 | ||
/// @notice Mock implementation of a native Superchain ERC20 token that is L2 native (not backed by an L1 native token). | ||
/// The mint/burn functionality is intentionally open to ANYONE to make it easier to test with. For production use, | ||
/// this functionality should be restricted. | ||
contract L2NativeSuperchainERC20 is OptimismSuperchainERC20 { | ||
constructor() OptimismSuperchainERC20() { | ||
this.initialize(address(0), "L2NativeOptimismSuperchainERC20", "MockSuperc20", 18); | ||
contract L2NativeSuperchainERC20 is SuperchainERC20 { | ||
/// @notice Emitted whenever tokens are minted for an account. | ||
/// @param account Address of the account tokens are being minted for. | ||
/// @param amount Amount of tokens minted. | ||
event Mint(address indexed account, uint256 amount); | ||
|
||
/// @notice Emitted whenever tokens are burned from an account. | ||
/// @param account Address of the account tokens are being burned from. | ||
/// @param amount Amount of tokens burned. | ||
event Burn(address indexed account, uint256 amount); | ||
|
||
/// @notice Allows ANYONE to mint tokens. For production use, this should be restricted. | ||
/// @param _to Address to mint tokens to. | ||
/// @param _amount Amount of tokens to mint. | ||
function mint(address _to, uint256 _amount) external virtual { | ||
if (_to == address(0)) revert ZeroAddress(); | ||
|
||
_mint(_to, _amount); | ||
|
||
emit Mint(_to, _amount); | ||
} | ||
|
||
/// @notice Allows ANYONE to burn tokens. For production use, this should be restricted. | ||
/// @param _from Address to burn tokens from. | ||
/// @param _amount Amount of tokens to burn. | ||
function burn(address _from, uint256 _amount) external virtual { | ||
if (_from == address(0)) revert ZeroAddress(); | ||
|
||
_burn(_from, _amount); | ||
|
||
emit Burn(_from, _amount); | ||
} | ||
|
||
function name() public pure virtual override returns (string memory) { | ||
return "L2NativeSuperchainERC20"; | ||
} | ||
|
||
function symbol() public pure virtual override returns (string memory) { | ||
return "MOCK"; | ||
} | ||
|
||
function decimals() public pure override returns (uint8) { | ||
return 18; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
{ | ||
"OpChainProxyAdmin": "0x0c2405b5f131d7fe2e1f49e41e8a20d8e4179e7e", | ||
"AddressManager": "0x42a906372a5761dddf8477fa24122caef0b305d1", | ||
"L1ERC721BridgeProxy": "0xcc2ce1a81a754389eb1f93cde7a999db9c68ecf2", | ||
"SystemConfigProxy": "0xfd19a33f8d757b8ea93bb2b40b1cde946c1e1f4d", | ||
"OptimismMintableERC20FactoryProxy": "0x021ec3112045a0de18fb419f6560e243f576cfdb", | ||
"L1StandardBridgeProxy": "0x8d515eb0e5f293b16b6bbca8275c060bae0056b0", | ||
"L1CrossDomainMessengerProxy": "0xcd712b03bc6424bf45ce6c29fc90ffdece228f6e", | ||
"OptimismPortalProxy": "0x37a418800d0c812a9de83bc80e993a6b76511b57", | ||
"DisputeGameFactoryProxy": "0x124efba5858a36f53726e107481e71d9060d84e0", | ||
"AnchorStateRegistryProxy": "0xd4589582d87eb7de8f473656068bb149ae215389", | ||
"AnchorStateRegistryImpl": "0xaf742bff47b634e4fe00d733e9f04a1486c796c5", | ||
"OpChainProxyAdmin": "0xc3de06900f3e76d6bc005a9639929d87565c8c87", | ||
"AddressManager": "0x2436a5d2c0f98fffcffc10a23b91d3bc158bdc8e", | ||
"L1ERC721BridgeProxy": "0x8ae6e5f6dd884b5575dfa15febd945cb750bae21", | ||
"SystemConfigProxy": "0x15b3905c9747d9e3b55c9ebfb81935747ac94e9f", | ||
"OptimismMintableERC20FactoryProxy": "0x1d6243294634b63cb33a2df81b2b0182ee799937", | ||
"L1StandardBridgeProxy": "0x50de125fac6bde454e8f1e44b5daf5cd2f9e3312", | ||
"L1CrossDomainMessengerProxy": "0x0247fb5f5612b2c380cc19df7b6eed626d4c92c9", | ||
"OptimismPortalProxy": "0xc922a322d8da56b979bdd27cbe069dad6e37b355", | ||
"DisputeGameFactoryProxy": "0x855f93f4c96fe1cfdb7107af5ad2ce447f4023c1", | ||
"AnchorStateRegistryProxy": "0x729c78c9d5e549d3a4b4244024d644d5a14d8740", | ||
"AnchorStateRegistryImpl": "0x0000000000000000000000000000000000000000", | ||
"FaultDisputeGame": "0x0000000000000000000000000000000000000000", | ||
"PermissionedDisputeGame": "0x808e407f89bea4ab6b65b57628628ffab6ab23e5", | ||
"DelayedWETHPermissionedGameProxy": "0x65b4322cde0ac9d47196bd2e0ecf31c2e462722a", | ||
"PermissionedDisputeGame": "0xabdddc5105128bf36be5fa0bffaa02cde670f367", | ||
"DelayedWETHPermissionedGameProxy": "0x3459a0efebc4d588c3b385ff704c425ca4158c60", | ||
"DelayedWETHPermissionlessGameProxy": "0x0000000000000000000000000000000000000000" | ||
} | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
{ | ||
"OpChainProxyAdmin": "0xd98e0b378583bbcc8183184ce053aecbd15f22e5", | ||
"AddressManager": "0x90d0b458313d3a207ccc688370ee76b75200eada", | ||
"L1ERC721BridgeProxy": "0xdc0917c61a4cd589b29b6464257d564c0abebb2a", | ||
"SystemConfigProxy": "0xfb295aa436f23be2bd17678adf1232bdec02fed1", | ||
"OptimismMintableERC20FactoryProxy": "0xd4e933aa1f37a755135d7623488a383f8208cc7c", | ||
"L1StandardBridgeProxy": "0x67b2ab287a32bb9ace84f6a5a30a62597b10ade9", | ||
"L1CrossDomainMessengerProxy": "0xeca0f912b4bd255f3851951cae5775cc9400aa3b", | ||
"OptimismPortalProxy": "0x35e67bc631c327b60c6a39cff6b03a8adbb19c2d", | ||
"DisputeGameFactoryProxy": "0x94e2e1fcbfd1099b450b2d5ac1f1701327361163", | ||
"AnchorStateRegistryProxy": "0x9883f4e327051da515a177b11d8b9b6f6a5a9cfb", | ||
"AnchorStateRegistryImpl": "0x973da266292b2bb1f7f6de73da2e6e084b8d24c7", | ||
"OpChainProxyAdmin": "0x81d7334a335aead858f944a0599bcfe480b73529", | ||
"AddressManager": "0x6fefb0b566fd9ed681e269eb535f6196111f001c", | ||
"L1ERC721BridgeProxy": "0xdb6bd925c38cdda7dae0c4b668393ce11d8d8ddc", | ||
"SystemConfigProxy": "0xc6bd6b302a6eca941146ad6a7561f5b06911459c", | ||
"OptimismMintableERC20FactoryProxy": "0xb6d8654320e1f1f15af040dd16a710fafdd5b72b", | ||
"L1StandardBridgeProxy": "0xa78329047878aad77985dda1e6536ee305a0d2e6", | ||
"L1CrossDomainMessengerProxy": "0x50b6969a718a2c4ef0887e3437705b5e3a37ea5f", | ||
"OptimismPortalProxy": "0x94e7d18c790fa3e996790d644130cb0e779a2af7", | ||
"DisputeGameFactoryProxy": "0xbbed2b95e1525a7fe091f7e53dc58e4edaf8952c", | ||
"AnchorStateRegistryProxy": "0xb7ecd8724a221d5097b3756b88b500d4ed02b3c8", | ||
"AnchorStateRegistryImpl": "0x0000000000000000000000000000000000000000", | ||
"FaultDisputeGame": "0x0000000000000000000000000000000000000000", | ||
"PermissionedDisputeGame": "0x25d6b9b92056dd642761b2145073225887424a80", | ||
"DelayedWETHPermissionedGameProxy": "0xf6892a113c9dd542e6d9a652a560a1f1dac33c8e", | ||
"PermissionedDisputeGame": "0xa402044e0ee1733f569314fdab9e50a3e0bfeecf", | ||
"DelayedWETHPermissionedGameProxy": "0xb291efcedf8abfba3630d883f9fd4ec4f4361c82", | ||
"DelayedWETHPermissionlessGameProxy": "0x0000000000000000000000000000000000000000" | ||
} | ||
|
Oops, something went wrong.