diff --git a/abi/dispatcher.json b/abi/dispatcher.json index 26bdbab..b8ed6fe 100644 --- a/abi/dispatcher.json +++ b/abi/dispatcher.json @@ -4,6 +4,13 @@ "inputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "acceptOwnership", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "acknowledgement", @@ -141,6 +148,88 @@ "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "channelCloseConfirm", + "inputs": [ + { + "name": "portAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "proof", + "type": "tuple", + "internalType": "struct Ics23Proof", + "components": [ + { + "name": "proof", + "type": "tuple[]", + "internalType": "struct OpIcs23Proof[]", + "components": [ + { + "name": "path", + "type": "tuple[]", + "internalType": "struct OpIcs23ProofPath[]", + "components": [ + { + "name": "prefix", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "suffix", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "key", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "value", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "prefix", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "height", + "type": "uint256", + "internalType": "uint256" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "channelCloseInit", + "inputs": [ + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "channelOpenAck", @@ -530,16 +619,16 @@ }, { "type": "function", - "name": "closeIbcChannel", - "inputs": [ + "name": "feeVault", + "inputs": [], + "outputs": [ { - "name": "channelId", - "type": "bytes32", - "internalType": "bytes32" + "name": "", + "type": "address", + "internalType": "contract IFeeVault" } ], - "outputs": [], - "stateMutability": "nonpayable" + "stateMutability": "view" }, { "type": "function", @@ -591,6 +680,11 @@ "name": "counterpartyChannelId", "type": "bytes32", "internalType": "bytes32" + }, + { + "name": "portId", + "type": "string", + "internalType": "string" } ] } @@ -599,12 +693,17 @@ }, { "type": "function", - "name": "getOptimisticConsensusState", + "name": "getState", "inputs": [ { "name": "height", "type": "uint256", "internalType": "uint256" + }, + { + "name": "connection", + "type": "string", + "internalType": "string" } ], "outputs": [ @@ -612,16 +711,6 @@ "name": "appHash", "type": "uint256", "internalType": "uint256" - }, - { - "name": "fraudProofEndTime", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "ended", - "type": "bool", - "internalType": "bool" } ], "stateMutability": "view" @@ -636,9 +725,9 @@ "internalType": "string" }, { - "name": "lightClient", + "name": "_feeVault", "type": "address", - "internalType": "contract LightClient" + "internalType": "contract IFeeVault" } ], "outputs": [], @@ -657,6 +746,19 @@ ], "stateMutability": "view" }, + { + "type": "function", + "name": "pendingOwner", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, { "type": "function", "name": "portPrefix", @@ -828,6 +930,19 @@ "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "removeConnection", + "inputs": [ + { + "name": "connection", + "type": "string", + "internalType": "string" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "renounceOwnership", @@ -855,6 +970,30 @@ "internalType": "uint64" } ], + "outputs": [ + { + "name": "sequence", + "type": "uint64", + "internalType": "uint64" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setClientForConnection", + "inputs": [ + { + "name": "connection", + "type": "string", + "internalType": "string" + }, + { + "name": "lightClient", + "type": "address", + "internalType": "contract ILightClient" + } + ], "outputs": [], "stateMutability": "nonpayable" }, @@ -1018,56 +1157,12 @@ }, { "type": "function", - "name": "updateClientWithOptimisticConsensusState", + "name": "updateClient", "inputs": [ - { - "name": "l1header", - "type": "tuple", - "internalType": "struct L1Header", - "components": [ - { - "name": "header", - "type": "bytes[]", - "internalType": "bytes[]" - }, - { - "name": "stateRoot", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "number", - "type": "uint64", - "internalType": "uint64" - } - ] - }, { "name": "proof", - "type": "tuple", - "internalType": "struct OpL2StateProof", - "components": [ - { - "name": "accountProof", - "type": "bytes[]", - "internalType": "bytes[]" - }, - { - "name": "outputRootProof", - "type": "bytes[]", - "internalType": "bytes[]" - }, - { - "name": "l2OutputProposalKey", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "l2BlockHash", - "type": "bytes32", - "internalType": "bytes32" - } - ] + "type": "bytes", + "internalType": "bytes" }, { "name": "height", @@ -1078,20 +1173,14 @@ "name": "appHash", "type": "uint256", "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "fraudProofEndTime", - "type": "uint256", - "internalType": "uint256" }, { - "name": "ended", - "type": "bool", - "internalType": "bool" + "name": "connection", + "type": "string", + "internalType": "string" } ], + "outputs": [], "stateMutability": "nonpayable" }, { @@ -1333,6 +1422,82 @@ ], "anonymous": false }, + { + "type": "event", + "name": "ChannelCloseConfirm", + "inputs": [ + { + "name": "portAddress", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "channelId", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ChannelCloseConfirmError", + "inputs": [ + { + "name": "receiver", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "error", + "type": "bytes", + "indexed": false, + "internalType": "bytes" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ChannelCloseInit", + "inputs": [ + { + "name": "portAddress", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "channelId", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ChannelCloseInitError", + "inputs": [ + { + "name": "receiver", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "error", + "type": "bytes", + "indexed": false, + "internalType": "bytes" + } + ], + "anonymous": false + }, { "type": "event", "name": "ChannelOpenAck", @@ -1414,7 +1579,7 @@ "name": "ChannelOpenInit", "inputs": [ { - "name": "recevier", + "name": "receiver", "type": "address", "indexed": true, "internalType": "address" @@ -1541,51 +1706,32 @@ }, { "type": "event", - "name": "CloseIbcChannel", + "name": "Initialized", "inputs": [ { - "name": "portAddress", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "channelId", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" + "name": "version", + "type": "uint8", + "indexed": false, + "internalType": "uint8" } ], "anonymous": false }, { "type": "event", - "name": "CloseIbcChannelError", + "name": "OwnershipTransferStarted", "inputs": [ { - "name": "receiver", + "name": "previousOwner", "type": "address", "indexed": true, "internalType": "address" }, { - "name": "error", - "type": "bytes", - "indexed": false, - "internalType": "bytes" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Initialized", - "inputs": [ - { - "name": "version", - "type": "uint8", - "indexed": false, - "internalType": "uint8" + "name": "newOwner", + "type": "address", + "indexed": true, + "internalType": "address" } ], "anonymous": false @@ -1825,6 +1971,22 @@ "name": "ackPacketCommitmentAlreadyExists", "inputs": [] }, + { + "type": "error", + "name": "channelIdNotFound", + "inputs": [ + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "channelNotOwnedByPortAddress", + "inputs": [] + }, { "type": "error", "name": "channelNotOwnedBySender", @@ -1832,7 +1994,33 @@ }, { "type": "error", - "name": "invalidCounterPartyPortId", + "name": "invalidAddress", + "inputs": [] + }, + { + "type": "error", + "name": "invalidConnection", + "inputs": [ + { + "name": "connection", + "type": "string", + "internalType": "string" + } + ] + }, + { + "type": "error", + "name": "invalidConnectionHops", + "inputs": [] + }, + { + "type": "error", + "name": "invalidCounterParty", + "inputs": [] + }, + { + "type": "error", + "name": "invalidPacket", "inputs": [] }, { @@ -1840,6 +2028,32 @@ "name": "invalidPacketSequence", "inputs": [] }, + { + "type": "error", + "name": "invalidPortPrefix", + "inputs": [] + }, + { + "type": "error", + "name": "invalidVersion", + "inputs": [] + }, + { + "type": "error", + "name": "lightClientNotFound", + "inputs": [ + { + "name": "connection", + "type": "string", + "internalType": "string" + } + ] + }, + { + "type": "error", + "name": "notEnoughGas", + "inputs": [] + }, { "type": "error", "name": "packetCommitmentNotFound", diff --git a/abi/fee.json b/abi/fee.json index 1db0ae3..2435c1c 100644 --- a/abi/fee.json +++ b/abi/fee.json @@ -1,222 +1,261 @@ {"abi": [ - { - "inputs": [ - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sent", - "type": "uint256" - } - ], - "name": "IncorrectFeeSent", - "type": "error" - }, - { + { + "type": "function", + "name": "acceptOwnership", "inputs": [], - "name": "NoFeeSent", - "type": "error" - }, - { - "inputs": [], - "name": "SenderNotDispatcher", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "sourceAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "string", - "name": "version", - "type": "string" - }, - { - "indexed": false, - "internalType": "enum ChannelOrder", - "name": "ordering", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "string[]", - "name": "connectionHops", - "type": "string[]" - }, - { - "indexed": false, - "internalType": "string", - "name": "counterpartyPortId", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - } - ], - "name": "OpenChannelFeeDeposited", - "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": true, - "internalType": "bytes32", - "name": "channelId", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "uint64", - "name": "sequence", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint256[2]", - "name": "gasLimits", - "type": "uint256[2]" - }, - { - "indexed": false, - "internalType": "uint256[2]", - "name": "gasPrices", - "type": "uint256[2]" - } - ], - "name": "SendPacketFeeDeposited", - "type": "event" - }, - { + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "depositOpenChannelFee", "inputs": [ - { - "internalType": "address", - "name": "src", - "type": "address" - }, - { - "internalType": "string", - "name": "version", - "type": "string" - }, - { - "internalType": "enum ChannelOrder", - "name": "ordering", - "type": "uint8" - }, - { - "internalType": "string[]", - "name": "connectionHops", - "type": "string[]" - }, - { - "internalType": "string", - "name": "counterpartyPortId", - "type": "string" - } + { + "name": "src", + "type": "address", + "internalType": "address" + }, + { + "name": "version", + "type": "string", + "internalType": "string" + }, + { + "name": "ordering", + "type": "uint8", + "internalType": "enum ChannelOrder" + }, + { + "name": "connectionHops", + "type": "string[]", + "internalType": "string[]" + }, + { + "name": "counterpartyPortId", + "type": "string", + "internalType": "string" + } ], - "name": "depositOpenChannelFee", "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { + "stateMutability": "payable" + }, + { + "type": "function", + "name": "depositSendPacketFee", "inputs": [ - { - "internalType": "bytes32", - "name": "channelId", - "type": "bytes32" - }, - { - "internalType": "uint64", - "name": "sequence", - "type": "uint64" - }, - { - "internalType": "uint256[2]", - "name": "gasLimits", - "type": "uint256[2]" - }, - { - "internalType": "uint256[2]", - "name": "gasPrices", - "type": "uint256[2]" - } + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "sequence", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "gasLimits", + "type": "uint256[2]", + "internalType": "uint256[2]" + }, + { + "name": "gasPrices", + "type": "uint256[2]", + "internalType": "uint256[2]" + } ], - "name": "depositSendPacketFee", "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], + "stateMutability": "payable" + }, + { + "type": "function", "name": "owner", + "inputs": [], "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } + { + "name": "", + "type": "address", + "internalType": "address" + } ], - "stateMutability": "view", - "type": "function" - }, - { + "stateMutability": "view" + }, + { + "type": "function", + "name": "pendingOwner", "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", "name": "renounceOwnership", + "inputs": [], "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "transferOwnership", "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } + { + "name": "newOwner", + "type": "address", + "internalType": "address" + } ], - "name": "transferOwnership", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", "name": "withdrawFeesToOwner", + "inputs": [], "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -]} \ No newline at end of file + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "OpenChannelFeeDeposited", + "inputs": [ + { + "name": "sourceAddress", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "version", + "type": "string", + "indexed": false, + "internalType": "string" + }, + { + "name": "ordering", + "type": "uint8", + "indexed": false, + "internalType": "enum ChannelOrder" + }, + { + "name": "connectionHops", + "type": "string[]", + "indexed": false, + "internalType": "string[]" + }, + { + "name": "counterpartyPortId", + "type": "string", + "indexed": false, + "internalType": "string" + }, + { + "name": "feeAmount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OwnershipTransferStarted", + "inputs": [ + { + "name": "previousOwner", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "newOwner", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OwnershipTransferred", + "inputs": [ + { + "name": "previousOwner", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "newOwner", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "SendPacketFeeDeposited", + "inputs": [ + { + "name": "channelId", + "type": "bytes32", + "indexed": true, + "internalType": "bytes32" + }, + { + "name": "sequence", + "type": "uint64", + "indexed": true, + "internalType": "uint64" + }, + { + "name": "gasLimits", + "type": "uint256[2]", + "indexed": false, + "internalType": "uint256[2]" + }, + { + "name": "gasPrices", + "type": "uint256[2]", + "indexed": false, + "internalType": "uint256[2]" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "FeeThresholdNotMet", + "inputs": [] + }, + { + "type": "error", + "name": "IncorrectFeeSent", + "inputs": [ + { + "name": "expected", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "sent", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "SenderNotDispatcher", + "inputs": [] + } + ]} \ No newline at end of file diff --git a/abi/uch.json b/abi/uch.json index e0a08f8..c60bdb1 100644 --- a/abi/uch.json +++ b/abi/uch.json @@ -1,867 +1,867 @@ {"abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "ChannelNotFound", - "type": "error" - }, - { - "inputs": [], - "name": "MwBitmpaCannotBeZero", - "type": "error" - }, - { - "inputs": [], - "name": "UnsupportedVersion", - "type": "error" - }, - { - "inputs": [], - "name": "notIbcDispatcher", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "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": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "source", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "destination", - "type": "bytes32" - } - ], - "name": "UCHPacketSent", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { + { + "type": "constructor", "inputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "receive", + "stateMutability": "payable" + }, + { + "type": "function", "name": "MW_ID", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", "name": "VERSION", + "inputs": [], "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "connectedChannels", "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } ], - "name": "connectedChannels", "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", "name": "dispatcher", + "inputs": [], "outputs": [ - { - "internalType": "contract IbcDispatcher", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { + { + "name": "", + "type": "address", + "internalType": "contract IbcDispatcher" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "initialize", "inputs": [ - { - "internalType": "contract IbcDispatcher", - "name": "_dispatcher", - "type": "address" - } + { + "name": "_dispatcher", + "type": "address", + "internalType": "contract IbcDispatcher" + } ], - "name": "initialize", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "mwStackAddrs", "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { + "name": "", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } ], - "name": "mwStackAddrs", "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "onAcknowledgementPacket", "inputs": [ - { + { + "name": "packet", + "type": "tuple", + "internalType": "struct IbcPacket", + "components": [ + { + "name": "src", + "type": "tuple", + "internalType": "struct IbcEndpoint", "components": [ - { - "components": [ - { - "internalType": "string", - "name": "portId", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "channelId", - "type": "bytes32" - } - ], - "internalType": "struct IbcEndpoint", - "name": "src", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "string", - "name": "portId", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "channelId", - "type": "bytes32" - } - ], - "internalType": "struct IbcEndpoint", - "name": "dest", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "sequence", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "revision_number", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "revision_height", - "type": "uint64" - } - ], - "internalType": "struct Height", - "name": "timeoutHeight", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "timeoutTimestamp", - "type": "uint64" - } - ], - "internalType": "struct IbcPacket", - "name": "packet", - "type": "tuple" - }, - { + { + "name": "portId", + "type": "string", + "internalType": "string" + }, + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "dest", + "type": "tuple", + "internalType": "struct IbcEndpoint", "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct AckPacket", - "name": "ack", - "type": "tuple" - } + { + "name": "portId", + "type": "string", + "internalType": "string" + }, + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "sequence", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "timeoutHeight", + "type": "tuple", + "internalType": "struct Height", + "components": [ + { + "name": "revision_number", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "revision_height", + "type": "uint64", + "internalType": "uint64" + } + ] + }, + { + "name": "timeoutTimestamp", + "type": "uint64", + "internalType": "uint64" + } + ] + }, + { + "name": "ack", + "type": "tuple", + "internalType": "struct AckPacket", + "components": [ + { + "name": "success", + "type": "bool", + "internalType": "bool" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ] + } ], - "name": "onAcknowledgementPacket", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "onChanCloseConfirm", "inputs": [ - { - "internalType": "bytes32", - "name": "channelId", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "", + "type": "string", + "internalType": "string" + }, + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } ], - "name": "onChanCloseConfirm", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "onChanCloseInit", "inputs": [ - { - "internalType": "bytes32", - "name": "channelId", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "", + "type": "string", + "internalType": "string" + }, + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } ], - "name": "onChanCloseInit", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "onChanOpenAck", "inputs": [ - { - "internalType": "bytes32", - "name": "channelId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "counterpartyVersion", - "type": "string" - } + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "counterpartyVersion", + "type": "string", + "internalType": "string" + } ], - "name": "onChanOpenAck", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "onChanOpenConfirm", "inputs": [ - { - "internalType": "bytes32", - "name": "channelId", - "type": "bytes32" - } + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + } ], - "name": "onChanOpenConfirm", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "onChanOpenInit", "inputs": [ - { - "internalType": "enum ChannelOrder", - "name": "", - "type": "uint8" - }, - { - "internalType": "string[]", - "name": "", - "type": "string[]" - }, - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "string", - "name": "version", - "type": "string" - } + { + "name": "", + "type": "uint8", + "internalType": "enum ChannelOrder" + }, + { + "name": "", + "type": "string[]", + "internalType": "string[]" + }, + { + "name": "", + "type": "string", + "internalType": "string" + }, + { + "name": "version", + "type": "string", + "internalType": "string" + } ], - "name": "onChanOpenInit", "outputs": [ - { - "internalType": "string", - "name": "selectedVersion", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { + { + "name": "selectedVersion", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "onChanOpenTry", "inputs": [ - { - "internalType": "enum ChannelOrder", - "name": "", - "type": "uint8" - }, - { - "internalType": "string[]", - "name": "", - "type": "string[]" - }, - { - "internalType": "bytes32", - "name": "channelId", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "counterpartyVersion", - "type": "string" - } + { + "name": "", + "type": "uint8", + "internalType": "enum ChannelOrder" + }, + { + "name": "", + "type": "string[]", + "internalType": "string[]" + }, + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "", + "type": "string", + "internalType": "string" + }, + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "counterpartyVersion", + "type": "string", + "internalType": "string" + } ], - "name": "onChanOpenTry", "outputs": [ - { - "internalType": "string", - "name": "selectedVersion", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { + { + "name": "selectedVersion", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "onRecvPacket", "inputs": [ - { + { + "name": "packet", + "type": "tuple", + "internalType": "struct IbcPacket", + "components": [ + { + "name": "src", + "type": "tuple", + "internalType": "struct IbcEndpoint", + "components": [ + { + "name": "portId", + "type": "string", + "internalType": "string" + }, + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "dest", + "type": "tuple", + "internalType": "struct IbcEndpoint", + "components": [ + { + "name": "portId", + "type": "string", + "internalType": "string" + }, + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "sequence", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "timeoutHeight", + "type": "tuple", + "internalType": "struct Height", "components": [ - { - "components": [ - { - "internalType": "string", - "name": "portId", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "channelId", - "type": "bytes32" - } - ], - "internalType": "struct IbcEndpoint", - "name": "src", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "string", - "name": "portId", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "channelId", - "type": "bytes32" - } - ], - "internalType": "struct IbcEndpoint", - "name": "dest", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "sequence", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "revision_number", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "revision_height", - "type": "uint64" - } - ], - "internalType": "struct Height", - "name": "timeoutHeight", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "timeoutTimestamp", - "type": "uint64" - } - ], - "internalType": "struct IbcPacket", - "name": "packet", - "type": "tuple" - } + { + "name": "revision_number", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "revision_height", + "type": "uint64", + "internalType": "uint64" + } + ] + }, + { + "name": "timeoutTimestamp", + "type": "uint64", + "internalType": "uint64" + } + ] + } ], - "name": "onRecvPacket", "outputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct AckPacket", - "name": "ackPacket", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { + { + "name": "ackPacket", + "type": "tuple", + "internalType": "struct AckPacket", + "components": [ + { + "name": "success", + "type": "bool", + "internalType": "bool" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "onTimeoutPacket", "inputs": [ - { + { + "name": "packet", + "type": "tuple", + "internalType": "struct IbcPacket", + "components": [ + { + "name": "src", + "type": "tuple", + "internalType": "struct IbcEndpoint", "components": [ - { - "components": [ - { - "internalType": "string", - "name": "portId", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "channelId", - "type": "bytes32" - } - ], - "internalType": "struct IbcEndpoint", - "name": "src", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "string", - "name": "portId", - "type": "string" - }, - { - "internalType": "bytes32", - "name": "channelId", - "type": "bytes32" - } - ], - "internalType": "struct IbcEndpoint", - "name": "dest", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "sequence", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "revision_number", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "revision_height", - "type": "uint64" - } - ], - "internalType": "struct Height", - "name": "timeoutHeight", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "timeoutTimestamp", - "type": "uint64" - } - ], - "internalType": "struct IbcPacket", - "name": "packet", - "type": "tuple" - } + { + "name": "portId", + "type": "string", + "internalType": "string" + }, + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "dest", + "type": "tuple", + "internalType": "struct IbcEndpoint", + "components": [ + { + "name": "portId", + "type": "string", + "internalType": "string" + }, + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "name": "sequence", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "timeoutHeight", + "type": "tuple", + "internalType": "struct Height", + "components": [ + { + "name": "revision_number", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "revision_height", + "type": "uint64", + "internalType": "uint64" + } + ] + }, + { + "name": "timeoutTimestamp", + "type": "uint64", + "internalType": "uint64" + } + ] + } ], - "name": "onTimeoutPacket", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "openChannel", "inputs": [ - { - "internalType": "string", - "name": "version", - "type": "string" - }, - { - "internalType": "enum ChannelOrder", - "name": "ordering", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "feeEnabled", - "type": "bool" - }, - { - "internalType": "string[]", - "name": "connectionHops", - "type": "string[]" - }, - { - "internalType": "string", - "name": "counterpartyPortIdentifier", - "type": "string" - } + { + "name": "version", + "type": "string", + "internalType": "string" + }, + { + "name": "ordering", + "type": "uint8", + "internalType": "enum ChannelOrder" + }, + { + "name": "feeEnabled", + "type": "bool", + "internalType": "bool" + }, + { + "name": "connectionHops", + "type": "string[]", + "internalType": "string[]" + }, + { + "name": "counterpartyPortIdentifier", + "type": "string", + "internalType": "string" + } ], - "name": "openChannel", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", "name": "proxiableUUID", + "inputs": [], "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "registerMwStack", "inputs": [ - { - "internalType": "uint256", - "name": "mwBitmap", - "type": "uint256" - }, - { - "internalType": "address[]", - "name": "mwAddrs", - "type": "address[]" - } + { + "name": "mwBitmap", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "mwAddrs", + "type": "address[]", + "internalType": "address[]" + } ], - "name": "registerMwStack", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", "name": "renounceOwnership", + "inputs": [], "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "sendMWPacket", "inputs": [ - { - "internalType": "bytes32", - "name": "channelId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "srcPortAddr", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "destPortAddr", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "srcMwIds", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "appData", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "timeoutTimestamp", - "type": "uint64" - } + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "srcPortAddr", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "destPortAddr", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "srcMwIds", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "appData", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "timeoutTimestamp", + "type": "uint64", + "internalType": "uint64" + } ], - "name": "sendMWPacket", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "sendUniversalPacket", "inputs": [ - { - "internalType": "bytes32", - "name": "channelId", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "destPortAddr", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "appData", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "timeoutTimestamp", - "type": "uint64" - } + { + "name": "channelId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "destPortAddr", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "appData", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "timeoutTimestamp", + "type": "uint64", + "internalType": "uint64" + } ], - "name": "sendUniversalPacket", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setDispatcher", "inputs": [ - { - "internalType": "contract IbcDispatcher", - "name": "_dispatcher", - "type": "address" - } + { + "name": "_dispatcher", + "type": "address", + "internalType": "contract IbcDispatcher" + } ], - "name": "setDispatcher", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "transferOwnership", "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } + { + "name": "newOwner", + "type": "address", + "internalType": "address" + } ], - "name": "transferOwnership", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "upgradeTo", "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } + { + "name": "newImplementation", + "type": "address", + "internalType": "address" + } ], - "name": "upgradeTo", "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "upgradeToAndCall", "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } + { + "name": "newImplementation", + "type": "address", + "internalType": "address" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } ], - "name": "upgradeToAndCall", "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } -]} \ No newline at end of file + "stateMutability": "payable" + }, + { + "type": "event", + "name": "AdminChanged", + "inputs": [ + { + "name": "previousAdmin", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "newAdmin", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "BeaconUpgraded", + "inputs": [ + { + "name": "beacon", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint8", + "indexed": false, + "internalType": "uint8" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OwnershipTransferred", + "inputs": [ + { + "name": "previousOwner", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "newOwner", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "UCHPacketSent", + "inputs": [ + { + "name": "source", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "destination", + "type": "bytes32", + "indexed": false, + "internalType": "bytes32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Upgraded", + "inputs": [ + { + "name": "implementation", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "ChannelNotFound", + "inputs": [] + }, + { + "type": "error", + "name": "MwBitmpaCannotBeZero", + "inputs": [] + }, + { + "type": "error", + "name": "UnsupportedVersion", + "inputs": [] + }, + { + "type": "error", + "name": "notIbcDispatcher", + "inputs": [] + } + ]} \ No newline at end of file diff --git a/src/abi/dispatcher.ts b/src/abi/dispatcher.ts index 00bdde6..06a584e 100644 --- a/src/abi/dispatcher.ts +++ b/src/abi/dispatcher.ts @@ -7,17 +7,20 @@ export const events = { AcknowledgementError: event("0x625eea143c9dae6915c809da47016c22d9cd006c3ace7c345c5cbcf57d3aefbc", {"receiver": indexed(p.address), "error": p.bytes}), AdminChanged: event("0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f", {"previousAdmin": p.address, "newAdmin": p.address}), BeaconUpgraded: event("0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e", {"beacon": indexed(p.address)}), + ChannelCloseConfirm: event("0x5f010dbbd6bf46aec8131c5456301a75cd688d3cca9bc8380c9e26301be20729", {"portAddress": indexed(p.address), "channelId": indexed(p.bytes32)}), + ChannelCloseConfirmError: event("0xc9d36d7a317cb116925d5cb66f0069fe825822fe23e9cf3f421c38cf444caa30", {"receiver": indexed(p.address), "error": p.bytes}), + ChannelCloseInit: event("0x21372e37743553ba8e5f61239803174a827c7732d53ec8adcb76c6b3bb2c13f1", {"portAddress": indexed(p.address), "channelId": indexed(p.bytes32)}), + ChannelCloseInitError: event("0xb1be59c1bcd39c54c7132a8e0d321af5db427575ddb3265560d8862804f4381b", {"receiver": indexed(p.address), "error": p.bytes}), ChannelOpenAck: event("0xcf8be9ab2b5edf8beb2c45abe8e0cc7646318ac19f6c3164ba2e19e93a8a32af", {"receiver": indexed(p.address), "channelId": p.bytes32}), ChannelOpenAckError: event("0x971a4433f5bff5f011728a4123aeeca4b5275ac20b013cf276e65510491ac26f", {"receiver": indexed(p.address), "error": p.bytes}), ChannelOpenConfirm: event("0xe80f571f70f7cabf9d7ac60ece08421be374117776c311c327a083ca398f802f", {"receiver": indexed(p.address), "channelId": p.bytes32}), ChannelOpenConfirmError: event("0xf6a58ef30f66943749e8c29c661c84da143a1c8ed017f5faa92b509e0000875a", {"receiver": indexed(p.address), "error": p.bytes}), - ChannelOpenInit: event("0x20fd8a5856711b18d00def4aa6abafbe00ce6d60795e015cc1cad35eb9b46359", {"recevier": indexed(p.address), "version": p.string, "ordering": p.uint8, "feeEnabled": p.bool, "connectionHops": p.array(p.string), "counterpartyPortId": p.string}), + ChannelOpenInit: event("0x20fd8a5856711b18d00def4aa6abafbe00ce6d60795e015cc1cad35eb9b46359", {"receiver": indexed(p.address), "version": p.string, "ordering": p.uint8, "feeEnabled": p.bool, "connectionHops": p.array(p.string), "counterpartyPortId": p.string}), ChannelOpenInitError: event("0x69c1283cce89382f0f9ddf19b7c4f05b4d9b3c30c84fc148b1ec800284be58d5", {"receiver": indexed(p.address), "error": p.bytes}), ChannelOpenTry: event("0xf910705a7a768eb5958f281a5f84cae8bffc5dd811ca5cd303dda140a423698c", {"receiver": indexed(p.address), "version": p.string, "ordering": p.uint8, "feeEnabled": p.bool, "connectionHops": p.array(p.string), "counterpartyPortId": p.string, "counterpartyChannelId": p.bytes32}), ChannelOpenTryError: event("0x9e2fe55a3b54b57f82334c273f8d048cd7f05ad19c16cf334276a8c1fec4b6fd", {"receiver": indexed(p.address), "error": p.bytes}), - CloseIbcChannel: event("0xe893e4ba0e364cdc96364b1e1e0d53b0d91e5fd6aa0ee9d81a17ecd61178bf17", {"portAddress": indexed(p.address), "channelId": indexed(p.bytes32)}), - CloseIbcChannelError: event("0x621537329e2909bff484236da6a5b97154f63e7e138cd6dc53def82a739f7688", {"receiver": indexed(p.address), "error": p.bytes}), Initialized: event("0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498", {"version": p.uint8}), + OwnershipTransferStarted: event("0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700", {"previousOwner": indexed(p.address), "newOwner": indexed(p.address)}), OwnershipTransferred: event("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", {"previousOwner": indexed(p.address), "newOwner": indexed(p.address)}), RecvPacket: event("0xde5b57e6566d68a30b0979431df3d5df6db3b9aa89f8820f595b9315bf86d067", {"destPortAddress": indexed(p.address), "destChannelId": indexed(p.bytes32), "sequence": p.uint64}), SendPacket: event("0xb5bff96e18da044e4e34510d16df9053b9f1920f6a960732e5aaf22fe9b80136", {"sourcePortAddress": indexed(p.address), "sourceChannelId": indexed(p.bytes32), "packet": p.bytes, "sequence": p.uint64, "timeoutTimestamp": p.uint64}), @@ -29,26 +32,32 @@ export const events = { } export const functions = { + acceptOwnership: fun("0x79ba5097", {}, ), acknowledgement: fun("0xba5a4d25", {"packet": p.struct({"src": p.struct({"portId": p.string, "channelId": p.bytes32}), "dest": p.struct({"portId": p.string, "channelId": p.bytes32}), "sequence": p.uint64, "data": p.bytes, "timeoutHeight": p.struct({"revision_number": p.uint64, "revision_height": p.uint64}), "timeoutTimestamp": p.uint64}), "ack": p.bytes, "proof": p.struct({"proof": p.array(p.struct({"path": p.array(p.struct({"prefix": p.bytes, "suffix": p.bytes})), "key": p.bytes, "value": p.bytes, "prefix": p.bytes})), "height": p.uint256})}, ), + channelCloseConfirm: fun("0xf90b8e96", {"portAddress": p.address, "channelId": p.bytes32, "proof": p.struct({"proof": p.array(p.struct({"path": p.array(p.struct({"prefix": p.bytes, "suffix": p.bytes})), "key": p.bytes, "value": p.bytes, "prefix": p.bytes})), "height": p.uint256})}, ), + channelCloseInit: fun("0x81bc079b", {"channelId": p.bytes32}, ), channelOpenAck: fun("0x1eb9fc86", {"local": p.struct({"portId": p.string, "channelId": p.bytes32, "version": p.string}), "connectionHops": p.array(p.string), "ordering": p.uint8, "feeEnabled": p.bool, "counterparty": p.struct({"portId": p.string, "channelId": p.bytes32, "version": p.string}), "proof": p.struct({"proof": p.array(p.struct({"path": p.array(p.struct({"prefix": p.bytes, "suffix": p.bytes})), "key": p.bytes, "value": p.bytes, "prefix": p.bytes})), "height": p.uint256})}, ), channelOpenConfirm: fun("0x429446b6", {"local": p.struct({"portId": p.string, "channelId": p.bytes32, "version": p.string}), "connectionHops": p.array(p.string), "ordering": p.uint8, "feeEnabled": p.bool, "counterparty": p.struct({"portId": p.string, "channelId": p.bytes32, "version": p.string}), "proof": p.struct({"proof": p.array(p.struct({"path": p.array(p.struct({"prefix": p.bytes, "suffix": p.bytes})), "key": p.bytes, "value": p.bytes, "prefix": p.bytes})), "height": p.uint256})}, ), channelOpenInit: fun("0x418925b7", {"version": p.string, "ordering": p.uint8, "feeEnabled": p.bool, "connectionHops": p.array(p.string), "counterpartyPortId": p.string}, ), channelOpenTry: fun("0x2bf5d19d", {"local": p.struct({"portId": p.string, "channelId": p.bytes32, "version": p.string}), "ordering": p.uint8, "feeEnabled": p.bool, "connectionHops": p.array(p.string), "counterparty": p.struct({"portId": p.string, "channelId": p.bytes32, "version": p.string}), "proof": p.struct({"proof": p.array(p.struct({"path": p.array(p.struct({"prefix": p.bytes, "suffix": p.bytes})), "key": p.bytes, "value": p.bytes, "prefix": p.bytes})), "height": p.uint256})}, ), - closeIbcChannel: fun("0x8b24b4cb", {"channelId": p.bytes32}, ), - getChannel: fun("0x42852d24", {"portAddress": p.address, "channelId": p.bytes32}, p.struct({"version": p.string, "ordering": p.uint8, "feeEnabled": p.bool, "connectionHops": p.array(p.string), "counterpartyPortId": p.string, "counterpartyChannelId": p.bytes32})), - getOptimisticConsensusState: fun("0xeb86ffdb", {"height": p.uint256}, {"appHash": p.uint256, "fraudProofEndTime": p.uint256, "ended": p.bool}), - initialize: fun("0x7ab4339d", {"initPortPrefix": p.string, "lightClient": p.address}, ), + feeVault: fun("0x478222c2", {}, p.address), + getChannel: fun("0x42852d24", {"portAddress": p.address, "channelId": p.bytes32}, p.struct({"version": p.string, "ordering": p.uint8, "feeEnabled": p.bool, "connectionHops": p.array(p.string), "counterpartyPortId": p.string, "counterpartyChannelId": p.bytes32, "portId": p.string})), + getState: fun("0xb12f89be", {"height": p.uint256, "connection": p.string}, p.uint256), + initialize: fun("0x7ab4339d", {"initPortPrefix": p.string, "_feeVault": p.address}, ), owner: fun("0x8da5cb5b", {}, p.address), + pendingOwner: fun("0xe30c3978", {}, p.address), portPrefix: fun("0x7774a6d3", {}, p.string), portPrefixLen: fun("0x2494546b", {}, p.uint32), proxiableUUID: fun("0x52d1902d", {}, p.bytes32), recvPacket: fun("0x6b67055e", {"packet": p.struct({"src": p.struct({"portId": p.string, "channelId": p.bytes32}), "dest": p.struct({"portId": p.string, "channelId": p.bytes32}), "sequence": p.uint64, "data": p.bytes, "timeoutHeight": p.struct({"revision_number": p.uint64, "revision_height": p.uint64}), "timeoutTimestamp": p.uint64}), "proof": p.struct({"proof": p.array(p.struct({"path": p.array(p.struct({"prefix": p.bytes, "suffix": p.bytes})), "key": p.bytes, "value": p.bytes, "prefix": p.bytes})), "height": p.uint256})}, ), + removeConnection: fun("0xc00fa7c0", {"connection": p.string}, ), renounceOwnership: fun("0x715018a6", {}, ), - sendPacket: fun("0xc3e1155c", {"channelId": p.bytes32, "packet": p.bytes, "timeoutTimestamp": p.uint64}, ), + sendPacket: fun("0xc3e1155c", {"channelId": p.bytes32, "packet": p.bytes, "timeoutTimestamp": p.uint64}, p.uint64), + setClientForConnection: fun("0x556d5178", {"connection": p.string, "lightClient": p.address}, ), setPortPrefix: fun("0x9f59ae71", {"_portPrefix": p.string}, ), timeout: fun("0x6050b5f3", {"packet": p.struct({"src": p.struct({"portId": p.string, "channelId": p.bytes32}), "dest": p.struct({"portId": p.string, "channelId": p.bytes32}), "sequence": p.uint64, "data": p.bytes, "timeoutHeight": p.struct({"revision_number": p.uint64, "revision_height": p.uint64}), "timeoutTimestamp": p.uint64}), "proof": p.struct({"proof": p.array(p.struct({"path": p.array(p.struct({"prefix": p.bytes, "suffix": p.bytes})), "key": p.bytes, "value": p.bytes, "prefix": p.bytes})), "height": p.uint256})}, ), transferOwnership: fun("0xf2fde38b", {"newOwner": p.address}, ), - updateClientWithOptimisticConsensusState: fun("0x8919b88c", {"l1header": p.struct({"header": p.array(p.bytes), "stateRoot": p.bytes32, "number": p.uint64}), "proof": p.struct({"accountProof": p.array(p.bytes), "outputRootProof": p.array(p.bytes), "l2OutputProposalKey": p.bytes32, "l2BlockHash": p.bytes32}), "height": p.uint256, "appHash": p.uint256}, {"fraudProofEndTime": p.uint256, "ended": p.bool}), + updateClient: fun("0xc899e272", {"proof": p.bytes, "height": p.uint256, "appHash": p.uint256, "connection": p.string}, ), upgradeTo: fun("0x3659cfe6", {"newImplementation": p.address}, ), upgradeToAndCall: fun("0x4f1ef286", {"newImplementation": p.address, "data": p.bytes}, ), writeTimeoutPacket: fun("0x5d7adf96", {"packet": p.struct({"src": p.struct({"portId": p.string, "channelId": p.bytes32}), "dest": p.struct({"portId": p.string, "channelId": p.bytes32}), "sequence": p.uint64, "data": p.bytes, "timeoutHeight": p.struct({"revision_number": p.uint64, "revision_height": p.uint64}), "timeoutTimestamp": p.uint64}), "proof": p.struct({"proof": p.array(p.struct({"path": p.array(p.struct({"prefix": p.bytes, "suffix": p.bytes})), "key": p.bytes, "value": p.bytes, "prefix": p.bytes})), "height": p.uint256})}, ), @@ -56,18 +65,26 @@ export const functions = { export class Contract extends ContractBase { + feeVault() { + return this.eth_call(functions.feeVault, {}) + } + getChannel(portAddress: GetChannelParams["portAddress"], channelId: GetChannelParams["channelId"]) { return this.eth_call(functions.getChannel, {portAddress, channelId}) } - getOptimisticConsensusState(height: GetOptimisticConsensusStateParams["height"]) { - return this.eth_call(functions.getOptimisticConsensusState, {height}) + getState(height: GetStateParams["height"], connection: GetStateParams["connection"]) { + return this.eth_call(functions.getState, {height, connection}) } owner() { return this.eth_call(functions.owner, {}) } + pendingOwner() { + return this.eth_call(functions.pendingOwner, {}) + } + portPrefix() { return this.eth_call(functions.portPrefix, {}) } @@ -86,6 +103,10 @@ export type AcknowledgementEventArgs = EParams export type AcknowledgementErrorEventArgs = EParams export type AdminChangedEventArgs = EParams export type BeaconUpgradedEventArgs = EParams +export type ChannelCloseConfirmEventArgs = EParams +export type ChannelCloseConfirmErrorEventArgs = EParams +export type ChannelCloseInitEventArgs = EParams +export type ChannelCloseInitErrorEventArgs = EParams export type ChannelOpenAckEventArgs = EParams export type ChannelOpenAckErrorEventArgs = EParams export type ChannelOpenConfirmEventArgs = EParams @@ -94,9 +115,8 @@ export type ChannelOpenInitEventArgs = EParams export type ChannelOpenInitErrorEventArgs = EParams export type ChannelOpenTryEventArgs = EParams export type ChannelOpenTryErrorEventArgs = EParams -export type CloseIbcChannelEventArgs = EParams -export type CloseIbcChannelErrorEventArgs = EParams export type InitializedEventArgs = EParams +export type OwnershipTransferStartedEventArgs = EParams export type OwnershipTransferredEventArgs = EParams export type RecvPacketEventArgs = EParams export type SendPacketEventArgs = EParams @@ -107,9 +127,18 @@ export type WriteAckPacketEventArgs = EParams export type WriteTimeoutPacketEventArgs = EParams /// Function types +export type AcceptOwnershipParams = FunctionArguments +export type AcceptOwnershipReturn = FunctionReturn + export type AcknowledgementParams = FunctionArguments export type AcknowledgementReturn = FunctionReturn +export type ChannelCloseConfirmParams = FunctionArguments +export type ChannelCloseConfirmReturn = FunctionReturn + +export type ChannelCloseInitParams = FunctionArguments +export type ChannelCloseInitReturn = FunctionReturn + export type ChannelOpenAckParams = FunctionArguments export type ChannelOpenAckReturn = FunctionReturn @@ -122,14 +151,14 @@ export type ChannelOpenInitReturn = FunctionReturn export type ChannelOpenTryReturn = FunctionReturn -export type CloseIbcChannelParams = FunctionArguments -export type CloseIbcChannelReturn = FunctionReturn +export type FeeVaultParams = FunctionArguments +export type FeeVaultReturn = FunctionReturn export type GetChannelParams = FunctionArguments export type GetChannelReturn = FunctionReturn -export type GetOptimisticConsensusStateParams = FunctionArguments -export type GetOptimisticConsensusStateReturn = FunctionReturn +export type GetStateParams = FunctionArguments +export type GetStateReturn = FunctionReturn export type InitializeParams = FunctionArguments export type InitializeReturn = FunctionReturn @@ -137,6 +166,9 @@ export type InitializeReturn = FunctionReturn export type OwnerParams = FunctionArguments export type OwnerReturn = FunctionReturn +export type PendingOwnerParams = FunctionArguments +export type PendingOwnerReturn = FunctionReturn + export type PortPrefixParams = FunctionArguments export type PortPrefixReturn = FunctionReturn @@ -149,12 +181,18 @@ export type ProxiableUUIDReturn = FunctionReturn export type RecvPacketParams = FunctionArguments export type RecvPacketReturn = FunctionReturn +export type RemoveConnectionParams = FunctionArguments +export type RemoveConnectionReturn = FunctionReturn + export type RenounceOwnershipParams = FunctionArguments export type RenounceOwnershipReturn = FunctionReturn export type SendPacketParams = FunctionArguments export type SendPacketReturn = FunctionReturn +export type SetClientForConnectionParams = FunctionArguments +export type SetClientForConnectionReturn = FunctionReturn + export type SetPortPrefixParams = FunctionArguments export type SetPortPrefixReturn = FunctionReturn @@ -164,8 +202,8 @@ export type TimeoutReturn = FunctionReturn export type TransferOwnershipParams = FunctionArguments export type TransferOwnershipReturn = FunctionReturn -export type UpdateClientWithOptimisticConsensusStateParams = FunctionArguments -export type UpdateClientWithOptimisticConsensusStateReturn = FunctionReturn +export type UpdateClientParams = FunctionArguments +export type UpdateClientReturn = FunctionReturn export type UpgradeToParams = FunctionArguments export type UpgradeToReturn = FunctionReturn diff --git a/src/abi/fee.ts b/src/abi/fee.ts index c1cec2f..441b461 100644 --- a/src/abi/fee.ts +++ b/src/abi/fee.ts @@ -4,14 +4,17 @@ import type { EventParams as EParams, FunctionArguments, FunctionReturn } from ' export const events = { OpenChannelFeeDeposited: event("0x8ab5595b5ac9231b64513ba86f6bd9fb73c51cae40c36083f7dfc2298e4429e6", {"sourceAddress": p.address, "version": p.string, "ordering": p.uint8, "connectionHops": p.array(p.string), "counterpartyPortId": p.string, "feeAmount": p.uint256}), + OwnershipTransferStarted: event("0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700", {"previousOwner": indexed(p.address), "newOwner": indexed(p.address)}), OwnershipTransferred: event("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", {"previousOwner": indexed(p.address), "newOwner": indexed(p.address)}), SendPacketFeeDeposited: event("0x0733dc80f277e205edf5d913fa5d91fa0c4cc2635db600b365471c688356c034", {"channelId": indexed(p.bytes32), "sequence": indexed(p.uint64), "gasLimits": p.fixedSizeArray(p.uint256, 2), "gasPrices": p.fixedSizeArray(p.uint256, 2)}), } export const functions = { + acceptOwnership: fun("0x79ba5097", {}, ), depositOpenChannelFee: fun("0xfce34e40", {"src": p.address, "version": p.string, "ordering": p.uint8, "connectionHops": p.array(p.string), "counterpartyPortId": p.string}, ), depositSendPacketFee: fun("0x18e3404b", {"channelId": p.bytes32, "sequence": p.uint64, "gasLimits": p.fixedSizeArray(p.uint256, 2), "gasPrices": p.fixedSizeArray(p.uint256, 2)}, ), owner: fun("0x8da5cb5b", {}, p.address), + pendingOwner: fun("0xe30c3978", {}, p.address), renounceOwnership: fun("0x715018a6", {}, ), transferOwnership: fun("0xf2fde38b", {"newOwner": p.address}, ), withdrawFeesToOwner: fun("0x0be6a22d", {}, ), @@ -22,14 +25,22 @@ export class Contract extends ContractBase { owner() { return this.eth_call(functions.owner, {}) } + + pendingOwner() { + return this.eth_call(functions.pendingOwner, {}) + } } /// Event types export type OpenChannelFeeDepositedEventArgs = EParams +export type OwnershipTransferStartedEventArgs = EParams export type OwnershipTransferredEventArgs = EParams export type SendPacketFeeDepositedEventArgs = EParams /// Function types +export type AcceptOwnershipParams = FunctionArguments +export type AcceptOwnershipReturn = FunctionReturn + export type DepositOpenChannelFeeParams = FunctionArguments export type DepositOpenChannelFeeReturn = FunctionReturn @@ -39,6 +50,9 @@ export type DepositSendPacketFeeReturn = FunctionReturn export type OwnerReturn = FunctionReturn +export type PendingOwnerParams = FunctionArguments +export type PendingOwnerReturn = FunctionReturn + export type RenounceOwnershipParams = FunctionArguments export type RenounceOwnershipReturn = FunctionReturn diff --git a/src/handlers/channels.ts b/src/handlers/channels.ts index de29e14..97f0839 100644 --- a/src/handlers/channels.ts +++ b/src/handlers/channels.ts @@ -19,7 +19,7 @@ import { CATCHUP_ERROR_LIMIT } from "../chains/constants"; export function handleChannelOpenInit(portPrefix: string, block: Block, log: Log): ChannelOpenInit { let event = dispatcher.events.ChannelOpenInit.decode(log); - let portAddress = ethers.getAddress(event.recevier) + let portAddress = ethers.getAddress(event.receiver) let portId = `${portPrefix}${portAddress.slice(2)}` return new ChannelOpenInit({ diff --git a/src/utils/topics.ts b/src/utils/topics.ts index b99f67d..fde2395 100644 --- a/src/utils/topics.ts +++ b/src/utils/topics.ts @@ -16,7 +16,8 @@ export let topics = [ dispatcher.events.ChannelOpenTry.topic, dispatcher.events.ChannelOpenAck.topic, dispatcher.events.ChannelOpenConfirm.topic, - dispatcher.events.CloseIbcChannel.topic, + dispatcher.events.ChannelCloseInit.topic, + dispatcher.events.ChannelCloseConfirm.topic, // UCH uch.events.UCHPacketSent.topic,