From e483a959b5d1d2493f3d9bf5b843f895df0372b9 Mon Sep 17 00:00:00 2001 From: Jun Kimura Date: Wed, 21 Aug 2024 17:06:46 +0900 Subject: [PATCH] utilize eip-7201 as storage layout * add `getCommitmentsSlot` to IBCQuerier * update go bindings * tests: check if commitments slot is expected Signed-off-by: Jun Kimura --- .gas-snapshot | 124 ++++++++-------- contracts/clients/qbft/QBFTClient.sol | 3 +- contracts/core/02-client/IBCClient.sol | 17 ++- .../core/03-connection/IBCConnection.sol | 50 +++---- .../core/04-channel/IBCChannelHandshake.sol | 56 ++++---- contracts/core/04-channel/IBCChannelLib.sol | 4 + .../04-channel/IBCChannelPacketSendRecv.sol | 132 ++++++++--------- .../04-channel/IBCChannelPacketTimeout.sol | 36 +++-- .../core/04-channel/IBCChannelUpgrade.sol | 128 +++++++++-------- contracts/core/24-host/IBCCommitment.sol | 2 +- contracts/core/24-host/IBCHost.sol | 23 +-- .../core/24-host/IBCHostConfigurator.sol | 7 +- contracts/core/24-host/IBCStore.sol | 135 ++++++++++++++---- contracts/core/24-host/IIBCHostErrors.sol | 3 - contracts/core/25-handler/IBCQuerier.sol | 30 ++-- contracts/core/25-handler/IIBCQuerier.sol | 2 + contracts/core/26-router/IBCModuleManager.sol | 19 +-- pkg/contract/ibchandler/ibchandler.go | 33 ++++- pkg/ibc/core/commitment/commitment.go | 16 ++- pkg/testing/chains.go | 10 +- .../src/helpers/TestableIBCHandler.t.sol | 43 +++--- 21 files changed, 514 insertions(+), 359 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index e94a000d..1f832cad 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,75 +1,75 @@ -IBCBenchmarks:testAcknowledgePacket() (gas: 98678) -IBCBenchmarks:testCreateMockClient() (gas: 217244) -IBCBenchmarks:testRecvPacket() (gas: 155487) -IBCBenchmarks:testSendPacket() (gas: 95329) +IBCBenchmarks:testAcknowledgePacket() (gas: 98040) +IBCBenchmarks:testCreateMockClient() (gas: 216997) +IBCBenchmarks:testRecvPacket() (gas: 154889) +IBCBenchmarks:testSendPacket() (gas: 94843) IBCBenchmarks:testUpdateMockClientDirectly() (gas: 64879) -IBCBenchmarks:testUpdateMockClientViaHandler() (gas: 148205) -IBCMockAppTest:testHandshake() (gas: 4343205) -IBCMockAppTest:testHandshakeBetweenDifferentPorts() (gas: 3286459) -IBCMockAppTest:testPacketRelay() (gas: 11692905) -IBCMockAppTest:testPacketTimeout() (gas: 4242242) +IBCBenchmarks:testUpdateMockClientViaHandler() (gas: 148239) +IBCMockAppTest:testHandshake() (gas: 4161353) +IBCMockAppTest:testHandshakeBetweenDifferentPorts() (gas: 3104214) +IBCMockAppTest:testPacketRelay() (gas: 11460317) +IBCMockAppTest:testPacketTimeout() (gas: 4059417) ICS24HostTest:testValidatePortIdentifier() (gas: 44476) -TestICS02:testCreateClient() (gas: 30153096) +TestICS02:testCreateClient() (gas: 30572814) TestICS02:testHeightToUint128((uint64,uint64)) (runs: 256, μ: 907, ~: 907) -TestICS02:testInvalidCreateClient() (gas: 30038762) -TestICS02:testInvalidUpdateClient() (gas: 30042040) -TestICS02:testRegisterClient() (gas: 29702122) -TestICS02:testRegisterClientDuplicatedClientType() (gas: 29688342) -TestICS02:testRegisterClientInvalidClientType() (gas: 29717304) -TestICS02:testUpdateClient() (gas: 30208564) -TestICS03Handshake:testConnOpenAck() (gas: 1811332) -TestICS03Handshake:testConnOpenConfirm() (gas: 1989221) -TestICS03Handshake:testConnOpenInit() (gas: 1423613) -TestICS03Handshake:testConnOpenTry() (gas: 2348126) -TestICS03Handshake:testInvalidConnOpenAck() (gas: 2323078) -TestICS03Handshake:testInvalidConnOpenConfirm() (gas: 2421885) -TestICS03Handshake:testInvalidConnOpenInit() (gas: 777600) -TestICS03Handshake:testInvalidConnOpenTry() (gas: 2283933) +TestICS02:testInvalidCreateClient() (gas: 30458130) +TestICS02:testInvalidUpdateClient() (gas: 30461817) +TestICS02:testRegisterClient() (gas: 30122086) +TestICS02:testRegisterClientDuplicatedClientType() (gas: 30108306) +TestICS02:testRegisterClientInvalidClientType() (gas: 30137268) +TestICS02:testUpdateClient() (gas: 30628415) +TestICS03Handshake:testConnOpenAck() (gas: 1810871) +TestICS03Handshake:testConnOpenConfirm() (gas: 1988723) +TestICS03Handshake:testConnOpenInit() (gas: 1422940) +TestICS03Handshake:testConnOpenTry() (gas: 2347689) +TestICS03Handshake:testInvalidConnOpenAck() (gas: 2322689) +TestICS03Handshake:testInvalidConnOpenConfirm() (gas: 2421514) +TestICS03Handshake:testInvalidConnOpenInit() (gas: 776893) +TestICS03Handshake:testInvalidConnOpenTry() (gas: 2283346) TestICS03Version:testCopyVersions() (gas: 570207) TestICS03Version:testFindSupportedVersion() (gas: 34452) TestICS03Version:testIsSupportedVersion() (gas: 13568) TestICS03Version:testPickVersion() (gas: 37836) TestICS03Version:testVerifyProposedVersion() (gas: 21308) TestICS03Version:testVerifySupportedFeature() (gas: 10229) -TestICS04Handshake:testBindPort() (gas: 456271) -TestICS04Handshake:testChanClose() (gas: 12800640) -TestICS04Handshake:testChanOpenAck() (gas: 3428597) -TestICS04Handshake:testChanOpenConfirm() (gas: 3724273) -TestICS04Handshake:testChanOpenInit() (gas: 2535741) -TestICS04Handshake:testChanOpenTry() (gas: 3083807) -TestICS04Handshake:testInvalidChanOpenAck() (gas: 2411670) -TestICS04Handshake:testInvalidChanOpenConfirm() (gas: 2486327) -TestICS04Handshake:testInvalidChanOpenInit() (gas: 1730517) -TestICS04Handshake:testInvalidChanOpenTry() (gas: 1742638) -TestICS04Packet:testAcknowledgementPacket() (gas: 3316365) -TestICS04Packet:testInvalidSendPacket() (gas: 3476451) -TestICS04Packet:testRecvPacket() (gas: 9965223) -TestICS04Packet:testRecvPacketTimeoutHeight() (gas: 3236945) -TestICS04Packet:testRecvPacketTimeoutTimestamp() (gas: 3261000) -TestICS04Packet:testSendPacket() (gas: 4583983) -TestICS04Packet:testTimeoutOnClose() (gas: 3488144) -TestICS04Upgrade:testCrossingHelloInconsistentVersions() (gas: 9918550) -TestICS04Upgrade:testUpgradeAuthorityCancel() (gas: 46157666) -TestICS04Upgrade:testUpgradeCannotCancelWithOldErrorReceipt() (gas: 3392338) -TestICS04Upgrade:testUpgradeCannotRecvNextUpgradePacket() (gas: 5230053) -TestICS04Upgrade:testUpgradeCounterpartyAdvanceNextSequenceBeforeOpen() (gas: 5191254) -TestICS04Upgrade:testUpgradeCrossingHelloIncompatibleProposals() (gas: 4944387) -TestICS04Upgrade:testUpgradeFull() (gas: 55984957) -TestICS04Upgrade:testUpgradeInit() (gas: 3018393) -TestICS04Upgrade:testUpgradeNoChanges() (gas: 2433786) -TestICS04Upgrade:testUpgradeNotUpgradableModule() (gas: 3533495) -TestICS04Upgrade:testUpgradeOutOfSync() (gas: 3826003) -TestICS04Upgrade:testUpgradeRelaySuccessAtCounterpartyFlushComplete() (gas: 5201982) -TestICS04Upgrade:testUpgradeRelaySuccessAtFlushing() (gas: 5575834) -TestICS04Upgrade:testUpgradeSendPacketFailAtFlushingOrFlushComplete() (gas: 4012928) -TestICS04Upgrade:testUpgradeTimeoutAbortAck() (gas: 17445807) -TestICS04Upgrade:testUpgradeTimeoutAbortConfirm() (gas: 21062598) -TestICS04Upgrade:testUpgradeTimeoutUpgrade() (gas: 70448064) -TestICS04Upgrade:testUpgradeToOrdered() (gas: 53937015) -TestICS04Upgrade:testUpgradeToUnordered() (gas: 43053273) +TestICS04Handshake:testBindPort() (gas: 456448) +TestICS04Handshake:testChanClose() (gas: 12159113) +TestICS04Handshake:testChanOpenAck() (gas: 3242588) +TestICS04Handshake:testChanOpenConfirm() (gas: 3538396) +TestICS04Handshake:testChanOpenInit() (gas: 2395187) +TestICS04Handshake:testChanOpenTry() (gas: 2897666) +TestICS04Handshake:testInvalidChanOpenAck() (gas: 2317011) +TestICS04Handshake:testInvalidChanOpenConfirm() (gas: 2391668) +TestICS04Handshake:testInvalidChanOpenInit() (gas: 1677250) +TestICS04Handshake:testInvalidChanOpenTry() (gas: 1692203) +TestICS04Packet:testAcknowledgementPacket() (gas: 3111231) +TestICS04Packet:testInvalidSendPacket() (gas: 3294851) +TestICS04Packet:testRecvPacket() (gas: 9485947) +TestICS04Packet:testRecvPacketTimeoutHeight() (gas: 3053625) +TestICS04Packet:testRecvPacketTimeoutTimestamp() (gas: 3077674) +TestICS04Packet:testSendPacket() (gas: 4393823) +TestICS04Packet:testTimeoutOnClose() (gas: 3304892) +TestICS04Upgrade:testCrossingHelloInconsistentVersions() (gas: 9730721) +TestICS04Upgrade:testUpgradeAuthorityCancel() (gas: 44972623) +TestICS04Upgrade:testUpgradeCannotCancelWithOldErrorReceipt() (gas: 3296637) +TestICS04Upgrade:testUpgradeCannotRecvNextUpgradePacket() (gas: 5124643) +TestICS04Upgrade:testUpgradeCounterpartyAdvanceNextSequenceBeforeOpen() (gas: 5087713) +TestICS04Upgrade:testUpgradeCrossingHelloIncompatibleProposals() (gas: 4843978) +TestICS04Upgrade:testUpgradeFull() (gas: 55696695) +TestICS04Upgrade:testUpgradeInit() (gas: 2925072) +TestICS04Upgrade:testUpgradeNoChanges() (gas: 2342343) +TestICS04Upgrade:testUpgradeNotUpgradableModule() (gas: 3442666) +TestICS04Upgrade:testUpgradeOutOfSync() (gas: 3727867) +TestICS04Upgrade:testUpgradeRelaySuccessAtCounterpartyFlushComplete() (gas: 5097250) +TestICS04Upgrade:testUpgradeRelaySuccessAtFlushing() (gas: 5469407) +TestICS04Upgrade:testUpgradeSendPacketFailAtFlushingOrFlushComplete() (gas: 3907425) +TestICS04Upgrade:testUpgradeTimeoutAbortAck() (gas: 17323669) +TestICS04Upgrade:testUpgradeTimeoutAbortConfirm() (gas: 20920588) +TestICS04Upgrade:testUpgradeTimeoutUpgrade() (gas: 68891924) +TestICS04Upgrade:testUpgradeToOrdered() (gas: 52805680) +TestICS04Upgrade:testUpgradeToUnordered() (gas: 42151776) TestICS04UpgradeApp:testUpgradeAuthorizationChanneNotFound() (gas: 62062) -TestICS04UpgradeApp:testUpgradeAuthorizationRePropose() (gas: 2456047) -TestICS04UpgradeApp:testUpgradeAuthorizationRemove() (gas: 2436473) +TestICS04UpgradeApp:testUpgradeAuthorizationRePropose() (gas: 2365121) +TestICS04UpgradeApp:testUpgradeAuthorizationRemove() (gas: 2345567) TestICS20:testAddressToHex(address) (runs: 256, μ: 26850, ~: 27044) TestICS20:testHexToAddress(string) (runs: 256, μ: 4636, ~: 4595) TestICS20:testIsEscapedString() (gas: 62745) diff --git a/contracts/clients/qbft/QBFTClient.sol b/contracts/clients/qbft/QBFTClient.sol index 87ad703f..4fe31f43 100644 --- a/contracts/clients/qbft/QBFTClient.sol +++ b/contracts/clients/qbft/QBFTClient.sol @@ -71,7 +71,8 @@ contract QBFTClient is ILightClient, ILightClientErrors { bytes32 internal constant CONSENSUS_STATE_TYPE_URL_HASH = keccak256(abi.encodePacked("/ibc.lightclients.qbft.v1.ConsensusState")); - uint256 internal constant COMMITMENT_SLOT = 0; + // keccak256(abi.encode(uint256(keccak256("ibc.commitment")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 internal constant COMMITMENT_SLOT = 0x1ee222554989dda120e26ecacf756fe1235cd8d726706b57517715dde4f0c900; uint8 internal constant ACCOUNT_STORAGE_ROOT_INDEX = 2; address public immutable ibcHandler; diff --git a/contracts/core/02-client/IBCClient.sol b/contracts/core/02-client/IBCClient.sol index 2d908d7d..e537dae0 100644 --- a/contracts/core/02-client/IBCClient.sol +++ b/contracts/core/02-client/IBCClient.sol @@ -17,16 +17,18 @@ contract IBCClient is IBCHost, IIBCClient, IIBCClientErrors { * @dev createClient creates a new client state and populates it with a given consensus state */ function createClient(MsgCreateClient calldata msg_) external override returns (string memory clientId) { - address clientImpl = clientRegistry[msg_.clientType]; + address clientImpl = getHostStorage().clientRegistry[msg_.clientType]; if (clientImpl == address(0)) { revert IBCClientUnregisteredClientType(msg_.clientType); } clientId = generateClientIdentifier(msg_.clientType); - clientTypes[clientId] = msg_.clientType; - clientImpls[clientId] = clientImpl; + ClientStorage storage client = getClientStorage()[clientId]; + client.clientType = msg_.clientType; + client.clientImpl = clientImpl; Height.Data memory height = ILightClient(clientImpl).initializeClient(clientId, msg_.protoClientState, msg_.protoConsensusState); // update commitments + mapping(bytes32 => bytes32) storage commitments = getCommitments(); commitments[IBCCommitment.clientStateCommitmentKey(clientId)] = keccak256(msg_.protoClientState); commitments[IBCCommitment.consensusStateCommitmentKey(clientId, height.revision_number, height.revision_height)] = keccak256(msg_.protoConsensusState); @@ -83,6 +85,7 @@ contract IBCClient is IBCHost, IIBCClient, IIBCClientErrors { if (!found) { revert IBCClientClientNotFound(clientId); } + mapping(bytes32 => bytes32) storage commitments = getCommitments(); commitments[IBCCommitment.clientStateCommitmentKey(clientId)] = keccak256(clientState); for (uint256 i = 0; i < heights.length; i++) { (consensusState, found) = lc.getConsensusState(clientId, heights[i]); @@ -102,9 +105,11 @@ contract IBCClient is IBCHost, IIBCClient, IIBCClientErrors { /** * @dev generateClientIdentifier generates a new client identifier for a given client type */ - function generateClientIdentifier(string calldata clientType) private returns (string memory) { - string memory identifier = string(abi.encodePacked(clientType, "-", Strings.toString(nextClientSequence))); - nextClientSequence++; + function generateClientIdentifier(string calldata clientType) internal returns (string memory) { + HostStorage storage hostStorage = getHostStorage(); + string memory identifier = + string(abi.encodePacked(clientType, "-", Strings.toString(hostStorage.nextClientSequence))); + hostStorage.nextClientSequence++; return identifier; } } diff --git a/contracts/core/03-connection/IBCConnection.sol b/contracts/core/03-connection/IBCConnection.sol index 6f3b478e..372a6215 100644 --- a/contracts/core/03-connection/IBCConnection.sol +++ b/contracts/core/03-connection/IBCConnection.sol @@ -26,7 +26,7 @@ abstract contract IBCConnection is IBCHost, IBCSelfStateValidator, IIBCConnectio returns (string memory) { string memory connectionId = generateConnectionIdentifier(); - ConnectionEnd.Data storage connection = connections[connectionId]; + ConnectionEnd.Data storage connection = getConnectionStorage()[connectionId].connection; if (connection.state != ConnectionEnd.State.STATE_UNINITIALIZED_UNSPECIFIED) { revert IBCConnectionAlreadyConnectionExists(); } @@ -71,7 +71,7 @@ abstract contract IBCConnection is IBCHost, IBCSelfStateValidator, IIBCConnectio bytes memory selfConsensusState = getSelfConsensusState(msg_.consensusHeight, msg_.hostConsensusStateProof); string memory connectionId = generateConnectionIdentifier(); - ConnectionEnd.Data storage connection = connections[connectionId]; + ConnectionEnd.Data storage connection = getConnectionStorage()[connectionId].connection; if (connection.state != ConnectionEnd.State.STATE_UNINITIALIZED_UNSPECIFIED) { revert IBCConnectionAlreadyConnectionExists(); } @@ -120,7 +120,7 @@ abstract contract IBCConnection is IBCHost, IBCSelfStateValidator, IIBCConnectio * to chain A (this code is executed on chain A). */ function connectionOpenAck(IIBCConnection.MsgConnectionOpenAck calldata msg_) external override { - ConnectionEnd.Data storage connection = connections[msg_.connectionId]; + ConnectionEnd.Data storage connection = getConnectionStorage()[msg_.connectionId].connection; if (connection.state != ConnectionEnd.State.STATE_INIT) { revert IBCConnectionUnexpectedConnectionState(connection.state); } @@ -169,7 +169,7 @@ abstract contract IBCConnection is IBCHost, IBCSelfStateValidator, IIBCConnectio * which the connection is open on both chains (this code is executed on chain B). */ function connectionOpenConfirm(IIBCConnection.MsgConnectionOpenConfirm calldata msg_) external override { - ConnectionEnd.Data storage connection = connections[msg_.connectionId]; + ConnectionEnd.Data storage connection = getConnectionStorage()[msg_.connectionId].connection; if (connection.state != ConnectionEnd.State.STATE_TRYOPEN) { revert IBCConnectionUnexpectedConnectionState(connection.state); } @@ -194,12 +194,29 @@ abstract contract IBCConnection is IBCHost, IBCSelfStateValidator, IIBCConnectio updateConnectionCommitment(msg_.connectionId); } - function updateConnectionCommitment(string memory connectionId) private { - commitments[IBCCommitment.connectionCommitmentKey(connectionId)] = - keccak256(ConnectionEnd.encode(connections[connectionId])); + /** + * @dev getCompatibleVersions returns the supported versions of the host chain. + */ + function getCompatibleVersions() public pure virtual returns (Version.Data[] memory) { + Version.Data[] memory versions = new Version.Data[](1); + versions[0] = IBCConnectionLib.defaultIBCVersion(); + return versions; } - /* Verification functions */ + // --------- Private Functions --------- // + + function generateConnectionIdentifier() private returns (string memory) { + HostStorage storage hostStorage = getHostStorage(); + string memory identifier = + string(abi.encodePacked("connection-", Strings.toString(hostStorage.nextConnectionSequence))); + hostStorage.nextConnectionSequence++; + return identifier; + } + + function updateConnectionCommitment(string memory connectionId) private { + getCommitments()[IBCCommitment.connectionCommitmentKey(connectionId)] = + keccak256(ConnectionEnd.encode(getConnectionStorage()[connectionId].connection)); + } function verifyClientState( ConnectionEnd.Data storage connection, @@ -294,21 +311,4 @@ abstract contract IBCConnection is IBCHost, IBCSelfStateValidator, IIBCConnectio height ); } - - /** - * @dev getCompatibleVersions returns the supported versions of the host chain. - */ - function getCompatibleVersions() public pure virtual returns (Version.Data[] memory) { - Version.Data[] memory versions = new Version.Data[](1); - versions[0] = IBCConnectionLib.defaultIBCVersion(); - return versions; - } - - /* Internal functions */ - - function generateConnectionIdentifier() private returns (string memory) { - string memory identifier = string(abi.encodePacked("connection-", Strings.toString(nextConnectionSequence))); - nextConnectionSequence++; - return identifier; - } } diff --git a/contracts/core/04-channel/IBCChannelHandshake.sol b/contracts/core/04-channel/IBCChannelHandshake.sol index 42e57a3a..8ffb369f 100644 --- a/contracts/core/04-channel/IBCChannelHandshake.sol +++ b/contracts/core/04-channel/IBCChannelHandshake.sol @@ -33,7 +33,7 @@ contract IBCChannelHandshake is IBCModuleManager, IIBCChannelHandshake, IIBCChan if (msg_.channel.connection_hops.length != 1) { revert IBCChannelInvalidConnectionHopsLength(msg_.channel.connection_hops.length); } - ConnectionEnd.Data storage connection = connections[msg_.channel.connection_hops[0]]; + ConnectionEnd.Data storage connection = getConnectionStorage()[msg_.channel.connection_hops[0]].connection; if (connection.versions.length != 1) { revert IBCChannelConnectionMultipleVersionsFound( msg_.channel.connection_hops[0], connection.versions.length @@ -92,7 +92,7 @@ contract IBCChannelHandshake is IBCModuleManager, IIBCChannelHandshake, IIBCChan if (msg_.channel.connection_hops.length != 1) { revert IBCChannelInvalidConnectionHopsLength(msg_.channel.connection_hops.length); } - ConnectionEnd.Data storage connection = connections[msg_.channel.connection_hops[0]]; + ConnectionEnd.Data storage connection = getConnectionStorage()[msg_.channel.connection_hops[0]].connection; if (connection.state != ConnectionEnd.State.STATE_OPEN) { revert IBCChannelConnectionNotOpened(msg_.channel.connection_hops[0]); } @@ -161,11 +161,11 @@ contract IBCChannelHandshake is IBCModuleManager, IIBCChannelHandshake, IIBCChan * @dev channelOpenAck is called by the handshake-originating module to acknowledge the acceptance of the initial request by the counterparty module on the other chain. */ function channelOpenAck(IIBCChannelHandshake.MsgChannelOpenAck calldata msg_) public override { - Channel.Data storage channel = channels[msg_.portId][msg_.channelId]; + Channel.Data storage channel = getChannelStorage()[msg_.portId][msg_.channelId].channel; if (channel.state != Channel.State.STATE_INIT) { revert IBCChannelUnexpectedChannelState(channel.state); } - ConnectionEnd.Data storage connection = connections[channel.connection_hops[0]]; + ConnectionEnd.Data storage connection = getConnectionStorage()[channel.connection_hops[0]].connection; Channel.Data memory expectedChannel = Channel.Data({ state: Channel.State.STATE_TRYOPEN, ordering: channel.ordering, @@ -200,11 +200,11 @@ contract IBCChannelHandshake is IBCModuleManager, IIBCChannelHandshake, IIBCChan * @dev channelOpenConfirm is called by the counterparty module to close their end of the channel, since the other end has been closed. */ function channelOpenConfirm(IIBCChannelHandshake.MsgChannelOpenConfirm calldata msg_) public override { - Channel.Data storage channel = channels[msg_.portId][msg_.channelId]; + Channel.Data storage channel = getChannelStorage()[msg_.portId][msg_.channelId].channel; if (channel.state != Channel.State.STATE_TRYOPEN) { revert IBCChannelUnexpectedChannelState(channel.state); } - ConnectionEnd.Data storage connection = connections[channel.connection_hops[0]]; + ConnectionEnd.Data storage connection = getConnectionStorage()[channel.connection_hops[0]].connection; Channel.Data memory expectedChannel = Channel.Data({ state: Channel.State.STATE_OPEN, ordering: channel.ordering, @@ -232,13 +232,13 @@ contract IBCChannelHandshake is IBCModuleManager, IIBCChannelHandshake, IIBCChan * @dev channelCloseInit is called by either module to close their end of the channel. Once closed, channels cannot be reopened. */ function channelCloseInit(IIBCChannelHandshake.MsgChannelCloseInit calldata msg_) public override { - Channel.Data storage channel = channels[msg_.portId][msg_.channelId]; + Channel.Data storage channel = getChannelStorage()[msg_.portId][msg_.channelId].channel; if (channel.state == Channel.State.STATE_UNINITIALIZED_UNSPECIFIED) { revert IBCChannelChannelNotFound(msg_.portId, msg_.channelId); } else if (channel.state == Channel.State.STATE_CLOSED) { revert IBCChannelUnexpectedChannelState(channel.state); } - ConnectionEnd.Data storage connection = connections[channel.connection_hops[0]]; + ConnectionEnd.Data storage connection = getConnectionStorage()[channel.connection_hops[0]].connection; if (connection.state != ConnectionEnd.State.STATE_OPEN) { revert IBCChannelConnectionNotOpened(channel.connection_hops[0]); } @@ -254,14 +254,14 @@ contract IBCChannelHandshake is IBCModuleManager, IIBCChannelHandshake, IIBCChan * channel, since the other end has been closed. */ function channelCloseConfirm(IIBCChannelHandshake.MsgChannelCloseConfirm calldata msg_) public override { - Channel.Data storage channel = channels[msg_.portId][msg_.channelId]; + Channel.Data storage channel = getChannelStorage()[msg_.portId][msg_.channelId].channel; if (channel.state == Channel.State.STATE_UNINITIALIZED_UNSPECIFIED) { revert IBCChannelChannelNotFound(msg_.portId, msg_.channelId); } else if (channel.state == Channel.State.STATE_CLOSED) { revert IBCChannelUnexpectedChannelState(channel.state); } - ConnectionEnd.Data storage connection = connections[channel.connection_hops[0]]; + ConnectionEnd.Data storage connection = getConnectionStorage()[channel.connection_hops[0]].connection; if (connection.state != ConnectionEnd.State.STATE_OPEN) { revert IBCChannelConnectionNotOpened(channel.connection_hops[0]); } @@ -303,7 +303,7 @@ contract IBCChannelHandshake is IBCModuleManager, IIBCChannelHandshake, IIBCChan string[] calldata connectionHops, string memory version ) private { - Channel.Data storage channel = channels[portId][channelId]; + Channel.Data storage channel = getChannelStorage()[portId][channelId].channel; channel.state = state; channel.ordering = order; channel.counterparty = counterparty; @@ -316,17 +316,27 @@ contract IBCChannelHandshake is IBCModuleManager, IIBCChannelHandshake, IIBCChan } function initializeSequences(string memory portId, string memory channelId) internal { - nextSequenceSends[portId][channelId] = 1; - nextSequenceRecvs[portId][channelId] = 1; - nextSequenceAcks[portId][channelId] = 1; - recvStartSequences[portId][channelId].sequence = 1; - commitments[IBCCommitment.nextSequenceRecvCommitmentKey(portId, channelId)] = + ChannelStorage storage channelStorage = getChannelStorage()[portId][channelId]; + + channelStorage.nextSequenceSend = 1; + channelStorage.nextSequenceRecv = 1; + channelStorage.nextSequenceAck = 1; + channelStorage.recvStartSequence.sequence = 1; + getCommitments()[IBCCommitment.nextSequenceRecvCommitmentKey(portId, channelId)] = keccak256(abi.encodePacked((bytes8(uint64(1))))); } function updateChannelCommitment(string memory portId, string memory channelId) private { - commitments[IBCCommitment.channelCommitmentKey(portId, channelId)] = - keccak256(Channel.encode(channels[portId][channelId])); + getCommitments()[IBCCommitment.channelCommitmentKey(portId, channelId)] = + keccak256(Channel.encode(getChannelStorage()[portId][channelId].channel)); + } + + function generateChannelIdentifier() private returns (string memory) { + HostStorage storage hostStorage = getHostStorage(); + string memory identifier = + string(abi.encodePacked("channel-", Strings.toString(hostStorage.nextChannelSequence))); + hostStorage.nextChannelSequence++; + return identifier; } function verifyChannelState( @@ -358,15 +368,9 @@ contract IBCChannelHandshake is IBCModuleManager, IIBCChannelHandshake, IIBCChan ); } - function getCounterpartyHops(string memory connectionId) internal view returns (string[] memory hops) { + function getCounterpartyHops(string memory connectionId) private view returns (string[] memory hops) { hops = new string[](1); - hops[0] = connections[connectionId].counterparty.connection_id; + hops[0] = getConnectionStorage()[connectionId].connection.counterparty.connection_id; return hops; } - - function generateChannelIdentifier() private returns (string memory) { - string memory identifier = string(abi.encodePacked("channel-", Strings.toString(nextChannelSequence))); - nextChannelSequence++; - return identifier; - } } diff --git a/contracts/core/04-channel/IBCChannelLib.sol b/contracts/core/04-channel/IBCChannelLib.sol index 7bb947bc..14de3c8c 100644 --- a/contracts/core/04-channel/IBCChannelLib.sol +++ b/contracts/core/04-channel/IBCChannelLib.sol @@ -41,4 +41,8 @@ library IBCChannelLib { revert IIBCChannelErrors.IBCChannelUnknownChannelOrder(order); } } + + function uint64ToBigEndianBytes(uint64 v) internal pure returns (bytes memory) { + return abi.encodePacked(bytes8(v)); + } } diff --git a/contracts/core/04-channel/IBCChannelPacketSendRecv.sol b/contracts/core/04-channel/IBCChannelPacketSendRecv.sol index 6bcaa3e7..de85c4db 100644 --- a/contracts/core/04-channel/IBCChannelPacketSendRecv.sol +++ b/contracts/core/04-channel/IBCChannelPacketSendRecv.sol @@ -40,7 +40,8 @@ contract IBCChannelPacketSendRecv is ) public override returns (uint64) { authenticateChannelCapability(sourcePort, sourceChannel); - Channel.Data storage channel = channels[sourcePort][sourceChannel]; + ChannelStorage storage channelStorage = getChannelStorage()[sourcePort][sourceChannel]; + Channel.Data storage channel = channelStorage.channel; if (channel.state != Channel.State.STATE_OPEN) { revert IBCChannelUnexpectedChannelState(channel.state); } @@ -50,9 +51,9 @@ contract IBCChannelPacketSendRecv is { // NOTE: We can assume here that the connection state is OPEN because the channel state is OPEN - ConnectionEnd.Data storage connection = connections[channel.connection_hops[0]]; + ConnectionEnd.Data storage connection = getConnectionStorage()[channel.connection_hops[0]].connection; (Height.Data memory latestHeight, uint64 latestTimestamp, ILightClient.ClientStatus status) = - ILightClient(clientImpls[connection.client_id]).getLatestInfo(connection.client_id); + ILightClient(getClientStorage()[connection.client_id].clientImpl).getLatestInfo(connection.client_id); if (status != ILightClient.ClientStatus.Active) { revert IBCClientNotActiveClient(connection.client_id); } @@ -64,9 +65,10 @@ contract IBCChannelPacketSendRecv is } } - uint64 packetSequence = nextSequenceSends[sourcePort][sourceChannel]; - nextSequenceSends[sourcePort][sourceChannel] = packetSequence + 1; - commitments[IBCCommitment.packetCommitmentKeyCalldata(sourcePort, sourceChannel, packetSequence)] = keccak256( + uint64 packetSequence = channelStorage.nextSequenceSend; + channelStorage.nextSequenceSend = packetSequence + 1; + getCommitments()[IBCCommitment.packetCommitmentKeyCalldata(sourcePort, sourceChannel, packetSequence)] = + keccak256( abi.encodePacked( sha256( abi.encodePacked( @@ -90,7 +92,7 @@ contract IBCChannelPacketSendRecv is bytes calldata acknowledgement ) public override { authenticateChannelCapability(destinationPortId, destinationChannel); - Channel.Data storage channel = channels[destinationPortId][destinationChannel]; + Channel.Data storage channel = getChannelStorage()[destinationPortId][destinationChannel].channel; if (channel.state != Channel.State.STATE_OPEN) { revert IBCChannelUnexpectedChannelState(channel.state); } @@ -105,11 +107,12 @@ contract IBCChannelPacketSendRecv is * sent on the corresponding channel end on the counterparty chain. */ function recvPacket(MsgPacketRecv calldata msg_) public override { - Channel.Data storage channel = channels[msg_.packet.destinationPort][msg_.packet.destinationChannel]; + ChannelStorage storage channelStorage = + getChannelStorage()[msg_.packet.destinationPort][msg_.packet.destinationChannel]; + Channel.Data storage channel = channelStorage.channel; if (channel.state == Channel.State.STATE_OPEN) {} else if (channel.state == Channel.State.STATE_FLUSHING || channel.state == Channel.State.STATE_FLUSHCOMPLETE) { - RecvStartSequence storage rseq = - recvStartSequences[msg_.packet.destinationPort][msg_.packet.destinationChannel]; + RecvStartSequence storage rseq = channelStorage.recvStartSequence; // prevSequence=0 means the channel is not in the process of being upgraded or counterparty has not been upgraded yet if (rseq.prevSequence != 0) { if (msg_.packet.sequence >= rseq.sequence) { @@ -137,7 +140,7 @@ contract IBCChannelPacketSendRecv is } verifyPacketCommitment( - connections[channel.connection_hops[0]], + getConnectionStorage()[channel.connection_hops[0]].connection, msg_.proofHeight, msg_.proof, IBCCommitment.packetCommitmentPathCalldata( @@ -155,19 +158,15 @@ contract IBCChannelPacketSendRecv is if (channel.ordering == Channel.Order.ORDER_UNORDERED) { if (channel.state == Channel.State.STATE_OPEN) { - if ( - msg_.packet.sequence - < recvStartSequences[msg_.packet.destinationPort][msg_.packet.destinationChannel].sequence - ) { - revert IBCChannelPacketAlreadyProcessInPreviousUpgrade( - msg_.packet.sequence, - recvStartSequences[msg_.packet.destinationPort][msg_.packet.destinationChannel].sequence - ); + RecvStartSequence storage rseq = channelStorage.recvStartSequence; + if (msg_.packet.sequence < rseq.sequence) { + revert IBCChannelPacketAlreadyProcessInPreviousUpgrade(msg_.packet.sequence, rseq.sequence); } } bytes32 commitmentKey = IBCCommitment.packetReceiptCommitmentKeyCalldata( msg_.packet.destinationPort, msg_.packet.destinationChannel, msg_.packet.sequence ); + mapping(bytes32 => bytes32) storage commitments = getCommitments(); if (commitments[commitmentKey] != bytes32(0)) { revert IBCChannelPacketReceiptAlreadyExists( msg_.packet.destinationPort, msg_.packet.destinationChannel, msg_.packet.sequence @@ -175,18 +174,13 @@ contract IBCChannelPacketSendRecv is } commitments[commitmentKey] = IBCChannelLib.PACKET_RECEIPT_SUCCESSFUL_KECCAK256; } else if (channel.ordering == Channel.Order.ORDER_ORDERED) { - if (nextSequenceRecvs[msg_.packet.destinationPort][msg_.packet.destinationChannel] != msg_.packet.sequence) - { - revert IBCChannelUnexpectedNextSequenceRecv( - nextSequenceRecvs[msg_.packet.destinationPort][msg_.packet.destinationChannel] - ); + if (channelStorage.nextSequenceRecv != msg_.packet.sequence) { + revert IBCChannelUnexpectedNextSequenceRecv(channelStorage.nextSequenceRecv); } - nextSequenceRecvs[msg_.packet.destinationPort][msg_.packet.destinationChannel]++; - commitments[IBCCommitment.nextSequenceRecvCommitmentKeyCalldata( + channelStorage.nextSequenceRecv++; + getCommitments()[IBCCommitment.nextSequenceRecvCommitmentKeyCalldata( msg_.packet.destinationPort, msg_.packet.destinationChannel - )] = keccak256( - uint64ToBigEndianBytes(nextSequenceRecvs[msg_.packet.destinationPort][msg_.packet.destinationChannel]) - ); + )] = keccak256(IBCChannelLib.uint64ToBigEndianBytes(channelStorage.nextSequenceRecv)); } else { revert IBCChannelUnknownChannelOrder(channel.ordering); } @@ -210,7 +204,8 @@ contract IBCChannelPacketSendRecv is * It will also increment NextSequenceAck in case of ORDERED channels. */ function acknowledgePacket(MsgPacketAcknowledgement calldata msg_) public override { - Channel.Data storage channel = channels[msg_.packet.sourcePort][msg_.packet.sourceChannel]; + ChannelStorage storage channelStorage = getChannelStorage()[msg_.packet.sourcePort][msg_.packet.sourceChannel]; + Channel.Data storage channel = channelStorage.channel; if (channel.state != Channel.State.STATE_OPEN) { if (channel.state != Channel.State.STATE_FLUSHING) { revert IBCChannelUnexpectedChannelState(channel.state); @@ -225,36 +220,37 @@ contract IBCChannelPacketSendRecv is revert IBCChannelUnexpectedPacketDestination(msg_.packet.destinationPort, msg_.packet.destinationChannel); } - // NOTE: We can assume here that the connection state is OPEN because the channel state is OPEN - ConnectionEnd.Data storage connection = connections[channel.connection_hops[0]]; - bytes32 packetCommitmentKey = IBCCommitment.packetCommitmentKeyCalldata( msg_.packet.sourcePort, msg_.packet.sourceChannel, msg_.packet.sequence ); + mapping(bytes32 => bytes32) storage commitments = getCommitments(); bytes32 packetCommitment = commitments[packetCommitmentKey]; if (packetCommitment == bytes32(0)) { revert IBCChannelPacketCommitmentNotFound( msg_.packet.sourcePort, msg_.packet.sourceChannel, msg_.packet.sequence ); } - bytes32 commitment = keccak256( - abi.encodePacked( - sha256( - abi.encodePacked( - msg_.packet.timeoutTimestamp, - msg_.packet.timeoutHeight.revision_number, - msg_.packet.timeoutHeight.revision_height, - sha256(msg_.packet.data) + { + bytes32 commitment = keccak256( + abi.encodePacked( + sha256( + abi.encodePacked( + msg_.packet.timeoutTimestamp, + msg_.packet.timeoutHeight.revision_number, + msg_.packet.timeoutHeight.revision_height, + sha256(msg_.packet.data) + ) ) ) - ) - ); - if (packetCommitment != commitment) { - revert IBCChannelPacketCommitmentMismatch(packetCommitment, commitment); + ); + if (packetCommitment != commitment) { + revert IBCChannelPacketCommitmentMismatch(packetCommitment, commitment); + } } verifyPacketAcknowledgement( - connection, + // NOTE: We can assume here that the connection state is OPEN because the channel state is OPEN + getConnectionStorage()[channel.connection_hops[0]].connection, msg_.proofHeight, msg_.proof, IBCCommitment.packetAcknowledgementCommitmentPathCalldata( @@ -264,16 +260,14 @@ contract IBCChannelPacketSendRecv is ); if (channel.ordering == Channel.Order.ORDER_ORDERED) { - if (msg_.packet.sequence != nextSequenceAcks[msg_.packet.sourcePort][msg_.packet.sourceChannel]) { - revert IBCChannelUnexpectedNextSequenceAck( - nextSequenceAcks[msg_.packet.sourcePort][msg_.packet.sourceChannel] - ); + if (msg_.packet.sequence != channelStorage.nextSequenceAck) { + revert IBCChannelUnexpectedNextSequenceAck(channelStorage.nextSequenceAck); } - nextSequenceAcks[msg_.packet.sourcePort][msg_.packet.sourceChannel]++; + channelStorage.nextSequenceAck++; } else if (channel.ordering == Channel.Order.ORDER_UNORDERED) { - if (msg_.packet.sequence < ackStartSequences[msg_.packet.sourcePort][msg_.packet.sourceChannel]) { + if (msg_.packet.sequence < channelStorage.ackStartSequence) { revert IBCChannelAckAlreadyProcessedInPreviousUpgrade( - msg_.packet.sequence, ackStartSequences[msg_.packet.sourcePort][msg_.packet.sourceChannel] + msg_.packet.sequence, channelStorage.ackStartSequence ); } } else { @@ -297,13 +291,27 @@ contract IBCChannelPacketSendRecv is ) private { bytes32 ackCommitmentKey = IBCCommitment.packetAcknowledgementCommitmentKeyCalldata(destinationPortId, destinationChannel, sequence); - if (commitments[ackCommitmentKey] != bytes32(0)) { + if (getCommitments()[ackCommitmentKey] != bytes32(0)) { revert IBCChannelAcknowledgementAlreadyWritten(destinationPortId, destinationChannel, sequence); } - commitments[ackCommitmentKey] = keccak256(abi.encodePacked(sha256(acknowledgement))); + getCommitments()[ackCommitmentKey] = keccak256(abi.encodePacked(sha256(acknowledgement))); emit WriteAcknowledgement(destinationPortId, destinationChannel, sequence, acknowledgement); } + /** + * @dev calcBlockDelay calculates the block delay based on the expected time per block + */ + function calcBlockDelay(uint64 timeDelay) private view returns (uint64) { + HostStorage storage hostStorage = getHostStorage(); + if (timeDelay == 0) { + return 0; + } else if (hostStorage.expectedTimePerBlock == 0) { + return 0; + } else { + return (timeDelay + hostStorage.expectedTimePerBlock - 1) / hostStorage.expectedTimePerBlock; + } + } + function verifyPacketCommitment( ConnectionEnd.Data storage connection, Height.Data calldata height, @@ -357,18 +365,4 @@ contract IBCChannelPacketSendRecv is connection.client_id, path, acknowledgementCommitment, proof, height ); } - - function calcBlockDelay(uint64 timeDelay) private view returns (uint64) { - if (timeDelay == 0) { - return 0; - } else if (expectedTimePerBlock == 0) { - return 0; - } else { - return (timeDelay + expectedTimePerBlock - 1) / expectedTimePerBlock; - } - } - - function uint64ToBigEndianBytes(uint64 v) private pure returns (bytes memory) { - return abi.encodePacked(bytes8(v)); - } } diff --git a/contracts/core/04-channel/IBCChannelPacketTimeout.sol b/contracts/core/04-channel/IBCChannelPacketTimeout.sol index 193e6f2d..763897b1 100644 --- a/contracts/core/04-channel/IBCChannelPacketTimeout.sol +++ b/contracts/core/04-channel/IBCChannelPacketTimeout.sol @@ -16,7 +16,7 @@ contract IBCChannelPacketTimeout is IBCModuleManager, IIBCChannelPacketTimeout, using IBCHeight for Height.Data; function timeoutPacket(MsgTimeoutPacket calldata msg_) external { - Channel.Data storage channel = channels[msg_.packet.sourcePort][msg_.packet.sourceChannel]; + Channel.Data storage channel = getChannelStorage()[msg_.packet.sourcePort][msg_.packet.sourceChannel].channel; if (channel.state != Channel.State.STATE_OPEN) { revert IBCChannelUnexpectedChannelState(channel.state); } @@ -30,8 +30,8 @@ contract IBCChannelPacketTimeout is IBCModuleManager, IIBCChannelPacketTimeout, } // NOTE: we can assume here that the connection exists because the channel is open - ConnectionEnd.Data storage connection = connections[channel.connection_hops[0]]; - ILightClient client = ILightClient(clientImpls[connection.client_id]); + ConnectionEnd.Data storage connection = getConnectionStorage()[channel.connection_hops[0]].connection; + ILightClient client = ILightClient(getClientStorage()[connection.client_id].clientImpl); if (msg_.packet.timeoutHeight.isZero() || msg_.proofHeight.lt(msg_.packet.timeoutHeight)) { if ( @@ -43,7 +43,7 @@ contract IBCChannelPacketTimeout is IBCModuleManager, IIBCChannelPacketTimeout, } { - bytes32 commitment = commitments[IBCCommitment.packetCommitmentKeyCalldata( + bytes32 commitment = getCommitments()[IBCCommitment.packetCommitmentKeyCalldata( msg_.packet.sourcePort, msg_.packet.sourceChannel, msg_.packet.sequence )]; // NOTE: if false, this indicates that the timeoutPacket already been executed @@ -86,7 +86,7 @@ contract IBCChannelPacketTimeout is IBCModuleManager, IIBCChannelPacketTimeout, IBCCommitment.nextSequenceRecvCommitmentPath( msg_.packet.destinationPort, msg_.packet.destinationChannel ), - uint64ToBigEndianBytes(msg_.nextSequenceRecv) + IBCChannelLib.uint64ToBigEndianBytes(msg_.nextSequenceRecv) ) ) { revert IBCChannelFailedVerifyNextSequenceRecv( @@ -124,7 +124,7 @@ contract IBCChannelPacketTimeout is IBCModuleManager, IIBCChannelPacketTimeout, revert IBCChannelUnknownChannelOrder(channel.ordering); } - delete commitments[IBCCommitment.packetCommitmentKeyCalldata( + delete getCommitments()[IBCCommitment.packetCommitmentKeyCalldata( msg_.packet.sourcePort, msg_.packet.sourceChannel, msg_.packet.sequence )]; @@ -135,7 +135,7 @@ contract IBCChannelPacketTimeout is IBCModuleManager, IIBCChannelPacketTimeout, } function timeoutOnClose(MsgTimeoutOnClose calldata msg_) external { - Channel.Data storage channel = channels[msg_.packet.sourcePort][msg_.packet.sourceChannel]; + Channel.Data storage channel = getChannelStorage()[msg_.packet.sourcePort][msg_.packet.sourceChannel].channel; if (channel.state != Channel.State.STATE_OPEN) { revert IBCChannelUnexpectedChannelState(channel.state); } @@ -148,10 +148,10 @@ contract IBCChannelPacketTimeout is IBCModuleManager, IIBCChannelPacketTimeout, revert IBCChannelUnexpectedPacketDestination(msg_.packet.destinationPort, msg_.packet.destinationChannel); } - ConnectionEnd.Data storage connection = connections[channel.connection_hops[0]]; - ILightClient client = ILightClient(clientImpls[connection.client_id]); + ConnectionEnd.Data storage connection = getConnectionStorage()[channel.connection_hops[0]].connection; + ILightClient client = ILightClient(getClientStorage()[connection.client_id].clientImpl); { - bytes32 commitment = commitments[IBCCommitment.packetCommitmentKeyCalldata( + bytes32 commitment = getCommitments()[IBCCommitment.packetCommitmentKeyCalldata( msg_.packet.sourcePort, msg_.packet.sourceChannel, msg_.packet.sequence )]; // NOTE: if false, this indicates that the timeoutPacket already been executed @@ -229,7 +229,7 @@ contract IBCChannelPacketTimeout is IBCModuleManager, IIBCChannelPacketTimeout, IBCCommitment.nextSequenceRecvCommitmentPath( msg_.packet.destinationPort, msg_.packet.destinationChannel ), - uint64ToBigEndianBytes(msg_.nextSequenceRecv) + IBCChannelLib.uint64ToBigEndianBytes(msg_.nextSequenceRecv) ) ) { revert IBCChannelFailedVerifyNextSequenceRecv( @@ -271,19 +271,17 @@ contract IBCChannelPacketTimeout is IBCModuleManager, IIBCChannelPacketTimeout, emit TimeoutPacket(msg_.packet); } - // private functions - + /** + * @dev calcBlockDelay calculates the block delay based on the expected time per block + */ function calcBlockDelay(uint64 timeDelay) private view returns (uint64) { + HostStorage storage hostStorage = getHostStorage(); if (timeDelay == 0) { return 0; - } else if (expectedTimePerBlock == 0) { + } else if (hostStorage.expectedTimePerBlock == 0) { return 0; } else { - return (timeDelay + expectedTimePerBlock - 1) / expectedTimePerBlock; + return (timeDelay + hostStorage.expectedTimePerBlock - 1) / hostStorage.expectedTimePerBlock; } } - - function uint64ToBigEndianBytes(uint64 v) private pure returns (bytes memory) { - return abi.encodePacked(bytes8(v)); - } } diff --git a/contracts/core/04-channel/IBCChannelUpgrade.sol b/contracts/core/04-channel/IBCChannelUpgrade.sol index c212645b..fd66f879 100644 --- a/contracts/core/04-channel/IBCChannelUpgrade.sol +++ b/contracts/core/04-channel/IBCChannelUpgrade.sol @@ -53,7 +53,8 @@ abstract contract IBCChannelUpgradeBase is // proposedConnection must exist and be in OPEN state for // channel upgrade to be accepted - ConnectionEnd.Data storage proposedConnection = connections[proposedUpgradeFields.connection_hops[0]]; + ConnectionEnd.Data storage proposedConnection = + getConnectionStorage()[proposedUpgradeFields.connection_hops[0]].connection; if (proposedConnection.state != ConnectionEnd.State.STATE_OPEN) { revert IBCConnectionUnexpectedConnectionState(proposedConnection.state); } @@ -88,6 +89,7 @@ abstract contract IBCChannelUpgradeBase is IIBCModuleUpgrade module, Channel.Data storage channel, Upgrade.Data storage upgrade, + ChannelStorage storage channelStorage, string calldata portId, string calldata channelId ) internal { @@ -102,7 +104,7 @@ abstract contract IBCChannelUpgradeBase is } channel.state = Channel.State.STATE_FLUSHING; upgrade.timeout = upgradeTimeout; - upgrade.next_sequence_send = nextSequenceSends[portId][channelId]; + upgrade.next_sequence_send = channelStorage.nextSequenceSend; } /** @@ -113,12 +115,13 @@ abstract contract IBCChannelUpgradeBase is */ // reason function restoreChannel(string calldata portId, string calldata channelId, UpgradeHandshakeError err) internal { - Channel.Data storage channel = channels[portId][channelId]; + ChannelStorage storage channelStorage = getChannelStorage()[portId][channelId]; + Channel.Data storage channel = channelStorage.channel; channel.state = Channel.State.STATE_OPEN; - delete upgrades[portId][channelId]; + delete channelStorage.upgrade; deleteUpgradeCommitment(portId, channelId); - revertCounterpartyUpgrade(portId, channelId); + revertCounterpartyUpgrade(channelStorage.recvStartSequence); updateChannelCommitment(portId, channelId, channel); writeErrorReceipt(portId, channelId, channel.upgrade_sequence, err); @@ -133,25 +136,26 @@ abstract contract IBCChannelUpgradeBase is * caller must do all relevant checks before calling this function. */ function openUpgradeHandshake(string calldata portId, string calldata channelId) internal { - Channel.Data storage channel = channels[portId][channelId]; - Upgrade.Data storage upgrade = upgrades[portId][channelId]; + ChannelStorage storage channelStorage = getChannelStorage()[portId][channelId]; + Channel.Data storage channel = channelStorage.channel; + Upgrade.Data storage upgrade = channelStorage.upgrade; // In ibc-solidity, we need to set the nextSequenceRecv and nextSequenceAck appropriately for each upgrade if (upgrade.fields.ordering == Channel.Order.ORDER_ORDERED) { // set nextSequenceRecv to the counterparty nextSequenceSend since all packets were flushed - nextSequenceRecvs[portId][channelId] = recvStartSequences[portId][channelId].sequence; + channelStorage.nextSequenceRecv = channelStorage.recvStartSequence.sequence; // set nextSequenceAck to our own nextSequenceSend since all packets were flushed - nextSequenceAcks[portId][channelId] = nextSequenceSends[portId][channelId]; + channelStorage.nextSequenceAck = channelStorage.nextSequenceSend; } else if (upgrade.fields.ordering == Channel.Order.ORDER_UNORDERED) { // reset recv and ack sequences to 1 for UNORDERED channel - nextSequenceRecvs[portId][channelId] = 1; - nextSequenceAcks[portId][channelId] = 1; + channelStorage.nextSequenceRecv = 1; + channelStorage.nextSequenceAck = 1; } else { revert IBCChannelUpgradeUnsupportedOrdering(upgrade.fields.ordering); } - commitments[IBCCommitment.nextSequenceRecvCommitmentKey(portId, channelId)] = - keccak256(abi.encodePacked(nextSequenceRecvs[portId][channelId])); - ackStartSequences[portId][channelId] = nextSequenceSends[portId][channelId]; + getCommitments()[IBCCommitment.nextSequenceRecvCommitmentKey(portId, channelId)] = + keccak256(abi.encodePacked(channelStorage.nextSequenceRecv)); + channelStorage.ackStartSequence = channelStorage.nextSequenceSend; // switch channel fields to upgrade fields // and set channel state to OPEN @@ -169,8 +173,8 @@ abstract contract IBCChannelUpgradeBase is // were already processed by counterparty when flushing completed // delete auxiliary state - delete upgrades[portId][channelId]; - recvStartSequences[portId][channelId].prevSequence = 0; + delete channelStorage.upgrade; + channelStorage.recvStartSequence.prevSequence = 0; updateChannelCommitment(portId, channelId, channel); deleteUpgradeCommitment(portId, channelId); @@ -196,7 +200,8 @@ abstract contract IBCChannelUpgradeBase is // off-chain authority is responsible for replacing one side's upgrade fields // to be compatible so that the upgrade handshake can proceed - ConnectionEnd.Data storage proposedConnection = connections[proposedUpgradeFields.connection_hops[0]]; + ConnectionEnd.Data storage proposedConnection = + getConnectionStorage()[proposedUpgradeFields.connection_hops[0]].connection; if (proposedConnection.state != ConnectionEnd.State.STATE_OPEN) { return false; } @@ -213,14 +218,15 @@ abstract contract IBCChannelUpgradeBase is uint64 upgradeSequence, UpgradeHandshakeError err ) internal { - if (latestErrorReceiptSequences[portId][channelId] >= upgradeSequence) { + ChannelStorage storage channelStorage = getChannelStorage()[portId][channelId]; + if (channelStorage.latestErrorReceiptSequence >= upgradeSequence) { revert IBCChannelUpgradeWriteOldErrorReceiptSequence( - latestErrorReceiptSequences[portId][channelId], upgradeSequence + channelStorage.latestErrorReceiptSequence, upgradeSequence ); } - latestErrorReceiptSequences[portId][channelId] = upgradeSequence; + channelStorage.latestErrorReceiptSequence = upgradeSequence; string memory message = toString(err); - commitments[IBCCommitment.channelUpgradeErrorCommitmentKey(portId, channelId)] = + getCommitments()[IBCCommitment.channelUpgradeErrorCommitmentKey(portId, channelId)] = keccak256(ErrorReceipt.encode(ErrorReceipt.Data({sequence: upgradeSequence, message: message}))); emit WriteErrorReceipt(portId, channelId, upgradeSequence, message); } @@ -228,7 +234,7 @@ abstract contract IBCChannelUpgradeBase is function updateChannelCommitment(string calldata portId, string calldata channelId, Channel.Data storage channel) internal { - commitments[IBCCommitment.channelCommitmentKey(portId, channelId)] = keccak256(Channel.encode(channel)); + getCommitments()[IBCCommitment.channelCommitmentKey(portId, channelId)] = keccak256(Channel.encode(channel)); } function updateUpgradeCommitment(string calldata portId, string calldata channelId, Upgrade.Data storage upgrade) @@ -242,22 +248,19 @@ abstract contract IBCChannelUpgradeBase is } function updateUpgradeCommitment(string calldata portId, string calldata channelId, bytes32 commitment) internal { - commitments[IBCCommitment.channelUpgradeCommitmentKey(portId, channelId)] = commitment; + getCommitments()[IBCCommitment.channelUpgradeCommitmentKey(portId, channelId)] = commitment; } - function setCounterpartyUpgrade(string calldata portId, string calldata channelId, Upgrade.Data calldata upgrade) - internal - { - RecvStartSequence storage recvStartSequence = recvStartSequences[portId][channelId]; + function setCounterpartyUpgrade(ChannelStorage storage channelStorage, Upgrade.Data calldata upgrade) internal { + RecvStartSequence storage recvStartSequence = channelStorage.recvStartSequence; if (recvStartSequence.prevSequence != 0) { - revertCounterpartyUpgrade(portId, channelId); + revertCounterpartyUpgrade(channelStorage.recvStartSequence); } recvStartSequence.prevSequence = recvStartSequence.sequence; recvStartSequence.sequence = upgrade.next_sequence_send; } - function revertCounterpartyUpgrade(string calldata portId, string calldata channelId) internal { - RecvStartSequence storage recvStartSequence = recvStartSequences[portId][channelId]; + function revertCounterpartyUpgrade(RecvStartSequence storage recvStartSequence) internal { uint64 prevRecvStartSequence = recvStartSequence.prevSequence; if (prevRecvStartSequence == 0) { return; @@ -275,7 +278,7 @@ abstract contract IBCChannelUpgradeBase is ) internal { // slither-disable-start reentrancy-no-eth if ( - ILightClient(clientImpls[connection.client_id]).verifyMembership( + ILightClient(getClientStorage()[connection.client_id].clientImpl).verifyMembership( connection.client_id, height, 0, 0, proof, connection.counterparty.prefix.key_prefix, path, value ) ) { @@ -306,7 +309,7 @@ abstract contract IBCChannelUpgradeBase is Channel.State counterpartyChannelState, ChannelUpgradeProofs calldata proofs ) internal { - ConnectionEnd.Data storage connection = connections[channel.connection_hops[0]]; + ConnectionEnd.Data storage connection = getConnectionStorage()[channel.connection_hops[0]].connection; { Channel.Data memory counterpartyChannel = Channel.Data({ state: counterpartyChannelState, @@ -353,11 +356,12 @@ contract IBCChannelUpgradeInitTryAck is IBCChannelUpgradeBase, IIBCChannelUpgrad revert IBCChannelUpgradeUnauthorizedChannelUpgrader(_msgSender()); } - Channel.Data storage channel = channels[msg_.portId][msg_.channelId]; - Upgrade.Data storage upgrade = upgrades[msg_.portId][msg_.channelId]; + ChannelStorage storage channelStorage = getChannelStorage()[msg_.portId][msg_.channelId]; + Channel.Data storage channel = channelStorage.channel; + Upgrade.Data storage upgrade = channelStorage.upgrade; if (upgrade.fields.ordering != Channel.Order.ORDER_NONE_UNSPECIFIED) { - delete upgrades[msg_.portId][msg_.channelId]; - revertCounterpartyUpgrade(msg_.portId, msg_.channelId); + delete channelStorage.upgrade; + revertCounterpartyUpgrade(channelStorage.recvStartSequence); // NOTE: we do not delete the upgrade commitment here since the new upgrade will overwrite the old one writeErrorReceipt(msg_.portId, msg_.channelId, channel.upgrade_sequence, UpgradeHandshakeError.Overwritten); } @@ -384,7 +388,8 @@ contract IBCChannelUpgradeInitTryAck is IBCChannelUpgradeBase, IIBCChannelUpgrad function channelUpgradeTry(MsgChannelUpgradeTry calldata msg_) public override returns (bool, uint64) { IIBCModuleUpgrade module = lookupUpgradableModuleByPort(msg_.portId); // current channel must be OPEN (i.e. not in FLUSHING) - Channel.Data storage channel = channels[msg_.portId][msg_.channelId]; + ChannelStorage storage channelStorage = getChannelStorage()[msg_.portId][msg_.channelId]; + Channel.Data storage channel = channelStorage.channel; if (channel.state != Channel.State.STATE_OPEN) { revert IBCChannelUnexpectedChannelState(channel.state); } @@ -403,7 +408,7 @@ contract IBCChannelUpgradeInitTryAck is IBCChannelUpgradeBase, IIBCChannelUpgrad msg_.proofs ); - Upgrade.Data storage existingUpgrade = upgrades[msg_.portId][msg_.channelId]; + Upgrade.Data storage existingUpgrade = channelStorage.upgrade; uint64 expectedUpgradeSequence; if (existingUpgrade.fields.ordering == Channel.Order.ORDER_NONE_UNSPECIFIED) { // NON CROSSING HELLO CASE @@ -473,7 +478,7 @@ contract IBCChannelUpgradeInitTryAck is IBCChannelUpgradeBase, IIBCChannelUpgrad // call startFlushUpgradeHandshake to move channel to FLUSHING, which will block // upgrade from progressing to OPEN until flush completes on both ends - startFlushUpgradeHandshake(module, channel, existingUpgrade, msg_.portId, msg_.channelId); + startFlushUpgradeHandshake(module, channel, existingUpgrade, channelStorage, msg_.portId, msg_.channelId); updateChannelCommitment(msg_.portId, msg_.channelId, channel); existingUpgrade.fields.version = @@ -497,7 +502,8 @@ contract IBCChannelUpgradeInitTryAck is IBCChannelUpgradeBase, IIBCChannelUpgrad */ function channelUpgradeAck(MsgChannelUpgradeAck calldata msg_) public override returns (bool) { // current channel is OPEN or FLUSHING (crossing hellos) - Channel.Data storage channel = channels[msg_.portId][msg_.channelId]; + ChannelStorage storage channelStorage = getChannelStorage()[msg_.portId][msg_.channelId]; + Channel.Data storage channel = channelStorage.channel; if (channel.state != Channel.State.STATE_OPEN && channel.state != Channel.State.STATE_FLUSHING) { revert IBCChannelUpgradeNotOpenOrFlushing(channel.state); } @@ -511,7 +517,7 @@ contract IBCChannelUpgradeInitTryAck is IBCChannelUpgradeBase, IIBCChannelUpgrad msg_.proofs ); - Upgrade.Data storage existingUpgrade = upgrades[msg_.portId][msg_.channelId]; + Upgrade.Data storage existingUpgrade = channelStorage.upgrade; if (existingUpgrade.fields.ordering == Channel.Order.ORDER_NONE_UNSPECIFIED) { revert IBCChannelUpgradeNoExistingUpgrade(); } @@ -534,7 +540,7 @@ contract IBCChannelUpgradeInitTryAck is IBCChannelUpgradeBase, IIBCChannelUpgrad // prove counterparty and move our own state to flushing // if we are already at flushing, then no state changes occur // upgrade is blocked on this channelEnd from progressing until flush completes on its end - startFlushUpgradeHandshake(module, channel, existingUpgrade, msg_.portId, msg_.channelId); + startFlushUpgradeHandshake(module, channel, existingUpgrade, channelStorage, msg_.portId, msg_.channelId); // NOTE: `upgrade` and `channel` are updated only when channel.state is OPEN updateChannelCommitment(msg_.portId, msg_.channelId, channel); updateUpgradeCommitment(msg_.portId, msg_.channelId, existingUpgrade); @@ -556,7 +562,7 @@ contract IBCChannelUpgradeInitTryAck is IBCChannelUpgradeBase, IIBCChannelUpgrad channel.state = Channel.State.STATE_FLUSHCOMPLETE; updateChannelCommitment(msg_.portId, msg_.channelId, channel); } - setCounterpartyUpgrade(msg_.portId, msg_.channelId, msg_.counterpartyUpgrade); + setCounterpartyUpgrade(channelStorage, msg_.counterpartyUpgrade); // call modules onChanUpgradeAck callback // module can error on counterparty version @@ -591,7 +597,8 @@ contract IBCChannelUpgradeConfirmOpenTimeoutCancel is * @dev See {IIBCChannelUpgrade-channelUpgradeConfirm} */ function channelUpgradeConfirm(MsgChannelUpgradeConfirm calldata msg_) public override returns (bool) { - Channel.Data storage channel = channels[msg_.portId][msg_.channelId]; + ChannelStorage storage channelStorage = getChannelStorage()[msg_.portId][msg_.channelId]; + Channel.Data storage channel = channelStorage.channel; // current channel is in FLUSHING if (channel.state != Channel.State.STATE_FLUSHING) { revert IBCChannelUpgradeNotFlushing(channel.state); @@ -614,7 +621,7 @@ contract IBCChannelUpgradeConfirmOpenTimeoutCancel is msg_.proofs ); - Upgrade.Data storage existingUpgrade = upgrades[msg_.portId][msg_.channelId]; + Upgrade.Data storage existingUpgrade = channelStorage.upgrade; if (existingUpgrade.fields.ordering == Channel.Order.ORDER_NONE_UNSPECIFIED) { revert IBCChannelUpgradeNoExistingUpgrade(); } @@ -639,7 +646,7 @@ contract IBCChannelUpgradeConfirmOpenTimeoutCancel is channel.state = Channel.State.STATE_FLUSHCOMPLETE; updateChannelCommitment(msg_.portId, msg_.channelId, channel); } - setCounterpartyUpgrade(msg_.portId, msg_.channelId, msg_.counterpartyUpgrade); + setCounterpartyUpgrade(channelStorage, msg_.counterpartyUpgrade); emit ChannelUpgradeConfirm(msg_.portId, msg_.channelId, channel.upgrade_sequence, channel.state); @@ -661,19 +668,21 @@ contract IBCChannelUpgradeConfirmOpenTimeoutCancel is */ function channelUpgradeOpen(MsgChannelUpgradeOpen calldata msg_) public override { // channel must have completed flushing - Channel.Data storage channel = channels[msg_.portId][msg_.channelId]; + ChannelStorage storage channelStorage = getChannelStorage()[msg_.portId][msg_.channelId]; + Channel.Data storage channel = channelStorage.channel; if (channel.state != Channel.State.STATE_FLUSHCOMPLETE) { revert IBCChannelUpgradeNotFlushcomplete(channel.state); } // get connection for proof verification - ConnectionEnd.Data storage connection = connections[channel.connection_hops[0]]; + ConnectionEnd.Data storage connection = getConnectionStorage()[channel.connection_hops[0]].connection; Channel.Data memory counterpartyChannel; // counterparty must be in OPEN or FLUSHCOMPLETE state if (msg_.counterpartyChannelState == Channel.State.STATE_OPEN) { - Upgrade.Data storage upgrade = upgrades[msg_.portId][msg_.channelId]; + Upgrade.Data storage upgrade = channelStorage.upgrade; // get the counterparty's connection hops for the proposed upgrade connection - ConnectionEnd.Data storage proposedConnection = connections[upgrade.fields.connection_hops[0]]; + ConnectionEnd.Data storage proposedConnection = + getConnectionStorage()[upgrade.fields.connection_hops[0]].connection; // The counterparty upgrade sequence must be greater than or equal to // the channel upgrade sequence. It should normally be equivalent, but // in the unlikely case that a new upgrade is initiated after it reopens, @@ -726,12 +735,13 @@ contract IBCChannelUpgradeConfirmOpenTimeoutCancel is * @dev See {IIBCChannelUpgrade-cancelChannelUpgrade} */ function cancelChannelUpgrade(MsgCancelChannelUpgrade calldata msg_) public override { + ChannelStorage storage channelStorage = getChannelStorage()[msg_.portId][msg_.channelId]; // current channel has an upgrade stored - Upgrade.Data storage upgrade = upgrades[msg_.portId][msg_.channelId]; + Upgrade.Data storage upgrade = channelStorage.upgrade; if (upgrade.fields.ordering == Channel.Order.ORDER_NONE_UNSPECIFIED) { revert IBCChannelUpgradeNoExistingUpgrade(); } - Channel.Data storage channel = channels[msg_.portId][msg_.channelId]; + Channel.Data storage channel = channelStorage.channel; // if the msgSender is authorized to make and cancel upgrades AND // the current channel has not already reached FLUSHCOMPLETE, // then we can restore immediately without any additional checks @@ -768,7 +778,7 @@ contract IBCChannelUpgradeConfirmOpenTimeoutCancel is } // verify that the provided error receipt is written to the upgradeError path with the counterparty sequence - ConnectionEnd.Data storage connection = connections[channel.connection_hops[0]]; + ConnectionEnd.Data storage connection = getConnectionStorage()[channel.connection_hops[0]].connection; verifyMembership( connection, msg_.proofHeight, @@ -785,12 +795,13 @@ contract IBCChannelUpgradeConfirmOpenTimeoutCancel is * @dev See {IIBCChannelUpgrade-timeoutChannelUpgrade} */ function timeoutChannelUpgrade(MsgTimeoutChannelUpgrade calldata msg_) public override { + ChannelStorage storage channelStorage = getChannelStorage()[msg_.portId][msg_.channelId]; // current channel must have an upgrade that is FLUSHING or FLUSHCOMPLETE - Upgrade.Data storage upgrade = upgrades[msg_.portId][msg_.channelId]; + Upgrade.Data storage upgrade = channelStorage.upgrade; if (upgrade.fields.ordering == Channel.Order.ORDER_NONE_UNSPECIFIED) { revert IBCChannelUpgradeNoExistingUpgrade(); } - Channel.Data storage channel = channels[msg_.portId][msg_.channelId]; + Channel.Data storage channel = channelStorage.channel; if (channel.state != Channel.State.STATE_FLUSHING && channel.state != Channel.State.STATE_FLUSHCOMPLETE) { revert IBCChannelUpgradeTimeoutUnallowedState(); } @@ -807,10 +818,10 @@ contract IBCChannelUpgradeConfirmOpenTimeoutCancel is } // if timeoutTimestamp is defined then the consensus time // from proof height must be greater than timeout timestamp - ConnectionEnd.Data storage connection = connections[channel.connection_hops[0]]; + ConnectionEnd.Data storage connection = getConnectionStorage()[channel.connection_hops[0]].connection; if ( upgrade.timeout.timestamp != 0 - && ILightClient(clientImpls[connection.client_id]).getTimestampAtHeight( + && ILightClient(getClientStorage()[connection.client_id].clientImpl).getTimestampAtHeight( connection.client_id, msg_.proofHeight ) < upgrade.timeout.timestamp ) { @@ -826,7 +837,8 @@ contract IBCChannelUpgradeConfirmOpenTimeoutCancel is // only if the counterparty has successfully completed upgrade if (msg_.counterpartyChannel.state == Channel.State.STATE_OPEN) { // counterparty should have upgraded to `upgrade` parameters - ConnectionEnd.Data storage proposedConnection = connections[upgrade.fields.connection_hops[0]]; + ConnectionEnd.Data storage proposedConnection = + getConnectionStorage()[upgrade.fields.connection_hops[0]].connection; // check that the channel did not upgrade successfully require(msg_.counterpartyChannel.connection_hops.length == 1); if ( diff --git a/contracts/core/24-host/IBCCommitment.sol b/contracts/core/24-host/IBCCommitment.sol index 99b3965d..865c42a0 100644 --- a/contracts/core/24-host/IBCCommitment.sol +++ b/contracts/core/24-host/IBCCommitment.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.20; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; library IBCCommitment { - // Commitment path generators that comply with https://github.com/cosmos/ibc/tree/main/spec/core/ics-024-host-requirements#path-space + // Commitment paths comply with https://github.com/cosmos/ibc/tree/main/spec/core/ics-024-host-requirements#path-space function clientStatePath(string memory clientId) internal pure returns (bytes memory) { return abi.encodePacked("clients/", clientId, "/clientState"); diff --git a/contracts/core/24-host/IBCHost.sol b/contracts/core/24-host/IBCHost.sol index dd7e98d1..7f2c57b8 100644 --- a/contracts/core/24-host/IBCHost.sol +++ b/contracts/core/24-host/IBCHost.sol @@ -2,10 +2,11 @@ pragma solidity ^0.8.20; import {ILightClient} from "../02-client/ILightClient.sol"; -import {IBCStore} from "../24-host/IBCStore.sol"; +import {IIBCClientErrors} from "../02-client/IIBCClientErrors.sol"; +import {IBCStore} from "./IBCStore.sol"; import {IIBCHostErrors} from "./IIBCHostErrors.sol"; -contract IBCHost is IIBCHostErrors, IBCStore { +contract IBCHost is IBCStore, IIBCHostErrors { // It represents the prefix of the commitment proof(https://github.com/cosmos/ibc/tree/main/spec/core/ics-023-vector-commitments#prefix). // In ibc-solidity, the prefix is not required, but for compatibility with ibc-go this must be a non-empty value. bytes internal constant DEFAULT_COMMITMENT_PREFIX = bytes("ibc"); @@ -17,21 +18,21 @@ contract IBCHost is IIBCHostErrors, IBCStore { return uint64(block.timestamp) * 1e9; } - /** - * @dev _getCommitmentPrefix returns the prefix of the commitment proof. - */ - function _getCommitmentPrefix() internal view virtual returns (bytes memory) { - return DEFAULT_COMMITMENT_PREFIX; - } - /** * @dev checkAndGetClient returns the client implementation for the given client ID. */ function checkAndGetClient(string memory clientId) internal view returns (ILightClient) { - address clientImpl = clientImpls[clientId]; + address clientImpl = getClientStorage()[clientId].clientImpl; if (clientImpl == address(0)) { - revert IBCHostClientNotFound(clientId); + revert IIBCClientErrors.IBCClientClientNotFound(clientId); } return ILightClient(clientImpl); } + + /** + * @dev _getCommitmentPrefix returns the prefix of the commitment proof. + */ + function _getCommitmentPrefix() internal view virtual returns (bytes memory) { + return DEFAULT_COMMITMENT_PREFIX; + } } diff --git a/contracts/core/24-host/IBCHostConfigurator.sol b/contracts/core/24-host/IBCHostConfigurator.sol index 2984e491..211541ec 100644 --- a/contracts/core/24-host/IBCHostConfigurator.sol +++ b/contracts/core/24-host/IBCHostConfigurator.sol @@ -14,19 +14,20 @@ import {IIBCHostConfigurator} from "./IIBCHostConfigurator.sol"; */ abstract contract IBCHostConfigurator is IIBCHostConfigurator, IBCModuleManager { function _setExpectedTimePerBlock(uint64 expectedTimePerBlock_) internal virtual { - expectedTimePerBlock = expectedTimePerBlock_; + getHostStorage().expectedTimePerBlock = expectedTimePerBlock_; } function _registerClient(string calldata clientType, ILightClient client) internal virtual { + HostStorage storage hostStorage = getHostStorage(); if (!IBCClientLib.validateClientType(bytes(clientType))) { revert IBCHostInvalidClientType(clientType); - } else if (address(clientRegistry[clientType]) != address(0)) { + } else if (address(hostStorage.clientRegistry[clientType]) != address(0)) { revert IBCHostClientTypeAlreadyExists(clientType); } if (address(client) == address(0) || address(client) == address(this)) { revert IBCHostInvalidLightClientAddress(address(client)); } - clientRegistry[clientType] = address(client); + hostStorage.clientRegistry[clientType] = address(client); } function _bindPort(string calldata portId, IIBCModule module) internal virtual { diff --git a/contracts/core/24-host/IBCStore.sol b/contracts/core/24-host/IBCStore.sol index 9a2fbac4..b6bc178c 100644 --- a/contracts/core/24-host/IBCStore.sol +++ b/contracts/core/24-host/IBCStore.sol @@ -5,37 +5,116 @@ import {ConnectionEnd} from "../../proto/Connection.sol"; import {Channel, Upgrade} from "../../proto/Channel.sol"; abstract contract IBCStore { + // keccak256(abi.encode(uint256(keccak256("ibc.commitment")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 internal constant COMMITMENT_STORAGE_LOCATION = + 0x1ee222554989dda120e26ecacf756fe1235cd8d726706b57517715dde4f0c900; + + // keccak256(abi.encode(uint256(keccak256("ibc.host")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 internal constant HOST_STORAGE_LOCATION = 0x74277c96171a830beeb656543654929b9b37cec88976b4c31924799951550500; + + // keccak256(abi.encode(uint256(keccak256("ibc.client")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 internal constant CLIENT_STORAGE_LOCATION = + 0x521e6acb905d37b69880078e1a941104ad5d8bcb8c5cf52f1d5f47d31739d500; + + // keccak256(abi.encode(uint256(keccak256("ibc.connection")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 internal constant CONNECTION_STORAGE_LOCATION = + 0x9ef02a9acd7179d999aa130fa65a34ac06dd2f1bae667ae0fb55000408793800; + + // keccak256(abi.encode(uint256(keccak256("ibc.channel")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 internal constant CHANNEL_STORAGE_LOCATION = + 0x1952ed347963c5b7b1856335782fc9c26716d4219254baf3dfc6b26981b2dc00; + + /// @custom:storage-location erc7201:ibc.commitment + struct CommitmentStorage { + mapping(bytes32 => bytes32) commitments; + } + + /// @custom:storage-location erc7201:ibc.host + struct HostStorage { + mapping(string => address) clientRegistry; + mapping(string => address) portCapabilities; + mapping(string => mapping(string => address)) channelCapabilities; + uint64 nextClientSequence; + uint64 nextConnectionSequence; + uint64 nextChannelSequence; + uint64 expectedTimePerBlock; + } + + /// @custom:storage-location erc7201:ibc.client + struct ClientStorage { + string clientType; + address clientImpl; + } + + /// @custom:storage-location erc7201:ibc.connection + struct ConnectionStorage { + ConnectionEnd.Data connection; + } + struct RecvStartSequence { uint64 sequence; uint64 prevSequence; } - // Commitments - // keccak256(IBC-compatible-store-path) => keccak256(IBC-compatible-commitment) - mapping(bytes32 => bytes32) internal commitments; - - // Store - mapping(string => address) internal clientRegistry; // clientType => clientImpl - mapping(string => string) internal clientTypes; // clientID => clientType - mapping(string => address) internal clientImpls; // clientID => clientImpl - mapping(string => ConnectionEnd.Data) internal connections; - mapping(string => mapping(string => Channel.Data)) internal channels; - mapping(string => mapping(string => uint64)) internal nextSequenceSends; - mapping(string => mapping(string => uint64)) internal nextSequenceRecvs; - mapping(string => mapping(string => uint64)) internal nextSequenceAcks; - mapping(string => address) internal portCapabilities; - mapping(string => mapping(string => address)) internal channelCapabilities; - - mapping(string => mapping(string => Upgrade.Data)) internal upgrades; - mapping(string => mapping(string => uint64)) internal latestErrorReceiptSequences; - mapping(string => mapping(string => RecvStartSequence)) internal recvStartSequences; - mapping(string => mapping(string => uint64)) internal ackStartSequences; - - // Host parameters - uint64 internal expectedTimePerBlock; - - // Sequences for identifier - uint64 internal nextClientSequence; - uint64 internal nextConnectionSequence; - uint64 internal nextChannelSequence; + /// @custom:storage-location erc7201:ibc.channel + struct ChannelStorage { + Channel.Data channel; + uint64 nextSequenceSend; + uint64 nextSequenceRecv; + uint64 nextSequenceAck; + Upgrade.Data upgrade; + uint64 latestErrorReceiptSequence; + RecvStartSequence recvStartSequence; + uint64 ackStartSequence; + } + + /** + * @dev getCommitments returns the commitment storage + */ + function getCommitments() internal pure returns (mapping(bytes32 => bytes32) storage $) { + assembly { + // this is safe because first field of CommitmentStorage is a commitments mapping + $.slot := COMMITMENT_STORAGE_LOCATION + } + } + + /** + * @dev getHostStorage returns the host storage + */ + function getHostStorage() internal pure returns (HostStorage storage $) { + assembly { + $.slot := HOST_STORAGE_LOCATION + } + } + + /** + * @dev getClientStorage returns the client storage + */ + function getClientStorage() internal pure returns (mapping(string => ClientStorage) storage $) { + assembly { + $.slot := CLIENT_STORAGE_LOCATION + } + } + + /** + * @dev getConnectionStorage returns the connection storage + */ + function getConnectionStorage() internal pure returns (mapping(string => ConnectionStorage) storage $) { + assembly { + $.slot := CONNECTION_STORAGE_LOCATION + } + } + + /** + * @dev getChannelStorage returns the channel storage + */ + function getChannelStorage() + internal + pure + returns (mapping(string => mapping(string => ChannelStorage)) storage $) + { + assembly { + $.slot := CHANNEL_STORAGE_LOCATION + } + } } diff --git a/contracts/core/24-host/IIBCHostErrors.sol b/contracts/core/24-host/IIBCHostErrors.sol index 7a223bb9..6c0f7cd9 100644 --- a/contracts/core/24-host/IIBCHostErrors.sol +++ b/contracts/core/24-host/IIBCHostErrors.sol @@ -8,9 +8,6 @@ interface IIBCHostErrors { /// @param clientType client type error IBCHostClientTypeAlreadyExists(string clientType); - /// @param clientId the client identifier - error IBCHostClientNotFound(string clientId); - /// @param portId port identifier error IBCHostInvalidPortIdentifier(string portId); diff --git a/contracts/core/25-handler/IBCQuerier.sol b/contracts/core/25-handler/IBCQuerier.sol index e9a77fd1..6401f254 100644 --- a/contracts/core/25-handler/IBCQuerier.sol +++ b/contracts/core/25-handler/IBCQuerier.sol @@ -15,12 +15,16 @@ contract IBCQuerier is IBCModuleManager, IIBCQuerier { return _getCommitmentPrefix(); } + function getCommitmentsSlot() public pure override returns (bytes32) { + return COMMITMENT_STORAGE_LOCATION; + } + function getCommitment(bytes32 hashedPath) public view override returns (bytes32) { - return commitments[hashedPath]; + return getCommitments()[hashedPath]; } function getExpectedTimePerBlock() public view override returns (uint64) { - return expectedTimePerBlock; + return getHostStorage().expectedTimePerBlock; } function getIBCModuleByPort(string calldata portId) public view override returns (IIBCModule) { @@ -37,15 +41,15 @@ contract IBCQuerier is IBCModuleManager, IIBCQuerier { } function getClientByType(string calldata clientType) public view override returns (address) { - return clientRegistry[clientType]; + return getHostStorage().clientRegistry[clientType]; } function getClientType(string calldata clientId) public view override returns (string memory) { - return clientTypes[clientId]; + return getClientStorage()[clientId].clientType; } function getClient(string calldata clientId) public view override returns (address) { - return clientImpls[clientId]; + return getClientStorage()[clientId].clientImpl; } function getClientState(string calldata clientId) public view override returns (bytes memory, bool) { @@ -67,7 +71,7 @@ contract IBCQuerier is IBCModuleManager, IIBCQuerier { override returns (ConnectionEnd.Data memory, bool) { - ConnectionEnd.Data storage connection = connections[connectionId]; + ConnectionEnd.Data storage connection = getConnectionStorage()[connectionId].connection; return (connection, connection.state != ConnectionEnd.State.STATE_UNINITIALIZED_UNSPECIFIED); } @@ -77,7 +81,7 @@ contract IBCQuerier is IBCModuleManager, IIBCQuerier { override returns (Channel.Data memory, bool) { - Channel.Data storage channel = channels[portId][channelId]; + Channel.Data storage channel = getChannelStorage()[portId][channelId].channel; return (channel, channel.state != Channel.State.STATE_UNINITIALIZED_UNSPECIFIED); } @@ -87,7 +91,7 @@ contract IBCQuerier is IBCModuleManager, IIBCQuerier { override returns (uint64) { - return nextSequenceSends[portId][channelId]; + return getChannelStorage()[portId][channelId].nextSequenceSend; } function getNextSequenceRecv(string calldata portId, string calldata channelId) @@ -96,7 +100,7 @@ contract IBCQuerier is IBCModuleManager, IIBCQuerier { override returns (uint64) { - return nextSequenceRecvs[portId][channelId]; + return getChannelStorage()[portId][channelId].nextSequenceRecv; } function getNextSequenceAck(string calldata portId, string calldata channelId) @@ -105,7 +109,7 @@ contract IBCQuerier is IBCModuleManager, IIBCQuerier { override returns (uint64) { - return nextSequenceAcks[portId][channelId]; + return getChannelStorage()[portId][channelId].nextSequenceAck; } function getPacketReceipt(string calldata portId, string calldata channelId, uint64 sequence) @@ -115,7 +119,7 @@ contract IBCQuerier is IBCModuleManager, IIBCQuerier { returns (IBCChannelLib.PacketReceipt) { return IBCChannelLib.receiptCommitmentToReceipt( - commitments[IBCCommitment.packetReceiptCommitmentKeyCalldata(portId, channelId, sequence)] + getCommitments()[IBCCommitment.packetReceiptCommitmentKeyCalldata(portId, channelId, sequence)] ); } @@ -125,7 +129,7 @@ contract IBCQuerier is IBCModuleManager, IIBCQuerier { override returns (Upgrade.Data memory, bool) { - Upgrade.Data storage upgrade = upgrades[portId][channelId]; + Upgrade.Data storage upgrade = getChannelStorage()[portId][channelId].upgrade; return (upgrade, upgrade.fields.connection_hops.length != 0); } @@ -135,7 +139,7 @@ contract IBCQuerier is IBCModuleManager, IIBCQuerier { override returns (bool) { - Channel.Data storage channel = channels[portId][channelId]; + Channel.Data storage channel = getChannelStorage()[portId][channelId].channel; if (channel.state != Channel.State.STATE_FLUSHING) { return false; } diff --git a/contracts/core/25-handler/IIBCQuerier.sol b/contracts/core/25-handler/IIBCQuerier.sol index a8444eca..583cd3e9 100644 --- a/contracts/core/25-handler/IIBCQuerier.sol +++ b/contracts/core/25-handler/IIBCQuerier.sol @@ -10,6 +10,8 @@ import {IIBCModule} from "../26-router/IIBCModule.sol"; interface IIBCQuerier { function getCommitmentPrefix() external view returns (bytes memory); + function getCommitmentsSlot() external pure returns (bytes32); + function getCommitment(bytes32 hashedPath) external view returns (bytes32); function getExpectedTimePerBlock() external view returns (uint64); diff --git a/contracts/core/26-router/IBCModuleManager.sol b/contracts/core/26-router/IBCModuleManager.sol index 9de4ead2..3eb969db 100644 --- a/contracts/core/26-router/IBCModuleManager.sol +++ b/contracts/core/26-router/IBCModuleManager.sol @@ -15,20 +15,22 @@ contract IBCModuleManager is IBCHost, Context { * @dev claimPortCapability allows the IBC app module to claim a capability that core IBC passes to it */ function claimPortCapability(string calldata portId, address addr) internal { - if (portCapabilities[portId] != address(0)) { + HostStorage storage hostStorage = getHostStorage(); + if (hostStorage.portCapabilities[portId] != address(0)) { revert IBCHostPortCapabilityAlreadyClaimed(portId); } - portCapabilities[portId] = addr; + hostStorage.portCapabilities[portId] = addr; } /** * @dev claimChannelCapability allows the IBC app module to claim a capability that core IBC passes to it */ function claimChannelCapability(string calldata portId, string memory channelId, address addr) internal { - if (channelCapabilities[portId][channelId] != address(0)) { + HostStorage storage hostStorage = getHostStorage(); + if (hostStorage.channelCapabilities[portId][channelId] != address(0)) { revert IBCHostChannelCapabilityAlreadyClaimed(portId, channelId); } - channelCapabilities[portId][channelId] = addr; + hostStorage.channelCapabilities[portId][channelId] = addr; } /** @@ -37,7 +39,7 @@ contract IBCModuleManager is IBCHost, Context { */ function authenticateChannelCapability(string calldata portId, string calldata channelId) internal view { address msgSender = _msgSender(); - if (channelCapabilities[portId][channelId] != msgSender) { + if (getHostStorage().channelCapabilities[portId][channelId] != msgSender) { revert IBCHostFailedAuthenticateChannelCapability(portId, channelId, msgSender); } } @@ -47,7 +49,7 @@ contract IBCModuleManager is IBCHost, Context { * If the module is not found, it will revert */ function lookupModuleByPort(string calldata portId) internal view virtual returns (IIBCModule) { - address module = portCapabilities[portId]; + address module = getHostStorage().portCapabilities[portId]; if (module == address(0)) { revert IBCHostModulePortNotFound(portId); } @@ -64,7 +66,7 @@ contract IBCModuleManager is IBCHost, Context { virtual returns (IIBCModule) { - address module = channelCapabilities[portId][channelId]; + address module = getHostStorage().channelCapabilities[portId][channelId]; if (module == address(0)) { revert IBCHostModuleChannelNotFound(portId, channelId); } @@ -104,7 +106,8 @@ contract IBCModuleManager is IBCHost, Context { uint64 upgradeSequence ) internal view virtual returns (bool) { if (ordering == Channel.Order.ORDER_ORDERED) { - if (nextSequenceSends[portId][channelId] == nextSequenceAcks[portId][channelId]) { + ChannelStorage storage channelStorage = getChannelStorage()[portId][channelId]; + if (channelStorage.nextSequenceSend == channelStorage.nextSequenceAck) { return true; } } diff --git a/pkg/contract/ibchandler/ibchandler.go b/pkg/contract/ibchandler/ibchandler.go index 97faebb7..b6125ff6 100644 --- a/pkg/contract/ibchandler/ibchandler.go +++ b/pkg/contract/ibchandler/ibchandler.go @@ -324,7 +324,7 @@ type VersionData struct { // IbchandlerMetaData contains all meta data concerning the Ibchandler contract. var IbchandlerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"acknowledgePacket\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelAcknowledgePacket.MsgPacketAcknowledgement\",\"components\":[{\"name\":\"packet\",\"type\":\"tuple\",\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"acknowledgement\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bindPort\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"moduleAddress\",\"type\":\"address\",\"internalType\":\"contractIIBCModule\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cancelChannelUpgrade\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.MsgCancelChannelUpgrade\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"errorReceipt\",\"type\":\"tuple\",\"internalType\":\"structErrorReceipt.Data\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"message\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"proofUpgradeError\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelCloseConfirm\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelHandshake.MsgChannelCloseConfirm\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"proofInit\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelCloseInit\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelHandshake.MsgChannelCloseInit\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelOpenAck\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelHandshake.MsgChannelOpenAck\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterpartyVersion\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterpartyChannelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"proofTry\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelOpenConfirm\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelHandshake.MsgChannelOpenConfirm\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"proofAck\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelOpenInit\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelHandshake.MsgChannelOpenInit\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channel\",\"type\":\"tuple\",\"internalType\":\"structChannel.Data\",\"components\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"},{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"counterparty\",\"type\":\"tuple\",\"internalType\":\"structChannelCounterparty.Data\",\"components\":[{\"name\":\"port_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channel_id\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"upgrade_sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelOpenTry\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelHandshake.MsgChannelOpenTry\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channel\",\"type\":\"tuple\",\"internalType\":\"structChannel.Data\",\"components\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"},{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"counterparty\",\"type\":\"tuple\",\"internalType\":\"structChannelCounterparty.Data\",\"components\":[{\"name\":\"port_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channel_id\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"upgrade_sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"counterpartyVersion\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"proofInit\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelUpgradeAck\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.MsgChannelUpgradeAck\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterpartyUpgrade\",\"type\":\"tuple\",\"internalType\":\"structUpgrade.Data\",\"components\":[{\"name\":\"fields\",\"type\":\"tuple\",\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"timeout\",\"type\":\"tuple\",\"internalType\":\"structTimeout.Data\",\"components\":[{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"next_sequence_send\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"proofs\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.ChannelUpgradeProofs\",\"components\":[{\"name\":\"proofChannel\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofUpgrade\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelUpgradeConfirm\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.MsgChannelUpgradeConfirm\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterpartyChannelState\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"},{\"name\":\"counterpartyUpgrade\",\"type\":\"tuple\",\"internalType\":\"structUpgrade.Data\",\"components\":[{\"name\":\"fields\",\"type\":\"tuple\",\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"timeout\",\"type\":\"tuple\",\"internalType\":\"structTimeout.Data\",\"components\":[{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"next_sequence_send\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"proofs\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.ChannelUpgradeProofs\",\"components\":[{\"name\":\"proofChannel\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofUpgrade\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelUpgradeInit\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.MsgChannelUpgradeInit\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"proposedUpgradeFields\",\"type\":\"tuple\",\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelUpgradeOpen\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.MsgChannelUpgradeOpen\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterpartyChannelState\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"},{\"name\":\"counterpartyUpgradeSequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"proofChannel\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelUpgradeTry\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.MsgChannelUpgradeTry\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterpartyUpgradeSequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"counterpartyUpgradeFields\",\"type\":\"tuple\",\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"proposedConnectionHops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"proofs\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.ChannelUpgradeProofs\",\"components\":[{\"name\":\"proofChannel\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofUpgrade\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"connectionOpenAck\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCConnection.MsgConnectionOpenAck\",\"components\":[{\"name\":\"connectionId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"clientStateBytes\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"version\",\"type\":\"tuple\",\"internalType\":\"structVersion.Data\",\"components\":[{\"name\":\"identifier\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"features\",\"type\":\"string[]\",\"internalType\":\"string[]\"}]},{\"name\":\"counterpartyConnectionId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"proofTry\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofClient\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofConsensus\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"consensusHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"hostConsensusStateProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"connectionOpenConfirm\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCConnection.MsgConnectionOpenConfirm\",\"components\":[{\"name\":\"connectionId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"proofAck\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"connectionOpenInit\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCConnection.MsgConnectionOpenInit\",\"components\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterparty\",\"type\":\"tuple\",\"internalType\":\"structCounterparty.Data\",\"components\":[{\"name\":\"client_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"connection_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"prefix\",\"type\":\"tuple\",\"internalType\":\"structMerklePrefix.Data\",\"components\":[{\"name\":\"key_prefix\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"version\",\"type\":\"tuple\",\"internalType\":\"structVersion.Data\",\"components\":[{\"name\":\"identifier\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"features\",\"type\":\"string[]\",\"internalType\":\"string[]\"}]},{\"name\":\"delayPeriod\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"connectionOpenTry\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCConnection.MsgConnectionOpenTry\",\"components\":[{\"name\":\"counterparty\",\"type\":\"tuple\",\"internalType\":\"structCounterparty.Data\",\"components\":[{\"name\":\"client_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"connection_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"prefix\",\"type\":\"tuple\",\"internalType\":\"structMerklePrefix.Data\",\"components\":[{\"name\":\"key_prefix\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"delayPeriod\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"clientStateBytes\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"counterpartyVersions\",\"type\":\"tuple[]\",\"internalType\":\"structVersion.Data[]\",\"components\":[{\"name\":\"identifier\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"features\",\"type\":\"string[]\",\"internalType\":\"string[]\"}]},{\"name\":\"proofInit\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofClient\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofConsensus\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"consensusHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"hostConsensusStateProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createClient\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCClient.MsgCreateClient\",\"components\":[{\"name\":\"clientType\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"protoClientState\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"protoConsensusState\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getCanTransitionToFlushComplete\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getChannel\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structChannel.Data\",\"components\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"},{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"counterparty\",\"type\":\"tuple\",\"internalType\":\"structChannelCounterparty.Data\",\"components\":[{\"name\":\"port_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channel_id\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"upgrade_sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getChannelUpgrade\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structUpgrade.Data\",\"components\":[{\"name\":\"fields\",\"type\":\"tuple\",\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"timeout\",\"type\":\"tuple\",\"internalType\":\"structTimeout.Data\",\"components\":[{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"next_sequence_send\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getClient\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getClientByType\",\"inputs\":[{\"name\":\"clientType\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getClientState\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getClientType\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitment\",\"inputs\":[{\"name\":\"hashedPath\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitmentPrefix\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getConnection\",\"inputs\":[{\"name\":\"connectionId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structConnectionEnd.Data\",\"components\":[{\"name\":\"client_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"versions\",\"type\":\"tuple[]\",\"internalType\":\"structVersion.Data[]\",\"components\":[{\"name\":\"identifier\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"features\",\"type\":\"string[]\",\"internalType\":\"string[]\"}]},{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumConnectionEnd.State\"},{\"name\":\"counterparty\",\"type\":\"tuple\",\"internalType\":\"structCounterparty.Data\",\"components\":[{\"name\":\"client_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"connection_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"prefix\",\"type\":\"tuple\",\"internalType\":\"structMerklePrefix.Data\",\"components\":[{\"name\":\"key_prefix\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"delay_period\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getConsensusState\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[{\"name\":\"consensusStateBytes\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getExpectedTimePerBlock\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getIBCModuleByChannel\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIIBCModule\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getIBCModuleByPort\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIIBCModule\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNextSequenceAck\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNextSequenceRecv\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNextSequenceSend\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPacketReceipt\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumIBCChannelLib.PacketReceipt\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recvPacket\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelRecvPacket.MsgPacketRecv\",\"components\":[{\"name\":\"packet\",\"type\":\"tuple\",\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerClient\",\"inputs\":[{\"name\":\"clientType\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"client\",\"type\":\"address\",\"internalType\":\"contractILightClient\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"routeUpdateClient\",\"inputs\":[{\"name\":\"msg_\",\"type\":\"tuple\",\"internalType\":\"structIIBCClient.MsgUpdateClient\",\"components\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"protoClientMessage\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"sendPacket\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setExpectedTimePerBlock\",\"inputs\":[{\"name\":\"expectedTimePerBlock_\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"timeoutChannelUpgrade\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.MsgTimeoutChannelUpgrade\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterpartyChannel\",\"type\":\"tuple\",\"internalType\":\"structChannel.Data\",\"components\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"},{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"counterparty\",\"type\":\"tuple\",\"internalType\":\"structChannelCounterparty.Data\",\"components\":[{\"name\":\"port_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channel_id\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"upgrade_sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"proofChannel\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"timeoutOnClose\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelPacketTimeout.MsgTimeoutOnClose\",\"components\":[{\"name\":\"packet\",\"type\":\"tuple\",\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"proofUnreceived\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofClose\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"nextSequenceRecv\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"counterpartyUpgradeSequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"timeoutPacket\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelPacketTimeout.MsgTimeoutPacket\",\"components\":[{\"name\":\"packet\",\"type\":\"tuple\",\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"nextSequenceRecv\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateClient\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCClient.MsgUpdateClient\",\"components\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"protoClientMessage\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateClientCommitments\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structHeight.Data[]\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"wrappedRouteUpdateClient\",\"inputs\":[{\"name\":\"msg_\",\"type\":\"tuple\",\"internalType\":\"structIIBCClient.MsgUpdateClient\",\"components\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"protoClientMessage\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"writeAcknowledgement\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AcknowledgePacket\",\"inputs\":[{\"name\":\"packet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"acknowledgement\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChannelUpgradeAck\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"upgradeSequence\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"channelState\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumChannel.State\"},{\"name\":\"upgradeFields\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"timeout\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structTimeout.Data\",\"components\":[{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"nextSequenceSend\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChannelUpgradeConfirm\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"upgradeSequence\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"channelState\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumChannel.State\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChannelUpgradeInit\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"upgradeSequence\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"proposedUpgradeFields\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChannelUpgradeOpen\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"upgradeSequence\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChannelUpgradeTry\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"upgradeSequence\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"upgradeFields\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"timeout\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structTimeout.Data\",\"components\":[{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"nextSequenceSend\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"GeneratedChannelIdentifier\",\"inputs\":[{\"name\":\"channelId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"GeneratedClientIdentifier\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"GeneratedConnectionIdentifier\",\"inputs\":[{\"name\":\"connectionId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RecvPacket\",\"inputs\":[{\"name\":\"packet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SendPacket\",\"inputs\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"data\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TimeoutPacket\",\"inputs\":[{\"name\":\"packet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WriteAcknowledgement\",\"inputs\":[{\"name\":\"destinationPortId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"sequence\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"acknowledgement\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WriteErrorReceipt\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"upgradeSequence\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"message\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"IBCChannelAckAlreadyProcessedInPreviousUpgrade\",\"inputs\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"ackStartSequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelAcknowledgementAlreadyWritten\",\"inputs\":[{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelCannotRecvNextUpgradePacket\",\"inputs\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"counterpartyNextSequenceSend\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelChannelNotFound\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCChannelConnectionFeatureNotSupported\",\"inputs\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"}]},{\"type\":\"error\",\"name\":\"IBCChannelConnectionMultipleVersionsFound\",\"inputs\":[{\"name\":\"connectionId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"IBCChannelConnectionNotOpened\",\"inputs\":[{\"name\":\"connectionId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCChannelCounterpartyChannelIdNotEmpty\",\"inputs\":[{\"name\":\"counterpartyChannelId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCChannelEmptyAcknowledgement\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelFailedVerifyChannelState\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCChannelFailedVerifyNextSequenceRecv\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"nextSequenceRecv\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCChannelFailedVerifyPacketAcknowledgement\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCChannelFailedVerifyPacketCommitment\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCChannelFailedVerifyPacketReceiptAbsence\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCChannelInvalidConnectionHopsLength\",\"inputs\":[{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"IBCChannelPacketAlreadyProcessInPreviousUpgrade\",\"inputs\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"recvStartSequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelPacketCommitmentMismatch\",\"inputs\":[{\"name\":\"expected\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"actual\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"IBCChannelPacketCommitmentNotFound\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelPacketMaybeAlreadyReceived\",\"inputs\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"nextSequenceRecv\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelPacketReceiptAlreadyExists\",\"inputs\":[{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelPastPacketTimeoutHeight\",\"inputs\":[{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"latestHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCChannelPastPacketTimeoutTimestamp\",\"inputs\":[{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"latestTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelTimeoutNotReached\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelTimeoutPacketHeight\",\"inputs\":[{\"name\":\"currentBlockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"timeoutHeight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelTimeoutPacketTimestamp\",\"inputs\":[{\"name\":\"currentTimestamp\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUnexpectedChannelState\",\"inputs\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUnexpectedNextSequenceAck\",\"inputs\":[{\"name\":\"expected\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUnexpectedNextSequenceRecv\",\"inputs\":[{\"name\":\"expected\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUnexpectedPacketDestination\",\"inputs\":[{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUnexpectedPacketSource\",\"inputs\":[{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUnknownChannelOrder\",\"inputs\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUnknownPacketReceiptCommitment\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeCounterpartyAlreadyFlushCompleted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeCounterpartyAlreadyUpgraded\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeCounterpartyNotFlushingOrFlushcomplete\",\"inputs\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeCounterpartyNotOpenOrFlushcomplete\",\"inputs\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeErrorReceiptEmpty\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeFailedVerifyMembership\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeIncompatibleProposal\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeInvalidErrorReceiptSequence\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeInvalidTimeout\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeInvalidUpgradeFields\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeNoChanges\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeNoExistingUpgrade\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeNotFlushcomplete\",\"inputs\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeNotFlushing\",\"inputs\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeNotOpenOrFlushing\",\"inputs\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeOldCounterpartyUpgradeSequence\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeOldErrorReceiptSequence\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeTimeoutHeightNotReached\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeTimeoutTimestampNotReached\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeTimeoutUnallowedState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeTryProposedConnectionHopsEmpty\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeTryProposedConnectionHopsMismatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeUnauthorizedChannelUpgrader\",\"inputs\":[{\"name\":\"upgrader\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeUnsupportedOrdering\",\"inputs\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeWriteOldErrorReceiptSequence\",\"inputs\":[{\"name\":\"latestSequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelZeroPacketTimeout\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCClientClientNotFound\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCClientConsensusStateNotFound\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"consensusHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCClientFailedUpdateClient\",\"inputs\":[{\"name\":\"selector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"args\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"IBCClientNotActiveClient\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCClientUnregisteredClientType\",\"inputs\":[{\"name\":\"clientType\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCConnectionAlreadyConnectionExists\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCConnectionEmptyConnectionCounterpartyVersions\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCConnectionFailedVerifyClientConsensusState\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCConnectionFailedVerifyClientState\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCConnectionFailedVerifyConnectionState\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCConnectionIBCVersionNotSupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCConnectionInvalidCounterpartyConnectionIdentifier\",\"inputs\":[{\"name\":\"counterpartyConnectionId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCConnectionInvalidHostConsensusStateProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCConnectionInvalidSelfClientState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCConnectionNoMatchingVersionFound\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCConnectionUnexpectedConnectionState\",\"inputs\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumConnectionEnd.State\"}]},{\"type\":\"error\",\"name\":\"IBCConnectionVersionsAlreadySet\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCHostChannelCapabilityAlreadyClaimed\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCHostClientNotFound\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCHostClientTypeAlreadyExists\",\"inputs\":[{\"name\":\"clientType\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCHostFailedAuthenticateChannelCapability\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"caller\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"IBCHostInvalidClientType\",\"inputs\":[{\"name\":\"clientType\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCHostInvalidLightClientAddress\",\"inputs\":[{\"name\":\"lcAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"IBCHostInvalidModuleAddress\",\"inputs\":[{\"name\":\"moduleAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"IBCHostInvalidPortIdentifier\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCHostModuleChannelNotFound\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCHostModuleDoesNotSupportERC165\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCHostModuleDoesNotSupportIIBCModule\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}]},{\"type\":\"error\",\"name\":\"IBCHostModuleDoesNotSupportIIBCModuleUpgrade\",\"inputs\":[{\"name\":\"module\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"IBCHostModulePortNotFound\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCHostPortCapabilityAlreadyClaimed\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"}]}]", + ABI: "[{\"type\":\"function\",\"name\":\"acknowledgePacket\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelAcknowledgePacket.MsgPacketAcknowledgement\",\"components\":[{\"name\":\"packet\",\"type\":\"tuple\",\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"acknowledgement\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"bindPort\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"moduleAddress\",\"type\":\"address\",\"internalType\":\"contractIIBCModule\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cancelChannelUpgrade\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.MsgCancelChannelUpgrade\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"errorReceipt\",\"type\":\"tuple\",\"internalType\":\"structErrorReceipt.Data\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"message\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"proofUpgradeError\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelCloseConfirm\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelHandshake.MsgChannelCloseConfirm\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"proofInit\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelCloseInit\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelHandshake.MsgChannelCloseInit\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelOpenAck\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelHandshake.MsgChannelOpenAck\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterpartyVersion\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterpartyChannelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"proofTry\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelOpenConfirm\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelHandshake.MsgChannelOpenConfirm\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"proofAck\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelOpenInit\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelHandshake.MsgChannelOpenInit\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channel\",\"type\":\"tuple\",\"internalType\":\"structChannel.Data\",\"components\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"},{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"counterparty\",\"type\":\"tuple\",\"internalType\":\"structChannelCounterparty.Data\",\"components\":[{\"name\":\"port_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channel_id\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"upgrade_sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelOpenTry\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelHandshake.MsgChannelOpenTry\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channel\",\"type\":\"tuple\",\"internalType\":\"structChannel.Data\",\"components\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"},{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"counterparty\",\"type\":\"tuple\",\"internalType\":\"structChannelCounterparty.Data\",\"components\":[{\"name\":\"port_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channel_id\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"upgrade_sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"counterpartyVersion\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"proofInit\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelUpgradeAck\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.MsgChannelUpgradeAck\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterpartyUpgrade\",\"type\":\"tuple\",\"internalType\":\"structUpgrade.Data\",\"components\":[{\"name\":\"fields\",\"type\":\"tuple\",\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"timeout\",\"type\":\"tuple\",\"internalType\":\"structTimeout.Data\",\"components\":[{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"next_sequence_send\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"proofs\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.ChannelUpgradeProofs\",\"components\":[{\"name\":\"proofChannel\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofUpgrade\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelUpgradeConfirm\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.MsgChannelUpgradeConfirm\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterpartyChannelState\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"},{\"name\":\"counterpartyUpgrade\",\"type\":\"tuple\",\"internalType\":\"structUpgrade.Data\",\"components\":[{\"name\":\"fields\",\"type\":\"tuple\",\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"timeout\",\"type\":\"tuple\",\"internalType\":\"structTimeout.Data\",\"components\":[{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"next_sequence_send\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"proofs\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.ChannelUpgradeProofs\",\"components\":[{\"name\":\"proofChannel\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofUpgrade\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelUpgradeInit\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.MsgChannelUpgradeInit\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"proposedUpgradeFields\",\"type\":\"tuple\",\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelUpgradeOpen\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.MsgChannelUpgradeOpen\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterpartyChannelState\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"},{\"name\":\"counterpartyUpgradeSequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"proofChannel\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"channelUpgradeTry\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.MsgChannelUpgradeTry\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterpartyUpgradeSequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"counterpartyUpgradeFields\",\"type\":\"tuple\",\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"proposedConnectionHops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"proofs\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.ChannelUpgradeProofs\",\"components\":[{\"name\":\"proofChannel\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofUpgrade\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"connectionOpenAck\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCConnection.MsgConnectionOpenAck\",\"components\":[{\"name\":\"connectionId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"clientStateBytes\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"version\",\"type\":\"tuple\",\"internalType\":\"structVersion.Data\",\"components\":[{\"name\":\"identifier\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"features\",\"type\":\"string[]\",\"internalType\":\"string[]\"}]},{\"name\":\"counterpartyConnectionId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"proofTry\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofClient\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofConsensus\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"consensusHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"hostConsensusStateProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"connectionOpenConfirm\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCConnection.MsgConnectionOpenConfirm\",\"components\":[{\"name\":\"connectionId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"proofAck\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"connectionOpenInit\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCConnection.MsgConnectionOpenInit\",\"components\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterparty\",\"type\":\"tuple\",\"internalType\":\"structCounterparty.Data\",\"components\":[{\"name\":\"client_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"connection_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"prefix\",\"type\":\"tuple\",\"internalType\":\"structMerklePrefix.Data\",\"components\":[{\"name\":\"key_prefix\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"version\",\"type\":\"tuple\",\"internalType\":\"structVersion.Data\",\"components\":[{\"name\":\"identifier\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"features\",\"type\":\"string[]\",\"internalType\":\"string[]\"}]},{\"name\":\"delayPeriod\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"connectionOpenTry\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCConnection.MsgConnectionOpenTry\",\"components\":[{\"name\":\"counterparty\",\"type\":\"tuple\",\"internalType\":\"structCounterparty.Data\",\"components\":[{\"name\":\"client_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"connection_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"prefix\",\"type\":\"tuple\",\"internalType\":\"structMerklePrefix.Data\",\"components\":[{\"name\":\"key_prefix\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"delayPeriod\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"clientStateBytes\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"counterpartyVersions\",\"type\":\"tuple[]\",\"internalType\":\"structVersion.Data[]\",\"components\":[{\"name\":\"identifier\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"features\",\"type\":\"string[]\",\"internalType\":\"string[]\"}]},{\"name\":\"proofInit\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofClient\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofConsensus\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"consensusHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"hostConsensusStateProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"createClient\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCClient.MsgCreateClient\",\"components\":[{\"name\":\"clientType\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"protoClientState\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"protoConsensusState\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getCanTransitionToFlushComplete\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getChannel\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structChannel.Data\",\"components\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"},{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"counterparty\",\"type\":\"tuple\",\"internalType\":\"structChannelCounterparty.Data\",\"components\":[{\"name\":\"port_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channel_id\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"upgrade_sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getChannelUpgrade\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structUpgrade.Data\",\"components\":[{\"name\":\"fields\",\"type\":\"tuple\",\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"timeout\",\"type\":\"tuple\",\"internalType\":\"structTimeout.Data\",\"components\":[{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"next_sequence_send\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getClient\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getClientByType\",\"inputs\":[{\"name\":\"clientType\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getClientState\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getClientType\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitment\",\"inputs\":[{\"name\":\"hashedPath\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitmentPrefix\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCommitmentsSlot\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getConnection\",\"inputs\":[{\"name\":\"connectionId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structConnectionEnd.Data\",\"components\":[{\"name\":\"client_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"versions\",\"type\":\"tuple[]\",\"internalType\":\"structVersion.Data[]\",\"components\":[{\"name\":\"identifier\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"features\",\"type\":\"string[]\",\"internalType\":\"string[]\"}]},{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumConnectionEnd.State\"},{\"name\":\"counterparty\",\"type\":\"tuple\",\"internalType\":\"structCounterparty.Data\",\"components\":[{\"name\":\"client_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"connection_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"prefix\",\"type\":\"tuple\",\"internalType\":\"structMerklePrefix.Data\",\"components\":[{\"name\":\"key_prefix\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"delay_period\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getConsensusState\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[{\"name\":\"consensusStateBytes\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getExpectedTimePerBlock\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getIBCModuleByChannel\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIIBCModule\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getIBCModuleByPort\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIIBCModule\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNextSequenceAck\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNextSequenceRecv\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getNextSequenceSend\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getPacketReceipt\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumIBCChannelLib.PacketReceipt\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"recvPacket\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelRecvPacket.MsgPacketRecv\",\"components\":[{\"name\":\"packet\",\"type\":\"tuple\",\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerClient\",\"inputs\":[{\"name\":\"clientType\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"client\",\"type\":\"address\",\"internalType\":\"contractILightClient\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"routeUpdateClient\",\"inputs\":[{\"name\":\"msg_\",\"type\":\"tuple\",\"internalType\":\"structIIBCClient.MsgUpdateClient\",\"components\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"protoClientMessage\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"sendPacket\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setExpectedTimePerBlock\",\"inputs\":[{\"name\":\"expectedTimePerBlock_\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"timeoutChannelUpgrade\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradeBase.MsgTimeoutChannelUpgrade\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterpartyChannel\",\"type\":\"tuple\",\"internalType\":\"structChannel.Data\",\"components\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"},{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"counterparty\",\"type\":\"tuple\",\"internalType\":\"structChannelCounterparty.Data\",\"components\":[{\"name\":\"port_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channel_id\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"upgrade_sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"proofChannel\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"timeoutOnClose\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelPacketTimeout.MsgTimeoutOnClose\",\"components\":[{\"name\":\"packet\",\"type\":\"tuple\",\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"proofUnreceived\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofClose\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"nextSequenceRecv\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"counterpartyUpgradeSequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"timeoutPacket\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelPacketTimeout.MsgTimeoutPacket\",\"components\":[{\"name\":\"packet\",\"type\":\"tuple\",\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"nextSequenceRecv\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateClient\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCClient.MsgUpdateClient\",\"components\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"protoClientMessage\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateClientCommitments\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structHeight.Data[]\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"wrappedRouteUpdateClient\",\"inputs\":[{\"name\":\"msg_\",\"type\":\"tuple\",\"internalType\":\"structIIBCClient.MsgUpdateClient\",\"components\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"protoClientMessage\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"writeAcknowledgement\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"AcknowledgePacket\",\"inputs\":[{\"name\":\"packet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"acknowledgement\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChannelUpgradeAck\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"upgradeSequence\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"channelState\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumChannel.State\"},{\"name\":\"upgradeFields\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"timeout\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structTimeout.Data\",\"components\":[{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"nextSequenceSend\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChannelUpgradeConfirm\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"upgradeSequence\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"channelState\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"enumChannel.State\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChannelUpgradeInit\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"upgradeSequence\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"proposedUpgradeFields\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChannelUpgradeOpen\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"upgradeSequence\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ChannelUpgradeTry\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"upgradeSequence\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"upgradeFields\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"timeout\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structTimeout.Data\",\"components\":[{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"nextSequenceSend\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"GeneratedChannelIdentifier\",\"inputs\":[{\"name\":\"channelId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"GeneratedClientIdentifier\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"GeneratedConnectionIdentifier\",\"inputs\":[{\"name\":\"connectionId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RecvPacket\",\"inputs\":[{\"name\":\"packet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SendPacket\",\"inputs\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"data\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TimeoutPacket\",\"inputs\":[{\"name\":\"packet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WriteAcknowledgement\",\"inputs\":[{\"name\":\"destinationPortId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"sequence\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"acknowledgement\",\"type\":\"bytes\",\"indexed\":false,\"internalType\":\"bytes\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"WriteErrorReceipt\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"upgradeSequence\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"message\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"IBCChannelAckAlreadyProcessedInPreviousUpgrade\",\"inputs\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"ackStartSequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelAcknowledgementAlreadyWritten\",\"inputs\":[{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelCannotRecvNextUpgradePacket\",\"inputs\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"counterpartyNextSequenceSend\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelChannelNotFound\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCChannelConnectionFeatureNotSupported\",\"inputs\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"}]},{\"type\":\"error\",\"name\":\"IBCChannelConnectionMultipleVersionsFound\",\"inputs\":[{\"name\":\"connectionId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"IBCChannelConnectionNotOpened\",\"inputs\":[{\"name\":\"connectionId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCChannelCounterpartyChannelIdNotEmpty\",\"inputs\":[{\"name\":\"counterpartyChannelId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCChannelEmptyAcknowledgement\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelFailedVerifyChannelState\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCChannelFailedVerifyNextSequenceRecv\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"nextSequenceRecv\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCChannelFailedVerifyPacketAcknowledgement\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCChannelFailedVerifyPacketCommitment\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"commitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCChannelFailedVerifyPacketReceiptAbsence\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCChannelInvalidConnectionHopsLength\",\"inputs\":[{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"IBCChannelPacketAlreadyProcessInPreviousUpgrade\",\"inputs\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"recvStartSequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelPacketCommitmentMismatch\",\"inputs\":[{\"name\":\"expected\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"actual\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"IBCChannelPacketCommitmentNotFound\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelPacketMaybeAlreadyReceived\",\"inputs\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"nextSequenceRecv\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelPacketReceiptAlreadyExists\",\"inputs\":[{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelPastPacketTimeoutHeight\",\"inputs\":[{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"latestHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCChannelPastPacketTimeoutTimestamp\",\"inputs\":[{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"latestTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelTimeoutNotReached\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelTimeoutPacketHeight\",\"inputs\":[{\"name\":\"currentBlockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"timeoutHeight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelTimeoutPacketTimestamp\",\"inputs\":[{\"name\":\"currentTimestamp\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUnexpectedChannelState\",\"inputs\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUnexpectedNextSequenceAck\",\"inputs\":[{\"name\":\"expected\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUnexpectedNextSequenceRecv\",\"inputs\":[{\"name\":\"expected\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUnexpectedPacketDestination\",\"inputs\":[{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUnexpectedPacketSource\",\"inputs\":[{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUnknownChannelOrder\",\"inputs\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUnknownPacketReceiptCommitment\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeCounterpartyAlreadyFlushCompleted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeCounterpartyAlreadyUpgraded\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeCounterpartyNotFlushingOrFlushcomplete\",\"inputs\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeCounterpartyNotOpenOrFlushcomplete\",\"inputs\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeErrorReceiptEmpty\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeFailedVerifyMembership\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeIncompatibleProposal\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeInvalidErrorReceiptSequence\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeInvalidTimeout\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeInvalidUpgradeFields\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeNoChanges\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeNoExistingUpgrade\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeNotFlushcomplete\",\"inputs\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeNotFlushing\",\"inputs\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeNotOpenOrFlushing\",\"inputs\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeOldCounterpartyUpgradeSequence\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeOldErrorReceiptSequence\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeTimeoutHeightNotReached\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeTimeoutTimestampNotReached\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeTimeoutUnallowedState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeTryProposedConnectionHopsEmpty\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeTryProposedConnectionHopsMismatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeUnauthorizedChannelUpgrader\",\"inputs\":[{\"name\":\"upgrader\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeUnsupportedOrdering\",\"inputs\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradeWriteOldErrorReceiptSequence\",\"inputs\":[{\"name\":\"latestSequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelZeroPacketTimeout\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCClientClientNotFound\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCClientConsensusStateNotFound\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"consensusHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCClientFailedUpdateClient\",\"inputs\":[{\"name\":\"selector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"args\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"IBCClientNotActiveClient\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCClientUnregisteredClientType\",\"inputs\":[{\"name\":\"clientType\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCConnectionAlreadyConnectionExists\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCConnectionEmptyConnectionCounterpartyVersions\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCConnectionFailedVerifyClientConsensusState\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCConnectionFailedVerifyClientState\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCConnectionFailedVerifyConnectionState\",\"inputs\":[{\"name\":\"clientId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"path\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"type\":\"error\",\"name\":\"IBCConnectionIBCVersionNotSupported\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCConnectionInvalidCounterpartyConnectionIdentifier\",\"inputs\":[{\"name\":\"counterpartyConnectionId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCConnectionInvalidHostConsensusStateProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCConnectionInvalidSelfClientState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCConnectionNoMatchingVersionFound\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCConnectionUnexpectedConnectionState\",\"inputs\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumConnectionEnd.State\"}]},{\"type\":\"error\",\"name\":\"IBCConnectionVersionsAlreadySet\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCHostChannelCapabilityAlreadyClaimed\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCHostClientTypeAlreadyExists\",\"inputs\":[{\"name\":\"clientType\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCHostFailedAuthenticateChannelCapability\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"caller\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"IBCHostInvalidClientType\",\"inputs\":[{\"name\":\"clientType\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCHostInvalidLightClientAddress\",\"inputs\":[{\"name\":\"lcAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"IBCHostInvalidModuleAddress\",\"inputs\":[{\"name\":\"moduleAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"IBCHostInvalidPortIdentifier\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCHostModuleChannelNotFound\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCHostModuleDoesNotSupportERC165\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCHostModuleDoesNotSupportIIBCModule\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}]},{\"type\":\"error\",\"name\":\"IBCHostModuleDoesNotSupportIIBCModuleUpgrade\",\"inputs\":[{\"name\":\"module\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"IBCHostModulePortNotFound\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCHostPortCapabilityAlreadyClaimed\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"}]}]", } // IbchandlerABI is the input ABI used to generate the binding from. @@ -755,6 +755,37 @@ func (_Ibchandler *IbchandlerCallerSession) GetCommitmentPrefix() ([]byte, error return _Ibchandler.Contract.GetCommitmentPrefix(&_Ibchandler.CallOpts) } +// GetCommitmentsSlot is a free data retrieval call binding the contract method 0x6ecd6d48. +// +// Solidity: function getCommitmentsSlot() pure returns(bytes32) +func (_Ibchandler *IbchandlerCaller) GetCommitmentsSlot(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _Ibchandler.contract.Call(opts, &out, "getCommitmentsSlot") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetCommitmentsSlot is a free data retrieval call binding the contract method 0x6ecd6d48. +// +// Solidity: function getCommitmentsSlot() pure returns(bytes32) +func (_Ibchandler *IbchandlerSession) GetCommitmentsSlot() ([32]byte, error) { + return _Ibchandler.Contract.GetCommitmentsSlot(&_Ibchandler.CallOpts) +} + +// GetCommitmentsSlot is a free data retrieval call binding the contract method 0x6ecd6d48. +// +// Solidity: function getCommitmentsSlot() pure returns(bytes32) +func (_Ibchandler *IbchandlerCallerSession) GetCommitmentsSlot() ([32]byte, error) { + return _Ibchandler.Contract.GetCommitmentsSlot(&_Ibchandler.CallOpts) +} + // GetConnection is a free data retrieval call binding the contract method 0x27711a69. // // Solidity: function getConnection(string connectionId) view returns((string,(string,string[])[],uint8,(string,string,(bytes)),uint64), bool) diff --git a/pkg/ibc/core/commitment/commitment.go b/pkg/ibc/core/commitment/commitment.go index bc0dc412..da6f5efd 100644 --- a/pkg/ibc/core/commitment/commitment.go +++ b/pkg/ibc/core/commitment/commitment.go @@ -1,14 +1,24 @@ package commitment import ( + "encoding/hex" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" host "github.com/cosmos/ibc-go/v8/modules/core/24-host" "github.com/ethereum/go-ethereum/crypto" ibcclient "github.com/hyperledger-labs/yui-ibc-solidity/pkg/ibc/core/client" ) -// This value is determined by IBCHost.sol -var ibcHostCommitmentSlot = [32]byte{} // uint256(0) +var IBCCommitmentsSlot [32]byte + +func init() { + ibcCommitmentsSlotStr := "1ee222554989dda120e26ecacf756fe1235cd8d726706b57517715dde4f0c900" + bz, err := hex.DecodeString(ibcCommitmentsSlotStr) + if err != nil { + panic(err) + } + copy(IBCCommitmentsSlot[:], bz) +} // Slot calculator @@ -45,5 +55,5 @@ func NextSequenceRecvCommitmentSlot(portID, channelID string) string { } func CalculateCommitmentSlot(path []byte) string { - return crypto.Keccak256Hash(crypto.Keccak256Hash(path).Bytes(), ibcHostCommitmentSlot[:]).Hex() + return crypto.Keccak256Hash(crypto.Keccak256Hash(path).Bytes(), IBCCommitmentsSlot[:]).Hex() } diff --git a/pkg/testing/chains.go b/pkg/testing/chains.go index 86ce0885..cc0f8915 100644 --- a/pkg/testing/chains.go +++ b/pkg/testing/chains.go @@ -20,7 +20,6 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" gethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" gethcrypto "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/require" @@ -206,6 +205,13 @@ func NewChain(t *testing.T, client *client.ETHClient, lc *LightClient, isAutoMin IBCMockApp: *ibcMockApp, } + commitmentsSlot, err := ibcHandler.GetCommitmentsSlot(chain.CallOpts(context.TODO(), RelayerKeyIndex)) + if err != nil { + t.Fatal(err) + } + if commitment.IBCCommitmentsSlot != commitmentsSlot { + t.Fatalf("invalid commitments slot: expected=0x%x actual=0x%x", commitment.IBCCommitmentsSlot, commitmentsSlot) + } lcAddr, err := ibcHandler.GetClientByType(chain.CallOpts(context.TODO(), RelayerKeyIndex), ibcclient.BesuQBFTClient) if err != nil { t.Fatal(err) @@ -1099,7 +1105,7 @@ func (chain *Chain) EnsurePacketCommitmentExistence( channelID string, sequence uint64, ) error { - commitment, err := chain.IBCHandler.GetCommitment(chain.CallOpts(ctx, RelayerKeyIndex), crypto.Keccak256Hash(host.PacketCommitmentKey(portID, channelID, sequence))) + commitment, err := chain.IBCHandler.GetCommitment(chain.CallOpts(ctx, RelayerKeyIndex), gethcrypto.Keccak256Hash(host.PacketCommitmentKey(portID, channelID, sequence))) if err != nil { return err } diff --git a/tests/foundry/src/helpers/TestableIBCHandler.t.sol b/tests/foundry/src/helpers/TestableIBCHandler.t.sol index 6fcd7a00..e79ae317 100644 --- a/tests/foundry/src/helpers/TestableIBCHandler.t.sol +++ b/tests/foundry/src/helpers/TestableIBCHandler.t.sol @@ -3,8 +3,10 @@ pragma solidity ^0.8.20; import "../../../../contracts/proto/Connection.sol"; import "../../../../contracts/proto/Channel.sol"; +import "../../../../contracts/core/03-connection/IBCConnectionLib.sol"; import "../../../../contracts/core/04-channel/IIBCChannel.sol"; import "../../../../contracts/core/04-channel/IBCChannelLib.sol"; +import "../../../../contracts/core/24-host/IBCHostLib.sol"; import "../../../../contracts/core/24-host/IBCCommitment.sol"; import "../../../../contracts/core/25-handler/OwnableIBCHandler.sol"; @@ -30,56 +32,57 @@ contract TestableIBCHandler is OwnableIBCHandler { {} function setConnection(string memory connectionId, ConnectionEnd.Data memory connection) external { - connections[connectionId].client_id = connection.client_id; - connections[connectionId].state = connection.state; - connections[connectionId].delay_period = connection.delay_period; - delete connections[connectionId].versions; + ConnectionEnd.Data storage conn = getConnectionStorage()[connectionId].connection; + conn.client_id = connection.client_id; + conn.state = connection.state; + conn.delay_period = connection.delay_period; + delete conn.versions; for (uint8 i = 0; i < connection.versions.length; i++) { - connections[connectionId].versions.push(connection.versions[i]); + conn.versions.push(connection.versions[i]); } - connections[connectionId].counterparty = connection.counterparty; - commitments[keccak256(IBCCommitment.connectionPath(connectionId))] = keccak256(ConnectionEnd.encode(connection)); + conn.counterparty = connection.counterparty; + getCommitments()[keccak256(IBCCommitment.connectionPath(connectionId))] = keccak256(ConnectionEnd.encode(connection)); } function setChannel(string memory portId, string memory channelId, Channel.Data memory channel) external { - channels[portId][channelId] = channel; - commitments[keccak256(IBCCommitment.channelPath(portId, channelId))] = keccak256(Channel.encode(channel)); + getChannelStorage()[portId][channelId].channel = channel; + getCommitments()[keccak256(IBCCommitment.channelPath(portId, channelId))] = keccak256(Channel.encode(channel)); } function setNextSequenceSend(string calldata portId, string calldata channelId, uint64 sequence) external { - nextSequenceSends[portId][channelId] = sequence; + getChannelStorage()[portId][channelId].nextSequenceSend = sequence; } function setNextSequenceRecv(string calldata portId, string calldata channelId, uint64 sequence) external { - nextSequenceRecvs[portId][channelId] = sequence; - commitments[keccak256(IBCCommitment.nextSequenceRecvCommitmentPath(portId, channelId))] = + getChannelStorage()[portId][channelId].nextSequenceRecv = sequence; + getCommitments()[keccak256(IBCCommitment.nextSequenceRecvCommitmentPath(portId, channelId))] = keccak256(abi.encodePacked(sequence)); } function setNextSequenceAck(string calldata portId, string calldata channelId, uint64 sequence) external { - nextSequenceAcks[portId][channelId] = sequence; + getChannelStorage()[portId][channelId].nextSequenceAck = sequence; } function setNextClientSequence(uint64 sequence) external { - nextClientSequence = sequence; + getHostStorage().nextClientSequence = sequence; } function setNextConnectionSequence(uint64 sequence) external { - nextConnectionSequence = sequence; + getHostStorage().nextConnectionSequence = sequence; } function setNextChannelSequence(uint64 sequence) external { - nextChannelSequence = sequence; + getHostStorage().nextChannelSequence = sequence; } function setPacketCommitment(string calldata portId, string calldata channelId, uint64 sequence, bytes32 commitment) external { - commitments[IBCCommitment.packetCommitmentKeyCalldata(portId, channelId, sequence)] = commitment; + getCommitments()[IBCCommitment.packetCommitmentKeyCalldata(portId, channelId, sequence)] = commitment; } function setPacketCommitment(Packet calldata packet) external { - commitments[IBCCommitment.packetCommitmentKeyCalldata(packet.sourcePort, packet.sourceChannel, packet.sequence)] + getCommitments()[IBCCommitment.packetCommitmentKeyCalldata(packet.sourcePort, packet.sourceChannel, packet.sequence)] = keccak256( abi.encodePacked( sha256( @@ -95,7 +98,7 @@ contract TestableIBCHandler is OwnableIBCHandler { } function setChannelCapability(string calldata portId, string calldata channelId, address addr) external { - channelCapabilities[portId][channelId] = addr; + getHostStorage().channelCapabilities[portId][channelId] = addr; } function getPacketCommitment(string calldata portId, string calldata channelId, uint64 sequence) @@ -112,7 +115,7 @@ contract TestableIBCHandler is OwnableIBCHandler { returns (bool) { return IBCChannelLib.receiptCommitmentToReceipt( - commitments[IBCCommitment.packetReceiptCommitmentKeyCalldata( + getCommitments()[IBCCommitment.packetReceiptCommitmentKeyCalldata( destinationPortId, destinationChannelId, sequence )] ) == IBCChannelLib.PacketReceipt.SUCCESSFUL;