Skip to content

Commit

Permalink
chore: static audit addition
Browse files Browse the repository at this point in the history
  • Loading branch information
kupermind committed Feb 23, 2024
1 parent a6ab295 commit 5984bc5
Show file tree
Hide file tree
Showing 5 changed files with 433 additions and 100 deletions.
253 changes: 253 additions & 0 deletions abis/0.8.23/OptimismMessenger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "OptimismMessenger",
"sourceName": "contracts/bridges/OptimismMessenger.sol",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_CDMContractProxyHome",
"type": "address"
},
{
"internalType": "address",
"name": "_foreignGovernor",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "CDMContractProxyHome",
"type": "address"
}
],
"name": "CDMContractProxyHomeOnly",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "foreignGovernor",
"type": "address"
}
],
"name": "ForeignGovernorOnly",
"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": "target",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "payload",
"type": "bytes"
}
],
"name": "TargetExecFailed",
"type": "error"
},
{
"inputs": [],
"name": "ZeroAddress",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "foreignMessageSender",
"type": "address"
}
],
"name": "ForeignGovernorUpdated",
"type": "event"
},
{
"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": "foreignMessageSender",
"type": "address"
},
{
"indexed": false,
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "MessageReceived",
"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": "newForeignGovernor",
"type": "address"
}
],
"name": "changeForeignGovernor",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "foreignGovernor",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "processMessageFromForeign",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
],
"bytecode": "0x60a060405234801561000f575f80fd5b50604051610b51380380610b5183398101604081905261002e916100ab565b6001600160a01b038216158061004b57506001600160a01b038116155b156100695760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b039182166080525f80546001600160a01b031916919092161790556100dc565b80516001600160a01b03811681146100a6575f80fd5b919050565b5f80604083850312156100bc575f80fd5b6100c583610090565b91506100d360208401610090565b90509250929050565b608051610a496101085f395f818160cd01528181610290015281816102f8015261036d0152610a495ff3fe60806040526004361061005b575f3560e01c8063cd9e30d911610041578063cd9e30d914610119578063dd32a5061461012c578063f02fb77414610157575f80fd5b8063400a2c101461009b578063c8404330146100bc575f80fd5b366100975760405134815233907f8e47b87b0ef542cdfa1659c551d88bad38aa7f452d2bbb349ab7530dfec8be8f9060200160405180910390a2005b5f80fd5b3480156100a6575f80fd5b506100ba6100b5366004610792565b610179565b005b3480156100c7575f80fd5b506100ef7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100ba6101273660046107e1565b610278565b348015610137575f80fd5b505f546100ef9073ffffffffffffffffffffffffffffffffffffffff1681565b348015610162575f80fd5b5061016b602481565b604051908152602001610110565b3330146101bf576040517f0dbc9bfc0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811661020c576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316908117825560405190917ff453e38063153897c0cb53422f7eb5eed0ee1866e8d47fd6b302acbe3b5d221d91a250565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610325576040517f9a63be9400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044016101b6565b5f8054604080517f6e296e45000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff92831693927f00000000000000000000000000000000000000000000000000000000000000001691636e296e45916004808301926020929190829003018187875af11580156103b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103db91906108aa565b90508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610462576040517f33527f4900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8083166004830152831660248201526044016101b6565b825160248110156104ad5783516040517f34c9027a0000000000000000000000000000000000000000000000000000000081526101b691602491600401918252602082015260400190565b5f5b8181101561071957848101601481015160208201516024928301519290930192909173ffffffffffffffffffffffffffffffffffffffff831661051e576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b47826bffffffffffffffffffffffff16111561057c576040517fcf4791810000000000000000000000000000000000000000000000000000000081526bffffffffffffffffffffffff831660048201524760248201526044016101b6565b5f8163ffffffff1667ffffffffffffffff81111561059c5761059c6107b4565b6040519080825280601f01601f1916602001820160405280156105c6576020820181803683370190505b5090505f5b8263ffffffff1681101561064757896105e482886108c5565b815181106105f4576105f4610903565b602001015160f81c60f81b82828151811061061157610611610903565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053506001016105cb565b5061065863ffffffff8316866108c5565b94505f8473ffffffffffffffffffffffffffffffffffffffff16846bffffffffffffffffffffffff168360405161068f9190610952565b5f6040518083038185875af1925050503d805f81146106c9576040519150601f19603f3d011682016040523d82523d5f602084013e6106ce565b606091505b505090508061070f578484836040517f6cfc79a50000000000000000000000000000000000000000000000000000000081526004016101b6939291906109b6565b50505050506104af565b508273ffffffffffffffffffffffffffffffffffffffff167f3c64b439784b3c09eba93acf868463aed0e339a92920e1d8822118261dfc1a7d856040516107609190610a01565b60405180910390a250505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461078f575f80fd5b50565b5f602082840312156107a2575f80fd5b81356107ad8161076e565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f602082840312156107f1575f80fd5b813567ffffffffffffffff80821115610808575f80fd5b818401915084601f83011261081b575f80fd5b81358181111561082d5761082d6107b4565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715610873576108736107b4565b8160405282815287602084870101111561088b575f80fd5b826020860160208301375f928101602001929092525095945050505050565b5f602082840312156108ba575f80fd5b81516107ad8161076e565b808201808211156108fd577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f5b8381101561094a578181015183820152602001610932565b50505f910152565b5f8251610963818460208701610930565b9190910192915050565b5f8151808452610984816020860160208601610930565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff841681526bffffffffffffffffffffffff83166020820152606060408201525f6109f8606083018461096d565b95945050505050565b602081525f6107ad602083018461096d56fea26469706673582212204c2627aed997e8c766c34ae7fd057e74b8dfd4c62b882d9a3c3d9b43abfd976e64736f6c63430008170033",
"deployedBytecode": "0x60806040526004361061005b575f3560e01c8063cd9e30d911610041578063cd9e30d914610119578063dd32a5061461012c578063f02fb77414610157575f80fd5b8063400a2c101461009b578063c8404330146100bc575f80fd5b366100975760405134815233907f8e47b87b0ef542cdfa1659c551d88bad38aa7f452d2bbb349ab7530dfec8be8f9060200160405180910390a2005b5f80fd5b3480156100a6575f80fd5b506100ba6100b5366004610792565b610179565b005b3480156100c7575f80fd5b506100ef7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100ba6101273660046107e1565b610278565b348015610137575f80fd5b505f546100ef9073ffffffffffffffffffffffffffffffffffffffff1681565b348015610162575f80fd5b5061016b602481565b604051908152602001610110565b3330146101bf576040517f0dbc9bfc0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811661020c576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316908117825560405190917ff453e38063153897c0cb53422f7eb5eed0ee1866e8d47fd6b302acbe3b5d221d91a250565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610325576040517f9a63be9400000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660248201526044016101b6565b5f8054604080517f6e296e45000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff92831693927f00000000000000000000000000000000000000000000000000000000000000001691636e296e45916004808301926020929190829003018187875af11580156103b7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103db91906108aa565b90508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610462576040517f33527f4900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8083166004830152831660248201526044016101b6565b825160248110156104ad5783516040517f34c9027a0000000000000000000000000000000000000000000000000000000081526101b691602491600401918252602082015260400190565b5f5b8181101561071957848101601481015160208201516024928301519290930192909173ffffffffffffffffffffffffffffffffffffffff831661051e576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b47826bffffffffffffffffffffffff16111561057c576040517fcf4791810000000000000000000000000000000000000000000000000000000081526bffffffffffffffffffffffff831660048201524760248201526044016101b6565b5f8163ffffffff1667ffffffffffffffff81111561059c5761059c6107b4565b6040519080825280601f01601f1916602001820160405280156105c6576020820181803683370190505b5090505f5b8263ffffffff1681101561064757896105e482886108c5565b815181106105f4576105f4610903565b602001015160f81c60f81b82828151811061061157610611610903565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053506001016105cb565b5061065863ffffffff8316866108c5565b94505f8473ffffffffffffffffffffffffffffffffffffffff16846bffffffffffffffffffffffff168360405161068f9190610952565b5f6040518083038185875af1925050503d805f81146106c9576040519150601f19603f3d011682016040523d82523d5f602084013e6106ce565b606091505b505090508061070f578484836040517f6cfc79a50000000000000000000000000000000000000000000000000000000081526004016101b6939291906109b6565b50505050506104af565b508273ffffffffffffffffffffffffffffffffffffffff167f3c64b439784b3c09eba93acf868463aed0e339a92920e1d8822118261dfc1a7d856040516107609190610a01565b60405180910390a250505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461078f575f80fd5b50565b5f602082840312156107a2575f80fd5b81356107ad8161076e565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f602082840312156107f1575f80fd5b813567ffffffffffffffff80821115610808575f80fd5b818401915084601f83011261081b575f80fd5b81358181111561082d5761082d6107b4565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715610873576108736107b4565b8160405282815287602084870101111561088b575f80fd5b826020860160208301375f928101602001929092525095945050505050565b5f602082840312156108ba575f80fd5b81516107ad8161076e565b808201808211156108fd577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f5b8381101561094a578181015183820152602001610932565b50505f910152565b5f8251610963818460208701610930565b9190910192915050565b5f8151808452610984816020860160208601610930565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff841681526bffffffffffffffffffffffff83166020820152606060408201525f6109f8606083018461096d565b95945050505050565b602081525f6107ad602083018461096d56fea26469706673582212204c2627aed997e8c766c34ae7fd057e74b8dfd4c62b882d9a3c3d9b43abfd976e64736f6c63430008170033",
"linkReferences": {},
"deployedLinkReferences": {}
}
44 changes: 44 additions & 0 deletions docs/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,49 @@
"address": "0x670Ac235EE13C0B2a5065282bBB0c61cfB354592"
}
]
},
{
"name": "optimistic",
"chainId": "10",
"contracts": [
{
"name": "OptimismMessenger",
"artifact": "abis/0.8.23/OptimismMessenger.json",
"address": ""
}
]
},
{
"name": "optimisticSepolia",
"chainId": "11155420",
"contracts": [
{
"name": "OptimismMessenger",
"artifact": "abis/0.8.23/OptimismMessenger.json",
"address": "0x670Ac235EE13C0B2a5065282bBB0c61cfB354592"
}
]
},
{
"name": "base",
"chainId": "8453",
"contracts": [
{
"name": "OptimismMessenger",
"artifact": "abis/0.8.23/OptimismMessenger.json",
"address": ""
}
]
},
{
"name": "baseSepolia",
"chainId": "84532",
"contracts": [
{
"name": "OptimismMessenger",
"artifact": "abis/0.8.23/OptimismMessenger.json",
"address": "0xeDd71796B90eaCc56B074C39BAC90ED2Ca6D93Ee"
}
]
}
]
Loading

0 comments on commit 5984bc5

Please sign in to comment.