Skip to content

Commit

Permalink
Merge pull request #204 from lidofinance/feat/optimism-contract-abi
Browse files Browse the repository at this point in the history
feat: add `OptimismL1CrossDomainMessengerProxy` contract abi support
  • Loading branch information
AnnaSila authored Oct 8, 2024
2 parents a59b336 + cd0620f commit b33417a
Show file tree
Hide file tree
Showing 3 changed files with 321 additions and 0 deletions.
314 changes: 314 additions & 0 deletions abi/OptimismL1CrossDomainMessengerProxy.abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,314 @@
[
{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" },
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "msgHash",
"type": "bytes32"
}
],
"name": "FailedRelayedMessage",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "msgHash",
"type": "bytes32"
}
],
"name": "RelayedMessage",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "target",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": false,
"internalType": "bytes",
"name": "message",
"type": "bytes"
},
{
"indexed": false,
"internalType": "uint256",
"name": "messageNonce",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "gasLimit",
"type": "uint256"
}
],
"name": "SentMessage",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "SentMessageExtension1",
"type": "event"
},
{
"inputs": [],
"name": "MESSAGE_VERSION",
"outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MIN_GAS_CALLDATA_OVERHEAD",
"outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR",
"outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR",
"outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "OTHER_MESSENGER",
"outputs": [
{
"internalType": "contract CrossDomainMessenger",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "PORTAL",
"outputs": [
{
"internalType": "contract OptimismPortal",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "RELAY_CALL_OVERHEAD",
"outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "RELAY_CONSTANT_OVERHEAD",
"outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "RELAY_GAS_CHECK_BUFFER",
"outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "RELAY_RESERVED_GAS",
"outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes", "name": "_message", "type": "bytes" },
{ "internalType": "uint32", "name": "_minGasLimit", "type": "uint32" }
],
"name": "baseGas",
"outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
"name": "failedMessages",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract SuperchainConfig",
"name": "_superchainConfig",
"type": "address"
},
{
"internalType": "contract OptimismPortal",
"name": "_portal",
"type": "address"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "messageNonce",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "otherMessenger",
"outputs": [
{
"internalType": "contract CrossDomainMessenger",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "paused",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "portal",
"outputs": [
{
"internalType": "contract OptimismPortal",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "_nonce", "type": "uint256" },
{ "internalType": "address", "name": "_sender", "type": "address" },
{ "internalType": "address", "name": "_target", "type": "address" },
{ "internalType": "uint256", "name": "_value", "type": "uint256" },
{ "internalType": "uint256", "name": "_minGasLimit", "type": "uint256" },
{ "internalType": "bytes", "name": "_message", "type": "bytes" }
],
"name": "relayMessage",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_target", "type": "address" },
{ "internalType": "bytes", "name": "_message", "type": "bytes" },
{ "internalType": "uint32", "name": "_minGasLimit", "type": "uint32" }
],
"name": "sendMessage",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
"name": "successfulMessages",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "superchainConfig",
"outputs": [
{
"internalType": "contract SuperchainConfig",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "version",
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "xDomainMessageSender",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
}
]
5 changes: 5 additions & 0 deletions modules/blockChain/contractAddresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,8 @@ export const Snapshot: ChainAddressMap = {
export const L1ERC20TokenBridge: ChainAddressMap = {
[CHAINS.Mainnet]: '0x76943C0D61395d8F2edF9060e1533529cAe05dE6',
}

// Address reference: https://docs.optimism.io/chain/addresses#ethereum-l1
export const OptimismL1CrossDomainMessengerProxy: ChainAddressMap = {
[CHAINS.Mainnet]: '0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1',
}
2 changes: 2 additions & 0 deletions modules/votes/hooks/useEvmScriptDecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ export function useEVMScriptDecoder(): EVMScriptDecoder {
[KEYS.Burner]: abis.BurnerAbi__factory.abi,
[KEYS.SimpleDVT]: abis.NodeOperatorsRegistryAbi__factory.abi,
[KEYS.L1ERC20TokenBridge]: abis.L1ERC20TokenBridgeAbi__factory.abi,
[KEYS.OptimismL1CrossDomainMessengerProxy]:
abis.OptimismL1CrossDomainMessengerProxyAbi__factory.abi,
})

const etherscanDecoder = new abiProviders.Base({
Expand Down

0 comments on commit b33417a

Please sign in to comment.