diff --git a/app/app.go b/app/app.go index 2ef656b0d5..14a2cad6df 100644 --- a/app/app.go +++ b/app/app.go @@ -680,7 +680,7 @@ func New( evmS, []evmkeeper.CustomContractFn{ func(_ sdk.Context, rules ethparams.Rules) vm.PrecompiledContract { - return cronosprecompiles.NewRelayerContract(app.IBCKeeper, appCodec, rules, app.Logger()) + return cronosprecompiles.NewRelayerContract(app.IBCKeeper, app.IBCFeeKeeper, appCodec, rules, app.Logger()) }, func(ctx sdk.Context, rules ethparams.Rules) vm.PrecompiledContract { return cronosprecompiles.NewIcaContract(ctx, app.ICAControllerKeeper, &app.CronosKeeper, appCodec, gasConfig) diff --git a/integration_tests/contracts/contracts/TestRelayer.sol b/integration_tests/contracts/contracts/TestRelayer.sol index 663b02e65f..c6188a3c19 100644 --- a/integration_tests/contracts/contracts/TestRelayer.sol +++ b/integration_tests/contracts/contracts/TestRelayer.sol @@ -1,13 +1,32 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; +import {IRelayerFunctions} from "./src/RelayerFunctions.sol"; + contract TestRelayer { - address constant relayer = 0x0000000000000000000000000000000000000065; + address constant relayerContract = 0x0000000000000000000000000000000000000065; + IRelayerFunctions relayer = IRelayerFunctions(relayerContract); + address payee; + address counterpartyPayee; function batchCall(bytes[] memory payloads) public { for (uint256 i = 0; i < payloads.length; i++) { - (bool success,) = relayer.call(payloads[i]); + (bool success,) = relayerContract.call(payloads[i]); require(success); } } + + function callRegisterPayee(string calldata portID, string calldata channelID, address relayerAddr) public returns (bool) { + require(payee == address(0) || payee == msg.sender, "register fail"); + bool result = relayer.registerPayee(portID, channelID, relayerAddr); + require(result, "call failed"); + payee = msg.sender; + } + + function callRegisterCounterpartyPayee(string calldata portID, string calldata channelID, address relayerAddr) public returns (bool) { + require(counterpartyPayee == address(0) || counterpartyPayee == msg.sender, "register fail"); + bool result = relayer.registerCounterpartyPayee(portID, channelID, relayerAddr); + require(result, "call failed"); + counterpartyPayee = msg.sender; + } } diff --git a/integration_tests/ibc_utils.py b/integration_tests/ibc_utils.py index bd88269006..5da5413bf9 100644 --- a/integration_tests/ibc_utils.py +++ b/integration_tests/ibc_utils.py @@ -189,7 +189,8 @@ def prepare_network( tx = {"to": sender, "value": fund, "gasPrice": w3.eth.gas_price} send_transaction(w3, tx) assert w3.eth.get_balance(sender, "latest") == fund - caller = deploy_contract(w3, CONTRACTS["TestRelayer"], key=acc.key).address + contract = deploy_contract(w3, CONTRACTS["TestRelayer"], key=acc.key) + caller = contract.address assert caller == RELAYER_CALLER, caller if is_hermes: hermes = Hermes(path.with_suffix(".toml")) @@ -203,7 +204,19 @@ def prepare_network( call_rly_cmd(path, connection_only, version) if incentivized: - register_fee_payee(cronos.cosmos_cli(), chainmain.cosmos_cli()) + port_id = "transfer" + channel_id = "channel-0" + register_fee_payee( + cronos.cosmos_cli(), chainmain.cosmos_cli(), port_id, channel_id + ) + data = {"from": acc.address} + print("mm-contract", contract.functions) + tx = contract.functions.callRegisterPayee( + port_id, channel_id, ADDRS["signer1"] + ).build_transaction(data) + receipt = send_transaction(w3, tx, acc.key) + print("mm-receipt.status", receipt.status) + # assert receipt.status == 0 port = None if is_relay: @@ -217,10 +230,10 @@ def prepare_network( wait_for_port(port) -def register_fee_payee(src_chain, dst_chain): +def register_fee_payee(src_chain, dst_chain, port_id, channel_id): rsp = dst_chain.register_counterparty_payee( - "transfer", - "channel-0", + port_id, + channel_id, dst_chain.address("relayer"), src_chain.address("signer1"), from_="relayer", diff --git a/integration_tests/test_ibc_rly.py b/integration_tests/test_ibc_rly.py index 0e8e23ee91..35c207b543 100644 --- a/integration_tests/test_ibc_rly.py +++ b/integration_tests/test_ibc_rly.py @@ -15,6 +15,7 @@ ibc_multi_transfer, ibc_transfer, prepare_network, + rly_transfer, ) from .utils import ( ADDRS, @@ -51,7 +52,7 @@ def ibc(request, tmp_path_factory): yield from prepare_network( path, name, - relayer=cluster.Relayer.HERMES.value, + relayer=cluster.Relayer.RLY.value, ) @@ -235,7 +236,7 @@ def test_ibc(ibc): w3 = ibc.cronos.w3 wait_for_new_blocks(ibc.cronos.cosmos_cli(), 1) start = w3.eth.get_block_number() - ibc_transfer(ibc) + ibc_transfer(ibc, rly_transfer) denom = ibc_denom(channel, src_denom) logs = get_logs_since(w3, CONTRACT, start) chainmain_cli = ibc.chainmain.cosmos_cli() diff --git a/x/cronos/events/bindings/cosmos/precompile/relayer/i_relayer_functions.abigen.go b/x/cronos/events/bindings/cosmos/precompile/relayer/i_relayer_functions.abigen.go index eb1cd85583..e7ae987b1b 100644 --- a/x/cronos/events/bindings/cosmos/precompile/relayer/i_relayer_functions.abigen.go +++ b/x/cronos/events/bindings/cosmos/precompile/relayer/i_relayer_functions.abigen.go @@ -31,7 +31,7 @@ var ( // RelayerFunctionsMetaData contains all meta data concerning the RelayerFunctions contract. var RelayerFunctionsMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"acknowledgement\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"channelCloseConfirm\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"channelCloseInit\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"channelOpenAck\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"channelOpenConfirm\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"channelOpenInit\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"channelOpenTry\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"connectionOpenAck\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"connectionOpenConfirm\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"connectionOpenInit\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"connectionOpenTry\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"createClient\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"recvPacket\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"submitMisbehaviour\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"timeout\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"timeoutOnClose\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"updateClient\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data1\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data2\",\"type\":\"bytes\"}],\"name\":\"updateClientAndAcknowledgement\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data1\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data2\",\"type\":\"bytes\"}],\"name\":\"updateClientAndChannelCloseConfirm\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data1\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data2\",\"type\":\"bytes\"}],\"name\":\"updateClientAndChannelCloseInit\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data1\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data2\",\"type\":\"bytes\"}],\"name\":\"updateClientAndChannelOpenAck\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data1\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data2\",\"type\":\"bytes\"}],\"name\":\"updateClientAndChannelOpenConfirm\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data1\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data2\",\"type\":\"bytes\"}],\"name\":\"updateClientAndChannelOpenInit\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data1\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data2\",\"type\":\"bytes\"}],\"name\":\"updateClientAndChannelOpenTry\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data1\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data2\",\"type\":\"bytes\"}],\"name\":\"updateClientAndConnectionOpenAck\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data1\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data2\",\"type\":\"bytes\"}],\"name\":\"updateClientAndConnectionOpenConfirm\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data1\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data2\",\"type\":\"bytes\"}],\"name\":\"updateClientAndConnectionOpenInit\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data1\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data2\",\"type\":\"bytes\"}],\"name\":\"updateClientAndConnectionOpenTry\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data1\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data2\",\"type\":\"bytes\"}],\"name\":\"updateClientAndRecvPacket\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data1\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"data2\",\"type\":\"bytes\"}],\"name\":\"updateClientAndTimeout\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeClient\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"acknowledgement\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"channelCloseConfirm\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"channelCloseInit\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"channelOpenAck\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"channelOpenConfirm\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"channelOpenInit\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"channelOpenTry\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"connectionOpenAck\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"connectionOpenConfirm\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"connectionOpenInit\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"connectionOpenTry\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"createClient\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"recvPacket\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"portID\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"channelID\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"relayerAddr\",\"type\":\"address\"}],\"name\":\"registerCounterpartyPayee\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"portID\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"channelID\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"relayerAddr\",\"type\":\"address\"}],\"name\":\"registerPayee\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"submitMisbehaviour\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"timeout\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"timeoutOnClose\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"updateClient\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeClient\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]", } // RelayerFunctionsABI is the input ABI used to generate the binding from. @@ -453,6 +453,48 @@ func (_RelayerFunctions *RelayerFunctionsTransactorSession) RecvPacket(data []by return _RelayerFunctions.Contract.RecvPacket(&_RelayerFunctions.TransactOpts, data) } +// RegisterCounterpartyPayee is a paid mutator transaction binding the contract method 0x5d3db16c. +// +// Solidity: function registerCounterpartyPayee(string portID, string channelID, address relayerAddr) payable returns(bool) +func (_RelayerFunctions *RelayerFunctionsTransactor) RegisterCounterpartyPayee(opts *bind.TransactOpts, portID string, channelID string, relayerAddr common.Address) (*types.Transaction, error) { + return _RelayerFunctions.contract.Transact(opts, "registerCounterpartyPayee", portID, channelID, relayerAddr) +} + +// RegisterCounterpartyPayee is a paid mutator transaction binding the contract method 0x5d3db16c. +// +// Solidity: function registerCounterpartyPayee(string portID, string channelID, address relayerAddr) payable returns(bool) +func (_RelayerFunctions *RelayerFunctionsSession) RegisterCounterpartyPayee(portID string, channelID string, relayerAddr common.Address) (*types.Transaction, error) { + return _RelayerFunctions.Contract.RegisterCounterpartyPayee(&_RelayerFunctions.TransactOpts, portID, channelID, relayerAddr) +} + +// RegisterCounterpartyPayee is a paid mutator transaction binding the contract method 0x5d3db16c. +// +// Solidity: function registerCounterpartyPayee(string portID, string channelID, address relayerAddr) payable returns(bool) +func (_RelayerFunctions *RelayerFunctionsTransactorSession) RegisterCounterpartyPayee(portID string, channelID string, relayerAddr common.Address) (*types.Transaction, error) { + return _RelayerFunctions.Contract.RegisterCounterpartyPayee(&_RelayerFunctions.TransactOpts, portID, channelID, relayerAddr) +} + +// RegisterPayee is a paid mutator transaction binding the contract method 0xb0dff939. +// +// Solidity: function registerPayee(string portID, string channelID, address relayerAddr) payable returns(bool) +func (_RelayerFunctions *RelayerFunctionsTransactor) RegisterPayee(opts *bind.TransactOpts, portID string, channelID string, relayerAddr common.Address) (*types.Transaction, error) { + return _RelayerFunctions.contract.Transact(opts, "registerPayee", portID, channelID, relayerAddr) +} + +// RegisterPayee is a paid mutator transaction binding the contract method 0xb0dff939. +// +// Solidity: function registerPayee(string portID, string channelID, address relayerAddr) payable returns(bool) +func (_RelayerFunctions *RelayerFunctionsSession) RegisterPayee(portID string, channelID string, relayerAddr common.Address) (*types.Transaction, error) { + return _RelayerFunctions.Contract.RegisterPayee(&_RelayerFunctions.TransactOpts, portID, channelID, relayerAddr) +} + +// RegisterPayee is a paid mutator transaction binding the contract method 0xb0dff939. +// +// Solidity: function registerPayee(string portID, string channelID, address relayerAddr) payable returns(bool) +func (_RelayerFunctions *RelayerFunctionsTransactorSession) RegisterPayee(portID string, channelID string, relayerAddr common.Address) (*types.Transaction, error) { + return _RelayerFunctions.Contract.RegisterPayee(&_RelayerFunctions.TransactOpts, portID, channelID, relayerAddr) +} + // SubmitMisbehaviour is a paid mutator transaction binding the contract method 0xa53b1c82. // // Solidity: function submitMisbehaviour(bytes data) payable returns(bytes) @@ -537,279 +579,6 @@ func (_RelayerFunctions *RelayerFunctionsTransactorSession) UpdateClient(data [] return _RelayerFunctions.Contract.UpdateClient(&_RelayerFunctions.TransactOpts, data) } -// UpdateClientAndAcknowledgement is a paid mutator transaction binding the contract method 0x65a939c6. -// -// Solidity: function updateClientAndAcknowledgement(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactor) UpdateClientAndAcknowledgement(opts *bind.TransactOpts, data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.contract.Transact(opts, "updateClientAndAcknowledgement", data1, data2) -} - -// UpdateClientAndAcknowledgement is a paid mutator transaction binding the contract method 0x65a939c6. -// -// Solidity: function updateClientAndAcknowledgement(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsSession) UpdateClientAndAcknowledgement(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndAcknowledgement(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndAcknowledgement is a paid mutator transaction binding the contract method 0x65a939c6. -// -// Solidity: function updateClientAndAcknowledgement(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactorSession) UpdateClientAndAcknowledgement(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndAcknowledgement(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndChannelCloseConfirm is a paid mutator transaction binding the contract method 0x9bbcbfd2. -// -// Solidity: function updateClientAndChannelCloseConfirm(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactor) UpdateClientAndChannelCloseConfirm(opts *bind.TransactOpts, data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.contract.Transact(opts, "updateClientAndChannelCloseConfirm", data1, data2) -} - -// UpdateClientAndChannelCloseConfirm is a paid mutator transaction binding the contract method 0x9bbcbfd2. -// -// Solidity: function updateClientAndChannelCloseConfirm(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsSession) UpdateClientAndChannelCloseConfirm(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndChannelCloseConfirm(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndChannelCloseConfirm is a paid mutator transaction binding the contract method 0x9bbcbfd2. -// -// Solidity: function updateClientAndChannelCloseConfirm(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactorSession) UpdateClientAndChannelCloseConfirm(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndChannelCloseConfirm(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndChannelCloseInit is a paid mutator transaction binding the contract method 0x5447448d. -// -// Solidity: function updateClientAndChannelCloseInit(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactor) UpdateClientAndChannelCloseInit(opts *bind.TransactOpts, data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.contract.Transact(opts, "updateClientAndChannelCloseInit", data1, data2) -} - -// UpdateClientAndChannelCloseInit is a paid mutator transaction binding the contract method 0x5447448d. -// -// Solidity: function updateClientAndChannelCloseInit(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsSession) UpdateClientAndChannelCloseInit(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndChannelCloseInit(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndChannelCloseInit is a paid mutator transaction binding the contract method 0x5447448d. -// -// Solidity: function updateClientAndChannelCloseInit(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactorSession) UpdateClientAndChannelCloseInit(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndChannelCloseInit(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndChannelOpenAck is a paid mutator transaction binding the contract method 0xc518ffc8. -// -// Solidity: function updateClientAndChannelOpenAck(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactor) UpdateClientAndChannelOpenAck(opts *bind.TransactOpts, data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.contract.Transact(opts, "updateClientAndChannelOpenAck", data1, data2) -} - -// UpdateClientAndChannelOpenAck is a paid mutator transaction binding the contract method 0xc518ffc8. -// -// Solidity: function updateClientAndChannelOpenAck(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsSession) UpdateClientAndChannelOpenAck(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndChannelOpenAck(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndChannelOpenAck is a paid mutator transaction binding the contract method 0xc518ffc8. -// -// Solidity: function updateClientAndChannelOpenAck(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactorSession) UpdateClientAndChannelOpenAck(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndChannelOpenAck(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndChannelOpenConfirm is a paid mutator transaction binding the contract method 0x0982b806. -// -// Solidity: function updateClientAndChannelOpenConfirm(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactor) UpdateClientAndChannelOpenConfirm(opts *bind.TransactOpts, data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.contract.Transact(opts, "updateClientAndChannelOpenConfirm", data1, data2) -} - -// UpdateClientAndChannelOpenConfirm is a paid mutator transaction binding the contract method 0x0982b806. -// -// Solidity: function updateClientAndChannelOpenConfirm(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsSession) UpdateClientAndChannelOpenConfirm(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndChannelOpenConfirm(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndChannelOpenConfirm is a paid mutator transaction binding the contract method 0x0982b806. -// -// Solidity: function updateClientAndChannelOpenConfirm(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactorSession) UpdateClientAndChannelOpenConfirm(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndChannelOpenConfirm(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndChannelOpenInit is a paid mutator transaction binding the contract method 0x66365fc4. -// -// Solidity: function updateClientAndChannelOpenInit(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactor) UpdateClientAndChannelOpenInit(opts *bind.TransactOpts, data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.contract.Transact(opts, "updateClientAndChannelOpenInit", data1, data2) -} - -// UpdateClientAndChannelOpenInit is a paid mutator transaction binding the contract method 0x66365fc4. -// -// Solidity: function updateClientAndChannelOpenInit(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsSession) UpdateClientAndChannelOpenInit(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndChannelOpenInit(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndChannelOpenInit is a paid mutator transaction binding the contract method 0x66365fc4. -// -// Solidity: function updateClientAndChannelOpenInit(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactorSession) UpdateClientAndChannelOpenInit(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndChannelOpenInit(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndChannelOpenTry is a paid mutator transaction binding the contract method 0x33978088. -// -// Solidity: function updateClientAndChannelOpenTry(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactor) UpdateClientAndChannelOpenTry(opts *bind.TransactOpts, data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.contract.Transact(opts, "updateClientAndChannelOpenTry", data1, data2) -} - -// UpdateClientAndChannelOpenTry is a paid mutator transaction binding the contract method 0x33978088. -// -// Solidity: function updateClientAndChannelOpenTry(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsSession) UpdateClientAndChannelOpenTry(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndChannelOpenTry(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndChannelOpenTry is a paid mutator transaction binding the contract method 0x33978088. -// -// Solidity: function updateClientAndChannelOpenTry(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactorSession) UpdateClientAndChannelOpenTry(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndChannelOpenTry(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndConnectionOpenAck is a paid mutator transaction binding the contract method 0xfedb9353. -// -// Solidity: function updateClientAndConnectionOpenAck(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactor) UpdateClientAndConnectionOpenAck(opts *bind.TransactOpts, data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.contract.Transact(opts, "updateClientAndConnectionOpenAck", data1, data2) -} - -// UpdateClientAndConnectionOpenAck is a paid mutator transaction binding the contract method 0xfedb9353. -// -// Solidity: function updateClientAndConnectionOpenAck(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsSession) UpdateClientAndConnectionOpenAck(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndConnectionOpenAck(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndConnectionOpenAck is a paid mutator transaction binding the contract method 0xfedb9353. -// -// Solidity: function updateClientAndConnectionOpenAck(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactorSession) UpdateClientAndConnectionOpenAck(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndConnectionOpenAck(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndConnectionOpenConfirm is a paid mutator transaction binding the contract method 0x70009dfc. -// -// Solidity: function updateClientAndConnectionOpenConfirm(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactor) UpdateClientAndConnectionOpenConfirm(opts *bind.TransactOpts, data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.contract.Transact(opts, "updateClientAndConnectionOpenConfirm", data1, data2) -} - -// UpdateClientAndConnectionOpenConfirm is a paid mutator transaction binding the contract method 0x70009dfc. -// -// Solidity: function updateClientAndConnectionOpenConfirm(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsSession) UpdateClientAndConnectionOpenConfirm(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndConnectionOpenConfirm(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndConnectionOpenConfirm is a paid mutator transaction binding the contract method 0x70009dfc. -// -// Solidity: function updateClientAndConnectionOpenConfirm(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactorSession) UpdateClientAndConnectionOpenConfirm(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndConnectionOpenConfirm(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndConnectionOpenInit is a paid mutator transaction binding the contract method 0x491e69c7. -// -// Solidity: function updateClientAndConnectionOpenInit(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactor) UpdateClientAndConnectionOpenInit(opts *bind.TransactOpts, data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.contract.Transact(opts, "updateClientAndConnectionOpenInit", data1, data2) -} - -// UpdateClientAndConnectionOpenInit is a paid mutator transaction binding the contract method 0x491e69c7. -// -// Solidity: function updateClientAndConnectionOpenInit(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsSession) UpdateClientAndConnectionOpenInit(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndConnectionOpenInit(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndConnectionOpenInit is a paid mutator transaction binding the contract method 0x491e69c7. -// -// Solidity: function updateClientAndConnectionOpenInit(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactorSession) UpdateClientAndConnectionOpenInit(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndConnectionOpenInit(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndConnectionOpenTry is a paid mutator transaction binding the contract method 0x5f3a7169. -// -// Solidity: function updateClientAndConnectionOpenTry(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactor) UpdateClientAndConnectionOpenTry(opts *bind.TransactOpts, data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.contract.Transact(opts, "updateClientAndConnectionOpenTry", data1, data2) -} - -// UpdateClientAndConnectionOpenTry is a paid mutator transaction binding the contract method 0x5f3a7169. -// -// Solidity: function updateClientAndConnectionOpenTry(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsSession) UpdateClientAndConnectionOpenTry(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndConnectionOpenTry(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndConnectionOpenTry is a paid mutator transaction binding the contract method 0x5f3a7169. -// -// Solidity: function updateClientAndConnectionOpenTry(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactorSession) UpdateClientAndConnectionOpenTry(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndConnectionOpenTry(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndRecvPacket is a paid mutator transaction binding the contract method 0xd3cffc28. -// -// Solidity: function updateClientAndRecvPacket(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactor) UpdateClientAndRecvPacket(opts *bind.TransactOpts, data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.contract.Transact(opts, "updateClientAndRecvPacket", data1, data2) -} - -// UpdateClientAndRecvPacket is a paid mutator transaction binding the contract method 0xd3cffc28. -// -// Solidity: function updateClientAndRecvPacket(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsSession) UpdateClientAndRecvPacket(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndRecvPacket(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndRecvPacket is a paid mutator transaction binding the contract method 0xd3cffc28. -// -// Solidity: function updateClientAndRecvPacket(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactorSession) UpdateClientAndRecvPacket(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndRecvPacket(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndTimeout is a paid mutator transaction binding the contract method 0xca4c72a0. -// -// Solidity: function updateClientAndTimeout(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactor) UpdateClientAndTimeout(opts *bind.TransactOpts, data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.contract.Transact(opts, "updateClientAndTimeout", data1, data2) -} - -// UpdateClientAndTimeout is a paid mutator transaction binding the contract method 0xca4c72a0. -// -// Solidity: function updateClientAndTimeout(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsSession) UpdateClientAndTimeout(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndTimeout(&_RelayerFunctions.TransactOpts, data1, data2) -} - -// UpdateClientAndTimeout is a paid mutator transaction binding the contract method 0xca4c72a0. -// -// Solidity: function updateClientAndTimeout(bytes data1, bytes data2) payable returns(bool) -func (_RelayerFunctions *RelayerFunctionsTransactorSession) UpdateClientAndTimeout(data1 []byte, data2 []byte) (*types.Transaction, error) { - return _RelayerFunctions.Contract.UpdateClientAndTimeout(&_RelayerFunctions.TransactOpts, data1, data2) -} - // UpgradeClient is a paid mutator transaction binding the contract method 0x8a8e4c5d. // // Solidity: function upgradeClient(bytes data) payable returns(bytes) diff --git a/x/cronos/events/bindings/src/RelayerFunctions.sol b/x/cronos/events/bindings/src/RelayerFunctions.sol index f580fe5ccb..d3c76dda70 100644 --- a/x/cronos/events/bindings/src/RelayerFunctions.sol +++ b/x/cronos/events/bindings/src/RelayerFunctions.sol @@ -20,17 +20,6 @@ interface IRelayerFunctions { function acknowledgement(bytes calldata data) external payable returns (bytes calldata); function timeout(bytes calldata data) external payable returns (bytes calldata); function timeoutOnClose(bytes calldata data) external payable returns (bytes calldata); - function updateClientAndConnectionOpenInit(bytes calldata data1, bytes calldata data2) external payable returns (bool); - function updateClientAndConnectionOpenTry(bytes calldata data1, bytes calldata data2) external payable returns (bool); - function updateClientAndConnectionOpenAck(bytes calldata data1, bytes calldata data2) external payable returns (bool); - function updateClientAndConnectionOpenConfirm(bytes calldata data1, bytes calldata data2) external payable returns (bool); - function updateClientAndChannelOpenInit(bytes calldata data1, bytes calldata data2) external payable returns (bool); - function updateClientAndChannelOpenTry(bytes calldata data1, bytes calldata data2) external payable returns (bool); - function updateClientAndChannelOpenAck(bytes calldata data1, bytes calldata data2) external payable returns (bool); - function updateClientAndChannelOpenConfirm(bytes calldata data1, bytes calldata data2) external payable returns (bool); - function updateClientAndRecvPacket(bytes calldata data1, bytes calldata data2) external payable returns (bool); - function updateClientAndAcknowledgement(bytes calldata data1, bytes calldata data2) external payable returns (bool); - function updateClientAndTimeout(bytes calldata data1, bytes calldata data2) external payable returns (bool); - function updateClientAndChannelCloseInit(bytes calldata data1, bytes calldata data2) external payable returns (bool); - function updateClientAndChannelCloseConfirm(bytes calldata data1, bytes calldata data2) external payable returns (bool); + function registerPayee(string calldata portID, string calldata channelID, address relayerAddr) external payable returns (bool); + function registerCounterpartyPayee(string calldata portID, string calldata channelID, address relayerAddr) external payable returns (bool); } diff --git a/x/cronos/keeper/precompiles/relayer.go b/x/cronos/keeper/precompiles/relayer.go index a16c90df71..3f7995bd1f 100644 --- a/x/cronos/keeper/precompiles/relayer.go +++ b/x/cronos/keeper/precompiles/relayer.go @@ -15,6 +15,7 @@ import ( "github.com/ethereum/go-ethereum/params" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" cronosevents "github.com/crypto-org-chain/cronos/v2/x/cronos/events" @@ -48,7 +49,9 @@ const ( Acknowledgement = "acknowledgement" Timeout = "timeout" TimeoutOnClose = "timeoutOnClose" - + // ibc fee + RegisterPayee = "registerPayee" + RsegisterCounterpartyPayee = "registerCounterpartyPayee" GasWhenReceiverChainIsSource = 51705 GasWhenReceiverChainIsNotSource = 144025 ) @@ -101,18 +104,20 @@ func init() { type RelayerContract struct { BaseContract - cdc codec.Codec - ibcKeeper types.IbcKeeper - logger log.Logger - isHomestead bool - isIstanbul bool - isShanghai bool + cdc codec.Codec + ibcKeeper types.IbcKeeper + ibcFeeKeeper types.IbcFeeKeeper + logger log.Logger + isHomestead bool + isIstanbul bool + isShanghai bool } -func NewRelayerContract(ibcKeeper types.IbcKeeper, cdc codec.Codec, rules params.Rules, logger log.Logger) vm.PrecompiledContract { +func NewRelayerContract(ibcKeeper types.IbcKeeper, ibcFeeKeeper types.IbcFeeKeeper, cdc codec.Codec, rules params.Rules, logger log.Logger) vm.PrecompiledContract { return &RelayerContract{ BaseContract: NewBaseContract(relayerContractAddress), ibcKeeper: ibcKeeper, + ibcFeeKeeper: ibcFeeKeeper, cdc: cdc, isHomestead: rules.IsHomestead, isIstanbul: rules.IsIstanbul, @@ -191,8 +196,33 @@ func (bc *RelayerContract) Run(evm *vm.EVM, contract *vm.Contract, readonly bool if err != nil { return nil, errors.New("fail to unpack input arguments") } - input := args[0].([]byte) converter := cronosevents.RelayerConvertEvent + if method.Name == RegisterPayee || method.Name == RsegisterCounterpartyPayee { + execErr := stateDB.ExecuteNativeAction(precompileAddr, converter, func(ctx sdk.Context) error { + portID := args[0].(string) + channelID := args[1].(string) + relayerAddr := sdk.AccAddress(args[2].(common.Address).Bytes()).String() + caller := sdk.AccAddress(contract.CallerAddress.Bytes()).String() + if method.Name == RegisterPayee { + _, err := bc.ibcFeeKeeper.RegisterPayee( + ctx, + ibcfeetypes.NewMsgRegisterPayee(portID, channelID, relayerAddr, caller), + ) + return err + } else { + _, err = bc.ibcFeeKeeper.RegisterCounterpartyPayee( + ctx, + ibcfeetypes.NewMsgRegisterCounterpartyPayee(portID, channelID, relayerAddr, caller), + ) + return err + } + }) + if execErr != nil { + return nil, execErr + } + return method.Outputs.Pack([]byte{}) + } + input := args[0].([]byte) e := &Executor{ cdc: bc.cdc, stateDB: stateDB, diff --git a/x/cronos/types/interfaces.go b/x/cronos/types/interfaces.go index 25becabe1f..b303c4128c 100644 --- a/x/cronos/types/interfaces.go +++ b/x/cronos/types/interfaces.go @@ -15,6 +15,7 @@ import ( "github.com/ethereum/go-ethereum/params" evmtypes "github.com/evmos/ethermint/x/evm/types" + ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" @@ -94,3 +95,8 @@ type IbcKeeper interface { Timeout(goCtx context.Context, msg *channeltypes.MsgTimeout) (*channeltypes.MsgTimeoutResponse, error) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTimeoutOnClose) (*channeltypes.MsgTimeoutOnCloseResponse, error) } + +type IbcFeeKeeper interface { + RegisterPayee(goCtx context.Context, msg *ibcfeetypes.MsgRegisterPayee) (*ibcfeetypes.MsgRegisterPayeeResponse, error) + RegisterCounterpartyPayee(goCtx context.Context, msg *ibcfeetypes.MsgRegisterCounterpartyPayee) (*ibcfeetypes.MsgRegisterCounterpartyPayeeResponse, error) +}