diff --git a/contracts/src/Assets.sol b/contracts/src/Assets.sol index aeff9b379a..e50d94e938 100644 --- a/contracts/src/Assets.sol +++ b/contracts/src/Assets.sol @@ -9,7 +9,7 @@ import {SafeTokenTransferFrom} from "./utils/SafeTransfer.sol"; import {AssetsStorage} from "./storage/AssetsStorage.sol"; import {SubstrateTypes} from "./SubstrateTypes.sol"; -import {ParaID} from "./Types.sol"; +import {ParaID, MultiAddress} from "./Types.sol"; import {Address} from "./utils/Address.sol"; /// @title Library for implementing Ethereum->Polkadot ERC20 transfers. @@ -21,6 +21,7 @@ library Assets { error InvalidToken(); error InvalidAmount(); error InvalidDestination(); + error Unsupported(); // This library requires state which must be initialized in the gateway's storage. function initialize(uint256 registerTokenFee, uint256 sendTokenFee) external { @@ -30,26 +31,17 @@ library Assets { $.sendTokenFee = sendTokenFee; } - function sendToken( - ParaID assetHubParaID, - address assetHubAgent, - address token, - address sender, - ParaID destinationChain, - bytes32 destinationAddress, - uint128 amount - ) external returns (bytes memory payload, uint256 extraFee) { - AssetsStorage.Layout storage $ = AssetsStorage.layout(); + /// @dev transfer tokens from the sender to the specified + function _transferToAgent(address assetHubAgent, address token, address sender, uint128 amount) internal { + if (!token.isContract()) { + revert InvalidToken(); + } - _transferToAgent(assetHubAgent, token, sender, amount); - if (destinationChain == assetHubParaID) { - payload = SubstrateTypes.SendToken(token, destinationAddress, amount); - } else { - payload = SubstrateTypes.SendToken(token, destinationChain, destinationAddress, amount); + if (amount == 0) { + revert InvalidAmount(); } - extraFee = $.sendTokenFee; - emit IGateway.TokenSent(sender, token, destinationChain, abi.encodePacked(destinationAddress), amount); + IERC20(token).safeTransferFrom(sender, assetHubAgent, amount); } function sendToken( @@ -58,34 +50,35 @@ library Assets { address token, address sender, ParaID destinationChain, - address destinationAddress, + MultiAddress calldata destinationAddress, uint128 amount ) external returns (bytes memory payload, uint256 extraFee) { AssetsStorage.Layout storage $ = AssetsStorage.layout(); - if (destinationChain == assetHubParaID) { - // AssetHub parachain doesn't support Ethereum-style addresses - revert InvalidDestination(); - } _transferToAgent(assetHubAgent, token, sender, amount); - payload = SubstrateTypes.SendToken(address(this), token, destinationChain, destinationAddress, amount); - extraFee = $.sendTokenFee; - - emit IGateway.TokenSent(sender, token, destinationChain, abi.encodePacked(destinationAddress), amount); - } - - /// @dev transfer tokens from the sender to the specified - function _transferToAgent(address assetHubAgent, address token, address sender, uint128 amount) internal { - if (!token.isContract()) { - revert InvalidToken(); - } - - if (amount == 0) { - revert InvalidAmount(); + if (destinationChain == assetHubParaID) { + if (destinationAddress.isAddress32()) { + payload = SubstrateTypes.SendTokenToAssetHubAddress32(token, destinationAddress.asAddress32(), amount); + } else { + revert Unsupported(); + } + } else { + if (destinationAddress.isAddress32()) { + payload = SubstrateTypes.SendTokenToAddress32( + token, destinationChain, destinationAddress.asAddress32(), amount + ); + } else if (destinationAddress.isAddress20()) { + payload = SubstrateTypes.SendTokenToAddress20( + token, destinationChain, destinationAddress.asAddress20(), amount + ); + } else { + revert Unsupported(); + } } + extraFee = $.sendTokenFee; - IERC20(token).safeTransferFrom(sender, assetHubAgent, amount); + emit IGateway.TokenSent(sender, token, destinationChain, destinationAddress, amount); } /// @dev Enqueues a create native token message to substrate. diff --git a/contracts/src/Gateway.sol b/contracts/src/Gateway.sol index c057db4734..9a4e50e6e5 100644 --- a/contracts/src/Gateway.sol +++ b/contracts/src/Gateway.sol @@ -8,7 +8,7 @@ import {Verification} from "./Verification.sol"; import {Assets} from "./Assets.sol"; import {AgentExecutor} from "./AgentExecutor.sol"; import {Agent} from "./Agent.sol"; -import {Channel, ChannelID, InboundMessage, OperatingMode, ParaID, Command} from "./Types.sol"; +import {Channel, ChannelID, InboundMessage, OperatingMode, ParaID, Command, MultiAddress} from "./Types.sol"; import {IGateway} from "./interfaces/IGateway.sol"; import {IInitializable} from "./interfaces/IInitializable.sol"; import {ERC1967} from "./utils/ERC1967.sol"; @@ -454,22 +454,7 @@ contract Gateway is IGateway, IInitializable { } // Transfer ERC20 tokens to a Polkadot parachain - function sendToken(address token, ParaID destinationChain, bytes32 destinationAddress, uint128 amount) - external - payable - { - CoreStorage.Layout storage $ = CoreStorage.layout(); - address assetHubAgent = $.agents[ASSET_HUB_AGENT_ID]; - - (bytes memory payload, uint256 extraFee) = Assets.sendToken( - ASSET_HUB_PARA_ID, assetHubAgent, token, msg.sender, destinationChain, destinationAddress, amount - ); - - _submitOutbound(ASSET_HUB_PARA_ID, payload, extraFee); - } - - // Transfer ERC20 tokens to a Polkadot parachain - function sendToken(address token, ParaID destinationChain, address destinationAddress, uint128 amount) + function sendToken(address token, ParaID destinationChain, MultiAddress calldata destinationAddress, uint128 amount) external payable { diff --git a/contracts/src/MultiAddress.sol b/contracts/src/MultiAddress.sol new file mode 100644 index 0000000000..143d339287 --- /dev/null +++ b/contracts/src/MultiAddress.sol @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2023 Snowfork +pragma solidity 0.8.22; + +using {isIndex, asIndex, isAddress32, asAddress32, isAddress20, asAddress20} for MultiAddress global; + +/// @dev An address for an on-chain account +struct MultiAddress { + Kind kind; + bytes data; +} + +enum Kind { + Index, + Address32, + Address20 +} + +function isIndex(MultiAddress calldata multiAddress) pure returns (bool) { + return multiAddress.kind == Kind.Index; +} + +function asIndex(MultiAddress calldata multiAddress) pure returns (uint32) { + return abi.decode(multiAddress.data, (uint32)); +} + +function isAddress32(MultiAddress calldata multiAddress) pure returns (bool) { + return multiAddress.kind == Kind.Address32; +} + +function asAddress32(MultiAddress calldata multiAddress) pure returns (bytes32) { + return bytes32(multiAddress.data); +} + +function isAddress20(MultiAddress calldata multiAddress) pure returns (bool) { + return multiAddress.kind == Kind.Address20; +} + +function asAddress20(MultiAddress calldata multiAddress) pure returns (bytes20) { + return bytes20(multiAddress.data); +} + +function multiAddressFromUint32(uint32 id) pure returns (MultiAddress memory) { + return MultiAddress({kind: Kind.Index, data: abi.encode(id)}); +} + +function multiAddressFromBytes32(bytes32 id) pure returns (MultiAddress memory) { + return MultiAddress({kind: Kind.Address32, data: bytes.concat(id)}); +} + +function multiAddressFromBytes20(bytes20 id) pure returns (MultiAddress memory) { + return MultiAddress({kind: Kind.Address20, data: bytes.concat(id)}); +} diff --git a/contracts/src/SubstrateTypes.sol b/contracts/src/SubstrateTypes.sol index 36d0257aaf..fa6d6a2382 100644 --- a/contracts/src/SubstrateTypes.sol +++ b/contracts/src/SubstrateTypes.sol @@ -66,8 +66,12 @@ library SubstrateTypes { * @dev SCALE-encodes `router_primitives::inbound::VersionedMessage` containing payload * `NativeTokensMessage::Mint` */ - // solhint-disable-next-line func-name-mixedcase - function SendToken(address token, bytes32 recipient, uint128 amount) internal view returns (bytes memory) { + // destination is AccountID32 address on AssetHub + function SendTokenToAssetHubAddress32(address token, bytes32 recipient, uint128 amount) + internal + view + returns (bytes memory) + { return bytes.concat( bytes1(0x00), ScaleCodec.encodeU64(uint64(block.chainid)), @@ -79,7 +83,8 @@ library SubstrateTypes { ); } - function SendToken(address token, ParaID paraID, bytes32 recipient, uint128 amount) + // destination is AccountID32 address + function SendTokenToAddress32(address token, ParaID paraID, bytes32 recipient, uint128 amount) internal view returns (bytes memory) @@ -96,7 +101,8 @@ library SubstrateTypes { ); } - function SendToken(address gateway, address token, ParaID paraID, address recipient, uint128 amount) + // destination is AccountID20 address + function SendTokenToAddress20(address token, ParaID paraID, bytes20 recipient, uint128 amount) internal view returns (bytes memory) @@ -105,11 +111,10 @@ library SubstrateTypes { bytes1(0x00), ScaleCodec.encodeU64(uint64(block.chainid)), bytes1(0x01), - SubstrateTypes.H160(gateway), SubstrateTypes.H160(token), bytes1(0x02), ScaleCodec.encodeU32(uint32(ParaID.unwrap(paraID))), - abi.encodePacked(recipient), + recipient, ScaleCodec.encodeU128(amount) ); } diff --git a/contracts/src/Types.sol b/contracts/src/Types.sol index 2e5ff1e5f6..f826c7add4 100644 --- a/contracts/src/Types.sol +++ b/contracts/src/Types.sol @@ -2,6 +2,10 @@ // SPDX-FileCopyrightText: 2023 Snowfork pragma solidity 0.8.22; +import { + MultiAddress, multiAddressFromUint32, multiAddressFromBytes32, multiAddressFromBytes20 +} from "./MultiAddress.sol"; + type ParaID is uint32; using {ParaIDEq as ==, ParaIDNe as !=, into} for ParaID global; diff --git a/contracts/src/interfaces/IGateway.sol b/contracts/src/interfaces/IGateway.sol index 551e122866..d36e4a2393 100644 --- a/contracts/src/interfaces/IGateway.sol +++ b/contracts/src/interfaces/IGateway.sol @@ -2,7 +2,7 @@ // SPDX-FileCopyrightText: 2023 Snowfork pragma solidity 0.8.22; -import {OperatingMode, InboundMessage, ParaID, ChannelID} from "../Types.sol"; +import {OperatingMode, InboundMessage, ParaID, ChannelID, MultiAddress} from "../Types.sol"; import {Verification} from "../Verification.sol"; interface IGateway { @@ -65,7 +65,11 @@ interface IGateway { /// @dev Emitted once the funds are locked and an outbound message is successfully queued. event TokenSent( - address indexed token, address indexed sender, ParaID destinationChain, bytes destinationAddress, uint128 amount + address indexed token, + address indexed sender, + ParaID destinationChain, + MultiAddress destinationAddress, + uint128 amount ); /// @dev Emitted when a command is sent to register a new wrapped token on AssetHub @@ -79,12 +83,7 @@ interface IGateway { function registerToken(address token) external payable; /// @dev Send ERC20 tokens to parachain `destinationChain` and deposit into account `destinationAddress` - function sendToken(address token, ParaID destinationChain, bytes32 destinationAddress, uint128 amount) - external - payable; - - /// @dev Send ERC20 tokens to parachain `destinationChain` and deposit into account `destinationAddress` - function sendToken(address token, ParaID destinationChain, address destinationAddress, uint128 amount) + function sendToken(address token, ParaID destinationChain, MultiAddress calldata destinationAddress, uint128 amount) external payable; } diff --git a/contracts/test/Gateway.t.sol b/contracts/test/Gateway.t.sol index f214242074..fb74e29ce9 100644 --- a/contracts/test/Gateway.t.sol +++ b/contracts/test/Gateway.t.sol @@ -22,7 +22,15 @@ import {SubstrateTypes} from "./../src/SubstrateTypes.sol"; import {NativeTransferFailed} from "../src/utils/SafeTransfer.sol"; -import {AgentExecuteCommand, InboundMessage, OperatingMode, ParaID, Command} from "../src/Types.sol"; +import { + AgentExecuteCommand, + InboundMessage, + OperatingMode, + ParaID, + Command, + multiAddressFromBytes32, + multiAddressFromBytes20 +} from "../src/Types.sol"; import {WETH9} from "canonical-weth/WETH9.sol"; import "./mocks/GatewayUpgradeMock.sol"; @@ -58,6 +66,9 @@ contract GatewayTest is Test { uint256 public registerNativeTokenFee = 1 ether; uint256 public sendNativeTokenFee = 1 ether; + MultiAddress public recipientAddress32; + MultiAddress public recipientAddress20; + function setUp() public { AgentExecutor executor = new AgentExecutor(); gatewayLogic = new GatewayMock( @@ -101,6 +112,9 @@ contract GatewayTest is Test { // create tokens for account 2 token.deposit{value: 500}(); + + recipientAddress32 = multiAddressFromBytes32(keccak256("recipient")); + recipientAddress20 = multiAddressFromBytes20(bytes20(keccak256("recipient"))); } function makeCreateAgentCommand() public pure returns (Command, bytes memory) { @@ -267,7 +281,7 @@ contract GatewayTest is Test { token.approve(address(gateway), 1); hoax(user, 2 ether); - IGateway(address(gateway)).sendToken{value: 2 ether}(address(token), ParaID.wrap(0), "", 1); + IGateway(address(gateway)).sendToken{value: 2 ether}(address(token), ParaID.wrap(0), recipientAddress32, 1); assertEq(user.balance, 0 ether); } @@ -284,7 +298,7 @@ contract GatewayTest is Test { vm.expectRevert(Gateway.FeePaymentToLow.selector); hoax(user, 2 ether); - IGateway(address(gateway)).sendToken{value: 0.5 ether}(address(token), ParaID.wrap(0), "", 1); + IGateway(address(gateway)).sendToken{value: 0.5 ether}(address(token), ParaID.wrap(0), recipientAddress32, 1); assertEq(user.balance, 2 ether); } @@ -566,16 +580,15 @@ contract GatewayTest is Test { // Multilocation for recipient ParaID destPara = ParaID.wrap(2043); - bytes32 destAddress = keccak256("/Alice"); vm.expectEmit(true, true, false, true); - emit IGateway.TokenSent(address(this), address(token), destPara, abi.encodePacked(destAddress), 1); + emit IGateway.TokenSent(address(this), address(token), destPara, recipientAddress32, 1); // Expect the gateway to emit `OutboundMessageAccepted` vm.expectEmit(true, false, false, false); emit IGateway.OutboundMessageAccepted(assetHubParaID.into(), 1, messageID, bytes("")); - IGateway(address(gateway)).sendToken{value: 2 ether}(address(token), destPara, destAddress, 1); + IGateway(address(gateway)).sendToken{value: 2 ether}(address(token), destPara, recipientAddress32, 1); } function testSendTokenAddress32ToAssetHub() public { @@ -584,16 +597,15 @@ contract GatewayTest is Test { // Multilocation for recipient ParaID destPara = assetHubParaID; - bytes32 destAddress = keccak256("/Alice"); vm.expectEmit(true, true, false, true); - emit IGateway.TokenSent(address(this), address(token), destPara, abi.encodePacked(destAddress), 1); + emit IGateway.TokenSent(address(this), address(token), destPara, recipientAddress32, 1); // Expect the gateway to emit `OutboundMessageAccepted` vm.expectEmit(true, false, false, false); emit IGateway.OutboundMessageAccepted(assetHubParaID.into(), 1, messageID, bytes("")); - IGateway(address(gateway)).sendToken{value: 2 ether}(address(token), destPara, destAddress, 1); + IGateway(address(gateway)).sendToken{value: 2 ether}(address(token), destPara, recipientAddress32, 1); } function testSendTokenAddress20() public { @@ -602,16 +614,15 @@ contract GatewayTest is Test { // Multilocation for recipient ParaID destPara = ParaID.wrap(2043); - address destAddress = makeAddr("/Alice"); vm.expectEmit(true, true, false, true); - emit IGateway.TokenSent(address(this), address(token), destPara, abi.encodePacked(destAddress), 1); + emit IGateway.TokenSent(address(this), address(token), destPara, recipientAddress20, 1); // Expect the gateway to emit `OutboundMessageAccepted` vm.expectEmit(true, false, false, false); emit IGateway.OutboundMessageAccepted(assetHubParaID.into(), 1, messageID, bytes("")); - IGateway(address(gateway)).sendToken{value: 2 ether}(address(token), destPara, destAddress, 1); + IGateway(address(gateway)).sendToken{value: 2 ether}(address(token), destPara, recipientAddress20, 1); } function testSendTokenAddress20FailsInvalidDestination() public { @@ -619,11 +630,10 @@ contract GatewayTest is Test { token.approve(address(gateway), 1); ParaID destPara = assetHubParaID; - address destAddress = makeAddr("/Alice"); // Should fail to send tokens to AssetHub - vm.expectRevert(Assets.InvalidDestination.selector); - IGateway(address(gateway)).sendToken{value: 2 ether}(address(token), destPara, destAddress, 1); + vm.expectRevert(Assets.Unsupported.selector); + IGateway(address(gateway)).sendToken{value: 2 ether}(address(token), destPara, recipientAddress20, 1); } /** @@ -668,7 +678,7 @@ contract GatewayTest is Test { IGateway(address(gateway)).registerToken{value: 1 ether}(address(token)); vm.expectRevert(Gateway.Disabled.selector); - IGateway(address(gateway)).sendToken{value: 1 ether}(address(token), ParaID.wrap(0), "", 1); + IGateway(address(gateway)).sendToken{value: 1 ether}(address(token), ParaID.wrap(0), recipientAddress32, 1); } /** diff --git a/contracts/test/mocks/GatewayUpgradeMock.sol b/contracts/test/mocks/GatewayUpgradeMock.sol index c948076064..760be21c05 100644 --- a/contracts/test/mocks/GatewayUpgradeMock.sol +++ b/contracts/test/mocks/GatewayUpgradeMock.sol @@ -2,7 +2,7 @@ // SPDX-FileCopyrightText: 2023 Snowfork pragma solidity 0.8.22; -import {Channel, InboundMessage, OperatingMode, ParaID, Command, ChannelID} from "../../src/Types.sol"; +import {Channel, InboundMessage, OperatingMode, ParaID, Command, ChannelID, MultiAddress} from "../../src/Types.sol"; import {IGateway} from "../../src/interfaces/IGateway.sol"; import {IInitializable} from "../../src/interfaces/IInitializable.sol"; import {Verification} from "../../src/Verification.sol"; @@ -43,8 +43,7 @@ contract GatewayUpgradeMock is IGateway, IInitializable { function submitInbound(InboundMessage calldata, bytes32[] calldata, Verification.Proof calldata) external {} function registerToken(address) external payable {} - function sendToken(address, ParaID, bytes32, uint128) external payable {} - function sendToken(address, ParaID, address, uint128) external payable {} + function sendToken(address, ParaID, MultiAddress calldata, uint128) external payable {} event Initialized(uint256 d0, uint256 d1); diff --git a/relayer/contracts/gateway.go b/relayer/contracts/gateway.go index 673e7b47ed..8faab580c4 100644 --- a/relayer/contracts/gateway.go +++ b/relayer/contracts/gateway.go @@ -41,6 +41,12 @@ type InboundMessage struct { Id [32]byte } +// MultiAddress is an auto generated low-level Go binding around an user-defined struct. +type MultiAddress struct { + Kind uint8 + Data []byte +} + // VerificationDigestItem is an auto generated low-level Go binding around an user-defined struct. type VerificationDigestItem struct { Kind *big.Int @@ -85,7 +91,7 @@ type VerificationProof struct { // GatewayMetaData contains all meta data concerning the Gateway contract. var GatewayMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"agentID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"agent\",\"type\":\"address\"}],\"name\":\"AgentCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"agentID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"AgentFundsWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"ChannelID\",\"name\":\"channelID\",\"type\":\"bytes32\"}],\"name\":\"ChannelCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"ChannelID\",\"name\":\"channelID\",\"type\":\"bytes32\"}],\"name\":\"ChannelUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"ChannelID\",\"name\":\"channelID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"InboundMessageDispatched\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"enumOperatingMode\",\"name\":\"mode\",\"type\":\"uint8\"}],\"name\":\"OperatingModeChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"ChannelID\",\"name\":\"channelID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"}],\"name\":\"OutboundMessageAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenRegistrationSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"ParaID\",\"name\":\"destinationChain\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"destinationAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"}],\"name\":\"TokenSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"register\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"send\",\"type\":\"uint256\"}],\"name\":\"TokenTransferFeesChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"agentID\",\"type\":\"bytes32\"}],\"name\":\"agentOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"ChannelID\",\"name\":\"channelID\",\"type\":\"bytes32\"}],\"name\":\"channelNoncesOf\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"ChannelID\",\"name\":\"channelID\",\"type\":\"bytes32\"}],\"name\":\"channelOperatingModeOf\",\"outputs\":[{\"internalType\":\"enumOperatingMode\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"ChannelID\",\"name\":\"channelID\",\"type\":\"bytes32\"}],\"name\":\"channelOutboundFeeOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"operatingMode\",\"outputs\":[{\"internalType\":\"enumOperatingMode\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"registerToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"ParaID\",\"name\":\"destinationChain\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"}],\"name\":\"sendToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"ParaID\",\"name\":\"destinationChain\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"destinationAddress\",\"type\":\"bytes32\"},{\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"}],\"name\":\"sendToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"ChannelID\",\"name\":\"channelID\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"enumCommand\",\"name\":\"command\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"maxDispatchGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxRefund\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"internalType\":\"structInboundMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bytes32[]\",\"name\":\"leafProof\",\"type\":\"bytes32[]\"},{\"components\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"stateRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extrinsicsRoot\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"kind\",\"type\":\"uint256\"},{\"internalType\":\"bytes4\",\"name\":\"consensusEngineID\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"structVerification.DigestItem[]\",\"name\":\"digestItems\",\"type\":\"tuple[]\"}],\"internalType\":\"structVerification.ParachainHeader\",\"name\":\"header\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"pos\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"width\",\"type\":\"uint256\"},{\"internalType\":\"bytes32[]\",\"name\":\"proof\",\"type\":\"bytes32[]\"}],\"internalType\":\"structVerification.HeadProof\",\"name\":\"headProof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"parentNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nextAuthoritySetID\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextAuthoritySetLen\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"nextAuthoritySetRoot\",\"type\":\"bytes32\"}],\"internalType\":\"structVerification.MMRLeafPartial\",\"name\":\"leafPartial\",\"type\":\"tuple\"},{\"internalType\":\"bytes32[]\",\"name\":\"leafProof\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"leafProofOrder\",\"type\":\"uint256\"}],\"internalType\":\"structVerification.Proof\",\"name\":\"headerProof\",\"type\":\"tuple\"}],\"name\":\"submitInbound\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tokenTransferFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"agentID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"agent\",\"type\":\"address\"}],\"name\":\"AgentCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"agentID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"AgentFundsWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"ChannelID\",\"name\":\"channelID\",\"type\":\"bytes32\"}],\"name\":\"ChannelCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"ChannelID\",\"name\":\"channelID\",\"type\":\"bytes32\"}],\"name\":\"ChannelUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"ChannelID\",\"name\":\"channelID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"name\":\"InboundMessageDispatched\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"enumOperatingMode\",\"name\":\"mode\",\"type\":\"uint8\"}],\"name\":\"OperatingModeChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"ChannelID\",\"name\":\"channelID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"messageID\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"}],\"name\":\"OutboundMessageAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenRegistrationSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"ParaID\",\"name\":\"destinationChain\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"enumKind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structMultiAddress\",\"name\":\"destinationAddress\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"}],\"name\":\"TokenSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"register\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"send\",\"type\":\"uint256\"}],\"name\":\"TokenTransferFeesChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"agentID\",\"type\":\"bytes32\"}],\"name\":\"agentOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"ChannelID\",\"name\":\"channelID\",\"type\":\"bytes32\"}],\"name\":\"channelNoncesOf\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"ChannelID\",\"name\":\"channelID\",\"type\":\"bytes32\"}],\"name\":\"channelOperatingModeOf\",\"outputs\":[{\"internalType\":\"enumOperatingMode\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"ChannelID\",\"name\":\"channelID\",\"type\":\"bytes32\"}],\"name\":\"channelOutboundFeeOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"operatingMode\",\"outputs\":[{\"internalType\":\"enumOperatingMode\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"registerToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"ParaID\",\"name\":\"destinationChain\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"enumKind\",\"name\":\"kind\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"structMultiAddress\",\"name\":\"destinationAddress\",\"type\":\"tuple\"},{\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"}],\"name\":\"sendToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"ChannelID\",\"name\":\"channelID\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"enumCommand\",\"name\":\"command\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"maxDispatchGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxRefund\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"internalType\":\"structInboundMessage\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bytes32[]\",\"name\":\"leafProof\",\"type\":\"bytes32[]\"},{\"components\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"stateRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"extrinsicsRoot\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"kind\",\"type\":\"uint256\"},{\"internalType\":\"bytes4\",\"name\":\"consensusEngineID\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"structVerification.DigestItem[]\",\"name\":\"digestItems\",\"type\":\"tuple[]\"}],\"internalType\":\"structVerification.ParachainHeader\",\"name\":\"header\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"pos\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"width\",\"type\":\"uint256\"},{\"internalType\":\"bytes32[]\",\"name\":\"proof\",\"type\":\"bytes32[]\"}],\"internalType\":\"structVerification.HeadProof\",\"name\":\"headProof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"parentNumber\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nextAuthoritySetID\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nextAuthoritySetLen\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"nextAuthoritySetRoot\",\"type\":\"bytes32\"}],\"internalType\":\"structVerification.MMRLeafPartial\",\"name\":\"leafPartial\",\"type\":\"tuple\"},{\"internalType\":\"bytes32[]\",\"name\":\"leafProof\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"leafProofOrder\",\"type\":\"uint256\"}],\"internalType\":\"structVerification.Proof\",\"name\":\"headerProof\",\"type\":\"tuple\"}],\"name\":\"submitInbound\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tokenTransferFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // GatewayABI is the input ABI used to generate the binding from. @@ -474,48 +480,27 @@ func (_Gateway *GatewayTransactorSession) RegisterToken(token common.Address) (* return _Gateway.Contract.RegisterToken(&_Gateway.TransactOpts, token) } -// SendToken is a paid mutator transaction binding the contract method 0x39a78e07. +// SendToken is a paid mutator transaction binding the contract method 0xb63ff1ae. // -// Solidity: function sendToken(address token, uint32 destinationChain, address destinationAddress, uint128 amount) payable returns() -func (_Gateway *GatewayTransactor) SendToken(opts *bind.TransactOpts, token common.Address, destinationChain uint32, destinationAddress common.Address, amount *big.Int) (*types.Transaction, error) { +// Solidity: function sendToken(address token, uint32 destinationChain, (uint8,bytes) destinationAddress, uint128 amount) payable returns() +func (_Gateway *GatewayTransactor) SendToken(opts *bind.TransactOpts, token common.Address, destinationChain uint32, destinationAddress MultiAddress, amount *big.Int) (*types.Transaction, error) { return _Gateway.contract.Transact(opts, "sendToken", token, destinationChain, destinationAddress, amount) } -// SendToken is a paid mutator transaction binding the contract method 0x39a78e07. +// SendToken is a paid mutator transaction binding the contract method 0xb63ff1ae. // -// Solidity: function sendToken(address token, uint32 destinationChain, address destinationAddress, uint128 amount) payable returns() -func (_Gateway *GatewaySession) SendToken(token common.Address, destinationChain uint32, destinationAddress common.Address, amount *big.Int) (*types.Transaction, error) { +// Solidity: function sendToken(address token, uint32 destinationChain, (uint8,bytes) destinationAddress, uint128 amount) payable returns() +func (_Gateway *GatewaySession) SendToken(token common.Address, destinationChain uint32, destinationAddress MultiAddress, amount *big.Int) (*types.Transaction, error) { return _Gateway.Contract.SendToken(&_Gateway.TransactOpts, token, destinationChain, destinationAddress, amount) } -// SendToken is a paid mutator transaction binding the contract method 0x39a78e07. +// SendToken is a paid mutator transaction binding the contract method 0xb63ff1ae. // -// Solidity: function sendToken(address token, uint32 destinationChain, address destinationAddress, uint128 amount) payable returns() -func (_Gateway *GatewayTransactorSession) SendToken(token common.Address, destinationChain uint32, destinationAddress common.Address, amount *big.Int) (*types.Transaction, error) { +// Solidity: function sendToken(address token, uint32 destinationChain, (uint8,bytes) destinationAddress, uint128 amount) payable returns() +func (_Gateway *GatewayTransactorSession) SendToken(token common.Address, destinationChain uint32, destinationAddress MultiAddress, amount *big.Int) (*types.Transaction, error) { return _Gateway.Contract.SendToken(&_Gateway.TransactOpts, token, destinationChain, destinationAddress, amount) } -// SendToken0 is a paid mutator transaction binding the contract method 0x590cfda7. -// -// Solidity: function sendToken(address token, uint32 destinationChain, bytes32 destinationAddress, uint128 amount) payable returns() -func (_Gateway *GatewayTransactor) SendToken0(opts *bind.TransactOpts, token common.Address, destinationChain uint32, destinationAddress [32]byte, amount *big.Int) (*types.Transaction, error) { - return _Gateway.contract.Transact(opts, "sendToken0", token, destinationChain, destinationAddress, amount) -} - -// SendToken0 is a paid mutator transaction binding the contract method 0x590cfda7. -// -// Solidity: function sendToken(address token, uint32 destinationChain, bytes32 destinationAddress, uint128 amount) payable returns() -func (_Gateway *GatewaySession) SendToken0(token common.Address, destinationChain uint32, destinationAddress [32]byte, amount *big.Int) (*types.Transaction, error) { - return _Gateway.Contract.SendToken0(&_Gateway.TransactOpts, token, destinationChain, destinationAddress, amount) -} - -// SendToken0 is a paid mutator transaction binding the contract method 0x590cfda7. -// -// Solidity: function sendToken(address token, uint32 destinationChain, bytes32 destinationAddress, uint128 amount) payable returns() -func (_Gateway *GatewayTransactorSession) SendToken0(token common.Address, destinationChain uint32, destinationAddress [32]byte, amount *big.Int) (*types.Transaction, error) { - return _Gateway.Contract.SendToken0(&_Gateway.TransactOpts, token, destinationChain, destinationAddress, amount) -} - // SubmitInbound is a paid mutator transaction binding the contract method 0xbd1026a1. // // Solidity: function submitInbound((bytes32,uint64,uint8,bytes,uint256,uint256,uint256,bytes32) message, bytes32[] leafProof, ((bytes32,uint256,bytes32,bytes32,(uint256,bytes4,bytes)[]),(uint256,uint256,bytes32[]),(uint8,uint32,bytes32,uint64,uint32,bytes32),bytes32[],uint256) headerProof) returns() @@ -1768,14 +1753,14 @@ type GatewayTokenSent struct { Token common.Address Sender common.Address DestinationChain uint32 - DestinationAddress []byte + DestinationAddress MultiAddress Amount *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterTokenSent is a free log retrieval operation binding the contract event 0xdb263e5e9480880d17e5b58e9adb11fec55bc42ab1a72f30678a486fcf0a75a4. +// FilterTokenSent is a free log retrieval operation binding the contract event 0x24c5d2de620c6e25186ae16f6919eba93b6e2c1a33857cc419d9f3a00d6967e9. // -// Solidity: event TokenSent(address indexed token, address indexed sender, uint32 destinationChain, bytes destinationAddress, uint128 amount) +// Solidity: event TokenSent(address indexed token, address indexed sender, uint32 destinationChain, (uint8,bytes) destinationAddress, uint128 amount) func (_Gateway *GatewayFilterer) FilterTokenSent(opts *bind.FilterOpts, token []common.Address, sender []common.Address) (*GatewayTokenSentIterator, error) { var tokenRule []interface{} @@ -1794,9 +1779,9 @@ func (_Gateway *GatewayFilterer) FilterTokenSent(opts *bind.FilterOpts, token [] return &GatewayTokenSentIterator{contract: _Gateway.contract, event: "TokenSent", logs: logs, sub: sub}, nil } -// WatchTokenSent is a free log subscription operation binding the contract event 0xdb263e5e9480880d17e5b58e9adb11fec55bc42ab1a72f30678a486fcf0a75a4. +// WatchTokenSent is a free log subscription operation binding the contract event 0x24c5d2de620c6e25186ae16f6919eba93b6e2c1a33857cc419d9f3a00d6967e9. // -// Solidity: event TokenSent(address indexed token, address indexed sender, uint32 destinationChain, bytes destinationAddress, uint128 amount) +// Solidity: event TokenSent(address indexed token, address indexed sender, uint32 destinationChain, (uint8,bytes) destinationAddress, uint128 amount) func (_Gateway *GatewayFilterer) WatchTokenSent(opts *bind.WatchOpts, sink chan<- *GatewayTokenSent, token []common.Address, sender []common.Address) (event.Subscription, error) { var tokenRule []interface{} @@ -1840,9 +1825,9 @@ func (_Gateway *GatewayFilterer) WatchTokenSent(opts *bind.WatchOpts, sink chan< }), nil } -// ParseTokenSent is a log parse operation binding the contract event 0xdb263e5e9480880d17e5b58e9adb11fec55bc42ab1a72f30678a486fcf0a75a4. +// ParseTokenSent is a log parse operation binding the contract event 0x24c5d2de620c6e25186ae16f6919eba93b6e2c1a33857cc419d9f3a00d6967e9. // -// Solidity: event TokenSent(address indexed token, address indexed sender, uint32 destinationChain, bytes destinationAddress, uint128 amount) +// Solidity: event TokenSent(address indexed token, address indexed sender, uint32 destinationChain, (uint8,bytes) destinationAddress, uint128 amount) func (_Gateway *GatewayFilterer) ParseTokenSent(log types.Log) (*GatewayTokenSent, error) { event := new(GatewayTokenSent) if err := _Gateway.contract.UnpackLog(event, "TokenSent", log); err != nil { diff --git a/smoketest/tests/send_token.rs b/smoketest/tests/send_token.rs index 930818d587..651db9a55d 100644 --- a/smoketest/tests/send_token.rs +++ b/smoketest/tests/send_token.rs @@ -54,10 +54,10 @@ async fn send_token() { // Lock tokens into vault let amount: u128 = U256::from(value).low_u128(); let receipt = gateway - .send_token_with_token_and_destination_chain_and_destination_address( + .send_token( weth.address(), 1000, - FERDIE, + i_gateway::MultiAddress { kind: 1, data: FERDIE.into() }, amount, ) .value(1000)