Skip to content

Commit

Permalink
Merge pull request #156 from valory-xyz/mode
Browse files Browse the repository at this point in the history
chore: preparing for Mode deployment
  • Loading branch information
DavidMinarsch authored Oct 15, 2024
2 parents 8f85d91 + 425a626 commit 1a77410
Show file tree
Hide file tree
Showing 6 changed files with 419 additions and 104 deletions.
301 changes: 301 additions & 0 deletions abis/0.8.28/OptimismMessenger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,301 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "OptimismMessenger",
"sourceName": "contracts/bridges/OptimismMessenger.sol",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_CDMContractProxyHome",
"type": "address"
},
{
"internalType": "address",
"name": "_sourceGovernor",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "deliveryHash",
"type": "bytes32"
}
],
"name": "AlreadyDelivered",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "expected",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "provided",
"type": "uint256"
}
],
"name": "IncorrectDataLength",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "balance",
"type": "uint256"
}
],
"name": "InsufficientBalance",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "instance",
"type": "address"
}
],
"name": "SelfCallOnly",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "sourceGovernor",
"type": "address"
}
],
"name": "SourceGovernorOnly",
"type": "error"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "sender",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "sourceGovernor",
"type": "bytes32"
}
],
"name": "SourceGovernorOnly32",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "target",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "payload",
"type": "bytes"
}
],
"name": "TargetExecFailed",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "targetRelayer",
"type": "address"
}
],
"name": "TargetRelayerOnly",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "received",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "required",
"type": "uint256"
}
],
"name": "WrongSourceChainId",
"type": "error"
},
{
"inputs": [],
"name": "ZeroAddress",
"type": "error"
},
{
"inputs": [],
"name": "ZeroValue",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "FundsReceived",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "sourceMessageSender",
"type": "address"
},
{
"indexed": false,
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "MessageReceived",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "sourceGovernor",
"type": "address"
}
],
"name": "SourceGovernorUpdated",
"type": "event"
},
{
"inputs": [],
"name": "CDMContractProxyHome",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "DEFAULT_DATA_LENGTH",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newSourceGovernor",
"type": "address"
}
],
"name": "changeSourceGovernor",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "processMessageFromSource",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "sourceGovernor",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
],
"bytecode": "0x60a060405234801561000f575f5ffd5b50604051610b60380380610b6083398101604081905261002e916100ab565b6001600160a01b038216158061004b57506001600160a01b038116155b156100695760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b039182166080525f80546001600160a01b031916919092161790556100dc565b80516001600160a01b03811681146100a6575f5ffd5b919050565b5f5f604083850312156100bc575f5ffd5b6100c583610090565b91506100d360208401610090565b90509250929050565b608051610a586101085f395f818160ac01528181610191015281816101f901526102730152610a585ff3fe60806040526004361061005b575f3560e01c8063e3b94a2311610041578063e3b94a231461010d578063f02fb77414610138578063f8b4870f1461015a575f5ffd5b8063c84043301461009b578063d3042d2b146100f8575f5ffd5b366100975760405134815233907f8e47b87b0ef542cdfa1659c551d88bad38aa7f452d2bbb349ab7530dfec8be8f9060200160405180910390a2005b5f5ffd5b3480156100a6575f5ffd5b506100ce7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61010b6101063660046107a7565b610179565b005b348015610118575f5ffd5b505f546100ce9073ffffffffffffffffffffffffffffffffffffffff1681565b348015610143575f5ffd5b5061014c602481565b6040519081526020016100ef565b348015610165575f5ffd5b5061010b6101743660046108bb565b6103c4565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461022b576040517f2f3111fa00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b5f8054604080517f6e296e45000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff92831693927f00000000000000000000000000000000000000000000000000000000000000001691636e296e45916004808301926020929190829003018187875af11580156102bd573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102e191906108dd565b90508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610368576040517f978c830c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff808316600483015283166024820152604401610222565b610371836104be565b8173ffffffffffffffffffffffffffffffffffffffff167f3c64b439784b3c09eba93acf868463aed0e339a92920e1d8822118261dfc1a7d846040516103b79190610944565b60405180910390a2505050565b333014610405576040517f0dbc9bfc000000000000000000000000000000000000000000000000000000008152336004820152306024820152604401610222565b73ffffffffffffffffffffffffffffffffffffffff8116610452576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316908117825560405190917fbbc9d5867fd60faf098cfaa8adb3402dd83501cc76385968ddbb6b2610800f8e91a250565b805160248110156105095781516040517f34c9027a00000000000000000000000000000000000000000000000000000000815261022291602491600401918252602082015260400190565b5f5b8181101561077557828101601481015160208201516024928301519290930192909173ffffffffffffffffffffffffffffffffffffffff831661057a576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b47826bffffffffffffffffffffffff1611156105d8576040517fcf4791810000000000000000000000000000000000000000000000000000000081526bffffffffffffffffffffffff83166004820152476024820152604401610222565b5f8163ffffffff1667ffffffffffffffff8111156105f8576105f861077a565b6040519080825280601f01601f191660200182016040528015610622576020820181803683370190505b5090505f5b8263ffffffff168110156106a357876106408288610956565b8151811061065057610650610994565b602001015160f81c60f81b82828151811061066d5761066d610994565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a905350600101610627565b506106b463ffffffff831686610956565b94505f8473ffffffffffffffffffffffffffffffffffffffff16846bffffffffffffffffffffffff16836040516106eb91906109c1565b5f6040518083038185875af1925050503d805f8114610725576040519150601f19603f3d011682016040523d82523d5f602084013e61072a565b606091505b505090508061076b578484836040517f6cfc79a5000000000000000000000000000000000000000000000000000000008152600401610222939291906109d7565b505050505061050b565b505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f602082840312156107b7575f5ffd5b813567ffffffffffffffff8111156107cd575f5ffd5b8201601f810184136107dd575f5ffd5b803567ffffffffffffffff8111156107f7576107f761077a565b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160116810181811067ffffffffffffffff821117156108635761086361077a565b60405281815282820160200186101561087a575f5ffd5b816020840160208301375f91810160200191909152949350505050565b73ffffffffffffffffffffffffffffffffffffffff811681146108b8575f5ffd5b50565b5f602082840312156108cb575f5ffd5b81356108d681610897565b9392505050565b5f602082840312156108ed575f5ffd5b81516108d681610897565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f6108d660208301846108f8565b8082018082111561098e577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f82518060208501845e5f920191825250919050565b73ffffffffffffffffffffffffffffffffffffffff841681526bffffffffffffffffffffffff83166020820152606060408201525f610a1960608301846108f8565b9594505050505056fea26469706673582212209d12050ea35a6960a9a6298079b641c00335a704633799ff3870b47d081e597764736f6c634300081c0033",
"deployedBytecode": "0x60806040526004361061005b575f3560e01c8063e3b94a2311610041578063e3b94a231461010d578063f02fb77414610138578063f8b4870f1461015a575f5ffd5b8063c84043301461009b578063d3042d2b146100f8575f5ffd5b366100975760405134815233907f8e47b87b0ef542cdfa1659c551d88bad38aa7f452d2bbb349ab7530dfec8be8f9060200160405180910390a2005b5f5ffd5b3480156100a6575f5ffd5b506100ce7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61010b6101063660046107a7565b610179565b005b348015610118575f5ffd5b505f546100ce9073ffffffffffffffffffffffffffffffffffffffff1681565b348015610143575f5ffd5b5061014c602481565b6040519081526020016100ef565b348015610165575f5ffd5b5061010b6101743660046108bb565b6103c4565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461022b576040517f2f3111fa00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b5f8054604080517f6e296e45000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff92831693927f00000000000000000000000000000000000000000000000000000000000000001691636e296e45916004808301926020929190829003018187875af11580156102bd573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102e191906108dd565b90508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610368576040517f978c830c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff808316600483015283166024820152604401610222565b610371836104be565b8173ffffffffffffffffffffffffffffffffffffffff167f3c64b439784b3c09eba93acf868463aed0e339a92920e1d8822118261dfc1a7d846040516103b79190610944565b60405180910390a2505050565b333014610405576040517f0dbc9bfc000000000000000000000000000000000000000000000000000000008152336004820152306024820152604401610222565b73ffffffffffffffffffffffffffffffffffffffff8116610452576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316908117825560405190917fbbc9d5867fd60faf098cfaa8adb3402dd83501cc76385968ddbb6b2610800f8e91a250565b805160248110156105095781516040517f34c9027a00000000000000000000000000000000000000000000000000000000815261022291602491600401918252602082015260400190565b5f5b8181101561077557828101601481015160208201516024928301519290930192909173ffffffffffffffffffffffffffffffffffffffff831661057a576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b47826bffffffffffffffffffffffff1611156105d8576040517fcf4791810000000000000000000000000000000000000000000000000000000081526bffffffffffffffffffffffff83166004820152476024820152604401610222565b5f8163ffffffff1667ffffffffffffffff8111156105f8576105f861077a565b6040519080825280601f01601f191660200182016040528015610622576020820181803683370190505b5090505f5b8263ffffffff168110156106a357876106408288610956565b8151811061065057610650610994565b602001015160f81c60f81b82828151811061066d5761066d610994565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a905350600101610627565b506106b463ffffffff831686610956565b94505f8473ffffffffffffffffffffffffffffffffffffffff16846bffffffffffffffffffffffff16836040516106eb91906109c1565b5f6040518083038185875af1925050503d805f8114610725576040519150601f19603f3d011682016040523d82523d5f602084013e61072a565b606091505b505090508061076b578484836040517f6cfc79a5000000000000000000000000000000000000000000000000000000008152600401610222939291906109d7565b505050505061050b565b505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f602082840312156107b7575f5ffd5b813567ffffffffffffffff8111156107cd575f5ffd5b8201601f810184136107dd575f5ffd5b803567ffffffffffffffff8111156107f7576107f761077a565b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160116810181811067ffffffffffffffff821117156108635761086361077a565b60405281815282820160200186101561087a575f5ffd5b816020840160208301375f91810160200191909152949350505050565b73ffffffffffffffffffffffffffffffffffffffff811681146108b8575f5ffd5b50565b5f602082840312156108cb575f5ffd5b81356108d681610897565b9392505050565b5f602082840312156108ed575f5ffd5b81516108d681610897565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081525f6108d660208301846108f8565b8082018082111561098e577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f82518060208501845e5f920191825250919050565b73ffffffffffffffffffffffffffffffffffffffff841681526bffffffffffffffffffffffff83166020820152606060408201525f610a1960608301846108f8565b9594505050505056fea26469706673582212209d12050ea35a6960a9a6298079b641c00335a704633799ff3870b47d081e597764736f6c634300081c0033",
"linkReferences": {},
"deployedLinkReferences": {}
}
32 changes: 30 additions & 2 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ module.exports = {
accounts: accounts,
chainId: 42220,
},
mode: {
url: "https://mainnet.mode.network",
accounts: accounts,
chainId: 34443,
},
goerli: {
url: "https://eth-goerli.g.alchemy.com/v2/" + ALCHEMY_API_KEY_GOERLI,
chainId: 5,
Expand Down Expand Up @@ -116,6 +121,11 @@ module.exports = {
accounts: accounts,
chainId: 44787,
},
modeSepolia: {
url: "https://sepolia.mode.network",
accounts: accounts,
chainId: 919,
},
hardhat: {
allowUnlimitedContractSize: true
},
Expand Down Expand Up @@ -202,6 +212,22 @@ module.exports = {
browserURL: "https://alfajores-blockscout.celo-testnet.org/"
},
},
{
network: "mode",
chainId: 34443,
urls: {
apiURL: "https://explorer.mode.network/api",
browserURL: "https://explorer.mode.network"
},
},
{
network: "modeSepolia",
chainId: 919,
urls: {
apiURL: "https://sepolia.explorer.mode.network/api",
browserURL: "https://sepolia.explorer.mode.network"
},
},
],
apiKey: {
mainnet: ETHERSCAN_API_KEY,
Expand All @@ -218,13 +244,15 @@ module.exports = {
arbitrumSepolia: ARBISCAN_API_KEY,
optimisticSepolia: OPSCAN_API_KEY,
baseSepolia: OPSCAN_API_KEY,
celoAlfajores: CELOSCAN_API_KEY
celoAlfajores: CELOSCAN_API_KEY,
mode: OPSCAN_API_KEY,
modeSepolia: OPSCAN_API_KEY,
}
},
solidity: {
compilers: [
{
version: "0.8.25",
version: "0.8.28",
settings: {
optimizer: {
enabled: true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@nomicfoundation/hardhat-ethers": "^3.0.5",
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@nomiclabs/hardhat-etherscan": "^3.1.7",
"hardhat": "^2.22.4",
"hardhat": "^2.22.13",
"@typechain/hardhat": "^9.1.0",
"ethers": "^5.7.2",
"@typechain/ethers-v5": "^11.1.2",
Expand Down
Loading

0 comments on commit 1a77410

Please sign in to comment.