diff --git a/cross-chain/optimism/.gitignore b/cross-chain/optimism/.gitignore index 64240eb35..9ed245ce0 100644 --- a/cross-chain/optimism/.gitignore +++ b/cross-chain/optimism/.gitignore @@ -10,6 +10,7 @@ !/deployments/mainnet/ !/deployments/optimism/ !/deployments/optimismGoerli/ +!/deployments/optimismSepolia/ # OZ /.openzeppelin/unknown-*.json diff --git a/cross-chain/optimism/README.adoc b/cross-chain/optimism/README.adoc index 0970bd560..29884e230 100644 --- a/cross-chain/optimism/README.adoc +++ b/cross-chain/optimism/README.adoc @@ -27,7 +27,7 @@ Wormhole-specific tBTC representation into the canonical `OptimismTBTC` token. The deployment scripts are responsible for managing updates of the tBTC gateway addresses across various chains. These addresses are stored in the `external/` -directory for a specific network, such as `optimismGoerli/ArbitrumWormholeGateway.json.` +directory for a specific network, such as `optimismSepolia/ArbitrumWormholeGateway.json.` It is important to note that these addresses should remain constant for the mainnet network. However, there may be instances where a new version of a cross-chain module is deployed to the testing network, which would require a @@ -42,7 +42,7 @@ yarn deploy --network Supported networks: - `hardhat` - for local development -- `optimismGoerli` - L2 testing network +- `optimismSepolia` - L2 testing network - `optimism` - L2 mainnet Currently, this module does not deploy any contracts on L1. All the existing @@ -54,6 +54,6 @@ the contracts before running the deployment script. This command produces an `export.json` file containing contract deployment info. Note that for the chains other than `hardhat` the following environment variables are needed: -- `L2_CHAIN_API_URL` - URL to access blockchain services, e.g. `https://opt-goerli.g.alchemy.com/v2/` +- `L2_CHAIN_API_URL` - URL to access blockchain services, e.g. `https://optimism-sepolia.infura.io/v3/` - `L2_ACCOUNTS_PRIVATE_KEYS` - Private keys for the deployer and council `<0xOwnerPrivKey,0xCouncilPrivKey>` - `OPTIMISM_ETHERSCAN_API_KEY` - Optimism Etherscan API key diff --git a/cross-chain/optimism/deploy_l2/12_update_self_in_wormhole_gateway_mapping.ts b/cross-chain/optimism/deploy_l2/12_update_self_in_wormhole_gateway_mapping.ts index 320dd6c9b..4c0225f5f 100644 --- a/cross-chain/optimism/deploy_l2/12_update_self_in_wormhole_gateway_mapping.ts +++ b/cross-chain/optimism/deploy_l2/12_update_self_in_wormhole_gateway_mapping.ts @@ -6,9 +6,11 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { execute } = deployments const { deployer } = await getNamedAccounts() - // See https://book.wormhole.com/reference/contracts.html - // This ID is valid for both Optimism Goerli and Mainnet - const wormholeChainID = 24 + // See https://docs.wormhole.com/wormhole/blockchain-environments/evm#optimism + // and https://docs.wormhole.com/wormhole/blockchain-environments/evm#optimism-sepolia + // The value `24` is valid for both Optimism Goerli and Optimism Mainnet. The + // value for Optimism Sepolia is `10005`. + const wormholeChainID = hre.network.name === "optimismSepolia" ? 10005 : 24 const optimismWormholeGateway = await deployments.get( "OptimismWormholeGateway" diff --git a/cross-chain/optimism/deploy_l2/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts b/cross-chain/optimism/deploy_l2/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts index 32767e21e..23787727e 100644 --- a/cross-chain/optimism/deploy_l2/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts +++ b/cross-chain/optimism/deploy_l2/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts @@ -10,9 +10,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const fakeArbitrumWormholeGateway = "0x1af5DC16568EFF2d480a43A77E6C409e497FcFb9" - // See https://book.wormhole.com/reference/contracts.html - // This ID is valid for both Arbitrum Goerli and Mainnet - const arbitrumWormholeChainID = 23 + // See https://docs.wormhole.com/wormhole/blockchain-environments/evm#arbitrum + // and https://docs.wormhole.com/wormhole/blockchain-environments/evm#arbitrum-sepolia + // The value `23` is valid for both Arbitrum Goerli and Arbitrum Mainnet. The + // value for Arbitrum Sepolia is `10003`. + const arbitrumWormholeChainID = + hre.network.name === "optimismSepolia" ? 10003 : 23 const arbitrumWormholeGateway = await deployments.getOrNull( "ArbitrumWormholeGateway" @@ -38,4 +41,4 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { export default func func.tags = ["SetArbitrumGatewayAddress"] -func.dependencies = ["OptimismWormholeGateway"] +func.dependencies = ["OptimismWormholeGateway", "ArbitrumWormholeGateway"] diff --git a/cross-chain/optimism/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts b/cross-chain/optimism/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts index c266425f1..c05ea63e4 100644 --- a/cross-chain/optimism/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts +++ b/cross-chain/optimism/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts @@ -10,8 +10,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const fakePolygonWormholeGateway = "0x1af5DC16568EFF2d480a43A77E6C409e497FcFb9" - // See https://book.wormhole.com/reference/contracts.html - // This ID is valid for both Polygon Testnet (Mumbai) and Mainnet + // See https://docs.wormhole.com/wormhole/blockchain-environments/evm#polygon + // This ID is valid for both Polygonn Goerli-based Testnet (Mumbai) and + // Mainnet. Wormhole does not support the Sepolia-based Amoy Testnet yet. + // TODO: Update the ID once the support is added. const polygonWormholeChainID = 5 const polygonWormholeGateway = await deployments.getOrNull( @@ -36,4 +38,4 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { export default func func.tags = ["SetPolygonGatewayAddress"] -func.dependencies = ["OptimismWormholeGateway"] +func.dependencies = ["OptimismWormholeGateway", "PolygonWormholeGateway"] diff --git a/cross-chain/optimism/deploy_l2/15_update_with_base_in_wormhole_gateway_mapping.ts b/cross-chain/optimism/deploy_l2/15_update_with_base_in_wormhole_gateway_mapping.ts index 8c69bec2a..d02ca6872 100644 --- a/cross-chain/optimism/deploy_l2/15_update_with_base_in_wormhole_gateway_mapping.ts +++ b/cross-chain/optimism/deploy_l2/15_update_with_base_in_wormhole_gateway_mapping.ts @@ -9,9 +9,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { // Fake BaseWormholeGateway for local development purposes only. const fakeBaseWormholeGateway = "0x1af5DC16568EFF2d480a43A77E6C409e497FcFb9" - // See https://docs.wormhole.com/wormhole/blockchain-environments/evm#base - // This ID is valid for both Base Testnet and Mainnet - const baseWormholeChainID = 30 + // See https://docs.wormhole.com/wormhole/blockchain-environments/evm#base and + // https://docs.wormhole.com/wormhole/blockchain-environments/evm#base-sepolia + // The value `30` is valid for both Base Goerli and Base Mainnet. The value + // for Base Sepolia is `10004`. + const baseWormholeChainID = + hre.network.name === "optimismSepolia" ? 10004 : 30 const baseWormholeGateway = await deployments.getOrNull("BaseWormholeGateway") @@ -33,4 +36,4 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { export default func func.tags = ["SetBaseGatewayAddress"] -func.dependencies = ["BaseWormholeGateway"] +func.dependencies = ["BaseWormholeGateway", "OptimismWormholeGateway"] diff --git a/cross-chain/optimism/deployments/optimismSepolia/.chainId b/cross-chain/optimism/deployments/optimismSepolia/.chainId new file mode 100644 index 000000000..03f37de82 --- /dev/null +++ b/cross-chain/optimism/deployments/optimismSepolia/.chainId @@ -0,0 +1 @@ +11155420 \ No newline at end of file diff --git a/cross-chain/optimism/deployments/optimismSepolia/OptimismTBTC.json b/cross-chain/optimism/deployments/optimismSepolia/OptimismTBTC.json new file mode 100644 index 000000000..4780a231c --- /dev/null +++ b/cross-chain/optimism/deployments/optimismSepolia/OptimismTBTC.json @@ -0,0 +1,863 @@ +{ + "address": "0x9A82bE743f0120fA24893b1631B6b2817fD94b1D", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "GuardianAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "GuardianRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "MinterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "MinterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "addGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "addMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getGuardians", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMinters", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "guardians", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isGuardian", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isMinter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "minters", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "recoverERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC721Upgradeable", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "recoverERC721", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "removeGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "removeMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x9c6bd19d5c93dd63b491ee4cdc0eefd147c97eea649763af05c8757171d5eb31", + "receipt": { + "to": null, + "from": "0x68ad60CC5e8f3B7cC53beaB321cf0e6036962dBc", + "contractAddress": "0x9A82bE743f0120fA24893b1631B6b2817fD94b1D", + "transactionIndex": 1, + "gasUsed": "732402", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000202000001000000000000000000000000000000000000020000000000000000000800000000800000000000000001000000400000000200000000000000000002000000000000000080000000000000800000000000000008000000000000000400000000000000000000000000000000040000000020000000000000200020040000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x7ab0329724066b1d9cfa167ca892f07e51183c6bd4c32c5c6375f7fba6b4df5f", + "transactionHash": "0x9c6bd19d5c93dd63b491ee4cdc0eefd147c97eea649763af05c8757171d5eb31", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 8057689, + "transactionHash": "0x9c6bd19d5c93dd63b491ee4cdc0eefd147c97eea649763af05c8757171d5eb31", + "address": "0x9A82bE743f0120fA24893b1631B6b2817fD94b1D", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000001e9e56acdb2987dce23eb6e751c22d4f89296a06" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x7ab0329724066b1d9cfa167ca892f07e51183c6bd4c32c5c6375f7fba6b4df5f" + }, + { + "transactionIndex": 1, + "blockNumber": 8057689, + "transactionHash": "0x9c6bd19d5c93dd63b491ee4cdc0eefd147c97eea649763af05c8757171d5eb31", + "address": "0x9A82bE743f0120fA24893b1631B6b2817fD94b1D", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000068ad60cc5e8f3b7cc53beab321cf0e6036962dbc" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x7ab0329724066b1d9cfa167ca892f07e51183c6bd4c32c5c6375f7fba6b4df5f" + }, + { + "transactionIndex": 1, + "blockNumber": 8057689, + "transactionHash": "0x9c6bd19d5c93dd63b491ee4cdc0eefd147c97eea649763af05c8757171d5eb31", + "address": "0x9A82bE743f0120fA24893b1631B6b2817fD94b1D", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 2, + "blockHash": "0x7ab0329724066b1d9cfa167ca892f07e51183c6bd4c32c5c6375f7fba6b4df5f" + }, + { + "transactionIndex": 1, + "blockNumber": 8057689, + "transactionHash": "0x9c6bd19d5c93dd63b491ee4cdc0eefd147c97eea649763af05c8757171d5eb31", + "address": "0x9A82bE743f0120fA24893b1631B6b2817fD94b1D", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b2f6c5b73239c39360ee0ea95047565dab13e3c7", + "logIndex": 3, + "blockHash": "0x7ab0329724066b1d9cfa167ca892f07e51183c6bd4c32c5c6375f7fba6b4df5f" + } + ], + "blockNumber": 8057689, + "cumulativeGasUsed": "779291", + "status": 1, + "byzantium": true + }, + "numDeployments": 1, + "implementation": "0x1e9E56Acdb2987DCe23Eb6E751C22d4f89296a06", + "devdoc": "Contract deployed as upgradable proxy" +} \ No newline at end of file diff --git a/cross-chain/optimism/deployments/optimismSepolia/OptimismWormholeGateway.json b/cross-chain/optimism/deployments/optimismSepolia/OptimismWormholeGateway.json new file mode 100644 index 000000000..91d725a29 --- /dev/null +++ b/cross-chain/optimism/deployments/optimismSepolia/OptimismWormholeGateway.json @@ -0,0 +1,482 @@ +{ + "address": "0x5FB63D9e076a314023F2D1aB5dBFd7045C281EbA", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + } + ], + "name": "GatewayAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "mintingLimit", + "type": "uint256" + } + ], + "name": "MintingLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WormholeTbtcDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WormholeTbtcReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "recipientChain", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "recipient", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "arbiterFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "nonce", + "type": "uint32" + } + ], + "name": "WormholeTbtcSent", + "type": "event" + }, + { + "inputs": [], + "name": "bridge", + "outputs": [ + { + "internalType": "contract IWormholeTokenBridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "bridgeToken", + "outputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_address", + "type": "bytes32" + } + ], + "name": "fromWormholeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "gateways", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IWormholeTokenBridge", + "name": "_bridge", + "type": "address" + }, + { + "internalType": "contract IERC20Upgradeable", + "name": "_bridgeToken", + "type": "address" + }, + { + "internalType": "contract L2TBTC", + "name": "_tbtc", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "mintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "mintingLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedVm", + "type": "bytes" + } + ], + "name": "receiveTbtc", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "recipientChain", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "recipient", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "arbiterFee", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "nonce", + "type": "uint32" + } + ], + "name": "sendTbtc", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "tbtc", + "outputs": [ + { + "internalType": "contract L2TBTC", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "toWormholeAddress", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + } + ], + "name": "updateGatewayAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_mintingLimit", + "type": "uint256" + } + ], + "name": "updateMintingLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x6cf0ac49e6f7f299c837f74a3b039cfba103b2df0669b114f4d77874e850366e", + "receipt": { + "to": null, + "from": "0x68ad60CC5e8f3B7cC53beaB321cf0e6036962dBc", + "contractAddress": "0x5FB63D9e076a314023F2D1aB5dBFd7045C281EbA", + "transactionIndex": 1, + "gasUsed": "749851", + "logsBloom": "0x00000000000000010000000000000000400000000000000000800000000000000000000000000000000000000000000000000080000000000000000000000000000004000000000000000000000202000001000000000000000000000000000000000000020000000000000000000800000000800000800000000000000000400000000200000800000000000000000000000000000080000000000000800000000000000000000000000000000400000000000000000000000000000000000000000020000000000000000020040000000000000400000000000000000020000000000000000000000000000000000000000000000000000000001000000000", + "blockHash": "0x81aa7082bad1bbac4f694ea9f0572cf7a73056de5827296e7c54fbfd971a6b6a", + "transactionHash": "0x6cf0ac49e6f7f299c837f74a3b039cfba103b2df0669b114f4d77874e850366e", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 8095333, + "transactionHash": "0x6cf0ac49e6f7f299c837f74a3b039cfba103b2df0669b114f4d77874e850366e", + "address": "0x5FB63D9e076a314023F2D1aB5dBFd7045C281EbA", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000c3d46e0266d95215589de639cc4e93b79f88fc6c" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x81aa7082bad1bbac4f694ea9f0572cf7a73056de5827296e7c54fbfd971a6b6a" + }, + { + "transactionIndex": 1, + "blockNumber": 8095333, + "transactionHash": "0x6cf0ac49e6f7f299c837f74a3b039cfba103b2df0669b114f4d77874e850366e", + "address": "0x5FB63D9e076a314023F2D1aB5dBFd7045C281EbA", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000068ad60cc5e8f3b7cc53beab321cf0e6036962dbc" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x81aa7082bad1bbac4f694ea9f0572cf7a73056de5827296e7c54fbfd971a6b6a" + }, + { + "transactionIndex": 1, + "blockNumber": 8095333, + "transactionHash": "0x6cf0ac49e6f7f299c837f74a3b039cfba103b2df0669b114f4d77874e850366e", + "address": "0x5FB63D9e076a314023F2D1aB5dBFd7045C281EbA", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 2, + "blockHash": "0x81aa7082bad1bbac4f694ea9f0572cf7a73056de5827296e7c54fbfd971a6b6a" + }, + { + "transactionIndex": 1, + "blockNumber": 8095333, + "transactionHash": "0x6cf0ac49e6f7f299c837f74a3b039cfba103b2df0669b114f4d77874e850366e", + "address": "0x5FB63D9e076a314023F2D1aB5dBFd7045C281EbA", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b2f6c5b73239c39360ee0ea95047565dab13e3c7", + "logIndex": 3, + "blockHash": "0x81aa7082bad1bbac4f694ea9f0572cf7a73056de5827296e7c54fbfd971a6b6a" + } + ], + "blockNumber": 8095333, + "cumulativeGasUsed": "813840", + "status": 1, + "byzantium": true + }, + "numDeployments": 1, + "implementation": "0xc3D46e0266d95215589DE639cC4E93b79f88fc6C", + "devdoc": "Contract deployed as upgradable proxy" +} \ No newline at end of file diff --git a/cross-chain/optimism/external/optimismSepolia/ArbitrumWormholeGateway.json b/cross-chain/optimism/external/optimismSepolia/ArbitrumWormholeGateway.json new file mode 100644 index 000000000..3378b040e --- /dev/null +++ b/cross-chain/optimism/external/optimismSepolia/ArbitrumWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "0xc3d46e0266d95215589de639cc4e93b79f88fc6c" +} diff --git a/cross-chain/optimism/external/optimismSepolia/BaseWormholeGateway.json b/cross-chain/optimism/external/optimismSepolia/BaseWormholeGateway.json new file mode 100644 index 000000000..3378b040e --- /dev/null +++ b/cross-chain/optimism/external/optimismSepolia/BaseWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "0xc3d46e0266d95215589de639cc4e93b79f88fc6c" +} diff --git a/cross-chain/optimism/external/optimismSepolia/OptimismTokenBridge.json b/cross-chain/optimism/external/optimismSepolia/OptimismTokenBridge.json new file mode 100644 index 000000000..4e0c8c45a --- /dev/null +++ b/cross-chain/optimism/external/optimismSepolia/OptimismTokenBridge.json @@ -0,0 +1,3 @@ +{ + "address": "0x99737Ec4B815d816c49A385943baf0380e75c0Ac" +} diff --git a/cross-chain/optimism/external/optimismSepolia/OptimismWormholeTBTC.json b/cross-chain/optimism/external/optimismSepolia/OptimismWormholeTBTC.json new file mode 100644 index 000000000..2236412bb --- /dev/null +++ b/cross-chain/optimism/external/optimismSepolia/OptimismWormholeTBTC.json @@ -0,0 +1,3 @@ +{ + "address": "0x2133a5132c962f11f1ed6ca709132eef146d1b1c" +} diff --git a/cross-chain/optimism/external/optimismSepolia/SolanaWormholeGateway.json b/cross-chain/optimism/external/optimismSepolia/SolanaWormholeGateway.json new file mode 100644 index 000000000..dee25fa3e --- /dev/null +++ b/cross-chain/optimism/external/optimismSepolia/SolanaWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "0x69a22dc2e01ecd2ae40864822d4406ff8aed4e2b8932385dabe818422ff67e1b" +} diff --git a/cross-chain/optimism/external/sepolia/TokenBridge.json b/cross-chain/optimism/external/sepolia/TokenBridge.json new file mode 100644 index 000000000..c09d6e7c2 --- /dev/null +++ b/cross-chain/optimism/external/sepolia/TokenBridge.json @@ -0,0 +1,3 @@ +{ + "address": "0xDB5492265f6038831E89f495670FF909aDe94bd9" +} diff --git a/cross-chain/optimism/hardhat.config.ts b/cross-chain/optimism/hardhat.config.ts index 62fd7f58f..3ef366742 100644 --- a/cross-chain/optimism/hardhat.config.ts +++ b/cross-chain/optimism/hardhat.config.ts @@ -44,6 +44,15 @@ const config: HardhatUserConfig = { : undefined, tags: ["etherscan"], }, + sepolia: { + url: process.env.L1_CHAIN_API_URL || "", + chainId: 11155111, + deploy: ["deploy_l1"], + accounts: process.env.L1_ACCOUNTS_PRIVATE_KEYS + ? process.env.L1_ACCOUNTS_PRIVATE_KEYS.split(",") + : undefined, + tags: ["etherscan"], + }, mainnet: { url: process.env.L1_CHAIN_API_URL || "", chainId: 1, @@ -65,6 +74,21 @@ const config: HardhatUserConfig = { // l1: "goerli", // }, }, + optimismSepolia: { + url: process.env.L2_CHAIN_API_URL || "", + chainId: 11155420, + deploy: ["deploy_l2"], + accounts: process.env.L2_ACCOUNTS_PRIVATE_KEYS + ? process.env.L2_ACCOUNTS_PRIVATE_KEYS.split(",") + : undefined, + tags: ["optimism_etherscan"], + // In case of deployment failing with underpriced transaction error set + // the `gasPrice` parameter. + // gasPrice: 1000000000, + // companionNetworks: { + // l1: "sepolia", + // }, + }, optimism: { url: process.env.L2_CHAIN_API_URL || "", chainId: 10, @@ -82,40 +106,60 @@ const config: HardhatUserConfig = { external: { deployments: { goerli: ["./external/goerli"], + sepolia: ["./external/sepolia"], mainnet: ["./external/mainnet"], optimismGoerli: ["./external/optimismGoerli"], + optimismSepolia: ["./external/optimismSepolia"], optimism: ["./external/optimism"], }, }, deploymentArtifactsExport: { goerli: "artifacts/l1", + sepolia: "artifacts/l1", mainnet: "artifacts/l1", optimismGoerli: "artifacts/l2", + optimismSepolia: "artifacts/l2", optimism: "artifacts/l2", }, etherscan: { apiKey: { goerli: process.env.ETHERSCAN_API_KEY, + sepolia: process.env.ETHERSCAN_API_KEY, mainnet: process.env.ETHERSCAN_API_KEY, optimisticGoerli: process.env.OPTIMISM_ETHERSCAN_API_KEY, + optimisticSepolia: process.env.OPTIMISM_ETHERSCAN_API_KEY, optimisticEthereum: process.env.OPTIMISM_ETHERSCAN_API_KEY, }, + customChains: [ + { + network: "optimisticSepolia", + chainId: 11155420, + urls: { + apiURL: "https://api-sepolia-optimistic.etherscan.io/api", + browserURL: "https://sepolia-optimism.etherscan.io/", + }, + }, + ], }, namedAccounts: { deployer: { default: 1, goerli: 0, + sepolia: 0, optimismGoerli: 0, + optimismSepolia: 0, mainnet: "0x123694886DBf5Ac94DDA07135349534536D14cAf", optimism: "0x123694886DBf5Ac94DDA07135349534536D14cAf", }, governance: { default: 2, goerli: 0, + sepolia: 0, optimismGoerli: 0, + optimismSepolia: 0, mainnet: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", optimism: "0x7fB50BBabeDEE52b8760Ba15c0c199aF33Fc2EfA", }, diff --git a/cross-chain/optimism/package.json b/cross-chain/optimism/package.json index 6d1c8e009..017ecca40 100644 --- a/cross-chain/optimism/package.json +++ b/cross-chain/optimism/package.json @@ -31,6 +31,7 @@ "lint:config:fix": "prettier --write '**/*.@(json|yaml)'", "prepack": "tsc -p tsconfig.export.json && hardhat export-artifacts export/artifacts", "export-artifacts:goerli": "yarn hardhat export-deployment-artifacts --network optimismGoerli", + "export-artifacts:sepolia": "yarn hardhat export-deployment-artifacts --network optimismSepolia", "export-artifacts:mainnet": "yarn hardhat export-deployment-artifacts --network optimism", "prepublishOnly": "npm run export-artifacts:$npm_config_network", "test": "hardhat test"