diff --git a/.github/workflows/abi_go_bindings_checker.yml b/.github/workflows/abi_go_bindings_checker.yml new file mode 100644 index 000000000..b7f839c87 --- /dev/null +++ b/.github/workflows/abi_go_bindings_checker.yml @@ -0,0 +1,39 @@ +name: ABI Go Bindings Checker + +on: + pull_request: + branches: + - "*" + +env: + GO_VERSION: "1.20.8" + +jobs: + abi_binding: + name: abi_binding + runs-on: ubuntu-20.04 + + steps: + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Checkout Teleporter repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install forge and generate ABI Go bindings + run: | + BASE_DIR=${XDG_CONFIG_HOME:-$HOME} + curl -L https://foundry.paradigm.xyz | bash + source $HOME/.bashrc + $BASE_DIR/.foundry/bin/foundryup + export GOPATH=$HOME/go + export PATH="$PATH:$BASE_DIR/.foundry/bin" + export PATH="$PATH:$GOPATH/bin" + ./scripts/abi_go_bindings.sh + + - name: Check for clean branch + run: .github/workflows/check_clean_branch.sh diff --git a/.github/workflows/check_clean_branch.sh b/.github/workflows/check_clean_branch.sh new file mode 100755 index 000000000..a892c1ef6 --- /dev/null +++ b/.github/workflows/check_clean_branch.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Exits if any uncommitted changes are found. + +set -o errexit +set -o nounset +set -o pipefail + +# Modifies the index based on the current index. +# Checks to see if merges or updates are needed by checking stat() information. +git update-index --really-refresh > /dev/null +# Checks to see if there are any differences from the index to the current HEAD commit +git diff-index --quiet HEAD \ No newline at end of file diff --git a/abis/BlockHashPublisher/BlockHashPublisher.go b/abis/BlockHashPublisher/BlockHashPublisher.go new file mode 100644 index 000000000..fec9ffd06 --- /dev/null +++ b/abis/BlockHashPublisher/BlockHashPublisher.go @@ -0,0 +1,427 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package blockhashpublisher + +import ( + "errors" + "math/big" + "strings" + + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" + "github.com/ava-labs/subnet-evm/core/types" + "github.com/ava-labs/subnet-evm/interfaces" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = interfaces.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// BlockhashpublisherMetaData contains all meta data concerning the Blockhashpublisher contract. +var BlockhashpublisherMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterMessengerAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationChainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"PublishBlockHash\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"RECEIVE_BLOCK_HASH_REQUIRED_GAS_LIMIT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationChainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"}],\"name\":\"publishLatestBlockHash\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterMessenger\",\"outputs\":[{\"internalType\":\"contractITeleporterMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +// BlockhashpublisherABI is the input ABI used to generate the binding from. +// Deprecated: Use BlockhashpublisherMetaData.ABI instead. +var BlockhashpublisherABI = BlockhashpublisherMetaData.ABI + +// Blockhashpublisher is an auto generated Go binding around an Ethereum contract. +type Blockhashpublisher struct { + BlockhashpublisherCaller // Read-only binding to the contract + BlockhashpublisherTransactor // Write-only binding to the contract + BlockhashpublisherFilterer // Log filterer for contract events +} + +// BlockhashpublisherCaller is an auto generated read-only Go binding around an Ethereum contract. +type BlockhashpublisherCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BlockhashpublisherTransactor is an auto generated write-only Go binding around an Ethereum contract. +type BlockhashpublisherTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BlockhashpublisherFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type BlockhashpublisherFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BlockhashpublisherSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type BlockhashpublisherSession struct { + Contract *Blockhashpublisher // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// BlockhashpublisherCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type BlockhashpublisherCallerSession struct { + Contract *BlockhashpublisherCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// BlockhashpublisherTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type BlockhashpublisherTransactorSession struct { + Contract *BlockhashpublisherTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// BlockhashpublisherRaw is an auto generated low-level Go binding around an Ethereum contract. +type BlockhashpublisherRaw struct { + Contract *Blockhashpublisher // Generic contract binding to access the raw methods on +} + +// BlockhashpublisherCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type BlockhashpublisherCallerRaw struct { + Contract *BlockhashpublisherCaller // Generic read-only contract binding to access the raw methods on +} + +// BlockhashpublisherTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type BlockhashpublisherTransactorRaw struct { + Contract *BlockhashpublisherTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewBlockhashpublisher creates a new instance of Blockhashpublisher, bound to a specific deployed contract. +func NewBlockhashpublisher(address common.Address, backend bind.ContractBackend) (*Blockhashpublisher, error) { + contract, err := bindBlockhashpublisher(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Blockhashpublisher{BlockhashpublisherCaller: BlockhashpublisherCaller{contract: contract}, BlockhashpublisherTransactor: BlockhashpublisherTransactor{contract: contract}, BlockhashpublisherFilterer: BlockhashpublisherFilterer{contract: contract}}, nil +} + +// NewBlockhashpublisherCaller creates a new read-only instance of Blockhashpublisher, bound to a specific deployed contract. +func NewBlockhashpublisherCaller(address common.Address, caller bind.ContractCaller) (*BlockhashpublisherCaller, error) { + contract, err := bindBlockhashpublisher(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &BlockhashpublisherCaller{contract: contract}, nil +} + +// NewBlockhashpublisherTransactor creates a new write-only instance of Blockhashpublisher, bound to a specific deployed contract. +func NewBlockhashpublisherTransactor(address common.Address, transactor bind.ContractTransactor) (*BlockhashpublisherTransactor, error) { + contract, err := bindBlockhashpublisher(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &BlockhashpublisherTransactor{contract: contract}, nil +} + +// NewBlockhashpublisherFilterer creates a new log filterer instance of Blockhashpublisher, bound to a specific deployed contract. +func NewBlockhashpublisherFilterer(address common.Address, filterer bind.ContractFilterer) (*BlockhashpublisherFilterer, error) { + contract, err := bindBlockhashpublisher(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &BlockhashpublisherFilterer{contract: contract}, nil +} + +// bindBlockhashpublisher binds a generic wrapper to an already deployed contract. +func bindBlockhashpublisher(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := BlockhashpublisherMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Blockhashpublisher *BlockhashpublisherRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Blockhashpublisher.Contract.BlockhashpublisherCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Blockhashpublisher *BlockhashpublisherRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Blockhashpublisher.Contract.BlockhashpublisherTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Blockhashpublisher *BlockhashpublisherRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Blockhashpublisher.Contract.BlockhashpublisherTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Blockhashpublisher *BlockhashpublisherCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Blockhashpublisher.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Blockhashpublisher *BlockhashpublisherTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Blockhashpublisher.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Blockhashpublisher *BlockhashpublisherTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Blockhashpublisher.Contract.contract.Transact(opts, method, params...) +} + +// RECEIVEBLOCKHASHREQUIREDGASLIMIT is a free data retrieval call binding the contract method 0x18aef19b. +// +// Solidity: function RECEIVE_BLOCK_HASH_REQUIRED_GAS_LIMIT() view returns(uint256) +func (_Blockhashpublisher *BlockhashpublisherCaller) RECEIVEBLOCKHASHREQUIREDGASLIMIT(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Blockhashpublisher.contract.Call(opts, &out, "RECEIVE_BLOCK_HASH_REQUIRED_GAS_LIMIT") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// RECEIVEBLOCKHASHREQUIREDGASLIMIT is a free data retrieval call binding the contract method 0x18aef19b. +// +// Solidity: function RECEIVE_BLOCK_HASH_REQUIRED_GAS_LIMIT() view returns(uint256) +func (_Blockhashpublisher *BlockhashpublisherSession) RECEIVEBLOCKHASHREQUIREDGASLIMIT() (*big.Int, error) { + return _Blockhashpublisher.Contract.RECEIVEBLOCKHASHREQUIREDGASLIMIT(&_Blockhashpublisher.CallOpts) +} + +// RECEIVEBLOCKHASHREQUIREDGASLIMIT is a free data retrieval call binding the contract method 0x18aef19b. +// +// Solidity: function RECEIVE_BLOCK_HASH_REQUIRED_GAS_LIMIT() view returns(uint256) +func (_Blockhashpublisher *BlockhashpublisherCallerSession) RECEIVEBLOCKHASHREQUIREDGASLIMIT() (*big.Int, error) { + return _Blockhashpublisher.Contract.RECEIVEBLOCKHASHREQUIREDGASLIMIT(&_Blockhashpublisher.CallOpts) +} + +// TeleporterMessenger is a free data retrieval call binding the contract method 0x9b3e5803. +// +// Solidity: function teleporterMessenger() view returns(address) +func (_Blockhashpublisher *BlockhashpublisherCaller) TeleporterMessenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Blockhashpublisher.contract.Call(opts, &out, "teleporterMessenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// TeleporterMessenger is a free data retrieval call binding the contract method 0x9b3e5803. +// +// Solidity: function teleporterMessenger() view returns(address) +func (_Blockhashpublisher *BlockhashpublisherSession) TeleporterMessenger() (common.Address, error) { + return _Blockhashpublisher.Contract.TeleporterMessenger(&_Blockhashpublisher.CallOpts) +} + +// TeleporterMessenger is a free data retrieval call binding the contract method 0x9b3e5803. +// +// Solidity: function teleporterMessenger() view returns(address) +func (_Blockhashpublisher *BlockhashpublisherCallerSession) TeleporterMessenger() (common.Address, error) { + return _Blockhashpublisher.Contract.TeleporterMessenger(&_Blockhashpublisher.CallOpts) +} + +// PublishLatestBlockHash is a paid mutator transaction binding the contract method 0x82ab2b86. +// +// Solidity: function publishLatestBlockHash(bytes32 destinationChainID, address destinationAddress) returns(uint256 messageID) +func (_Blockhashpublisher *BlockhashpublisherTransactor) PublishLatestBlockHash(opts *bind.TransactOpts, destinationChainID [32]byte, destinationAddress common.Address) (*types.Transaction, error) { + return _Blockhashpublisher.contract.Transact(opts, "publishLatestBlockHash", destinationChainID, destinationAddress) +} + +// PublishLatestBlockHash is a paid mutator transaction binding the contract method 0x82ab2b86. +// +// Solidity: function publishLatestBlockHash(bytes32 destinationChainID, address destinationAddress) returns(uint256 messageID) +func (_Blockhashpublisher *BlockhashpublisherSession) PublishLatestBlockHash(destinationChainID [32]byte, destinationAddress common.Address) (*types.Transaction, error) { + return _Blockhashpublisher.Contract.PublishLatestBlockHash(&_Blockhashpublisher.TransactOpts, destinationChainID, destinationAddress) +} + +// PublishLatestBlockHash is a paid mutator transaction binding the contract method 0x82ab2b86. +// +// Solidity: function publishLatestBlockHash(bytes32 destinationChainID, address destinationAddress) returns(uint256 messageID) +func (_Blockhashpublisher *BlockhashpublisherTransactorSession) PublishLatestBlockHash(destinationChainID [32]byte, destinationAddress common.Address) (*types.Transaction, error) { + return _Blockhashpublisher.Contract.PublishLatestBlockHash(&_Blockhashpublisher.TransactOpts, destinationChainID, destinationAddress) +} + +// BlockhashpublisherPublishBlockHashIterator is returned from FilterPublishBlockHash and is used to iterate over the raw logs and unpacked data for PublishBlockHash events raised by the Blockhashpublisher contract. +type BlockhashpublisherPublishBlockHashIterator struct { + Event *BlockhashpublisherPublishBlockHash // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *BlockhashpublisherPublishBlockHashIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(BlockhashpublisherPublishBlockHash) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(BlockhashpublisherPublishBlockHash) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *BlockhashpublisherPublishBlockHashIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BlockhashpublisherPublishBlockHashIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BlockhashpublisherPublishBlockHash represents a PublishBlockHash event raised by the Blockhashpublisher contract. +type BlockhashpublisherPublishBlockHash struct { + DestinationChainID [32]byte + DestinationAddress common.Address + BlockHeight *big.Int + BlockHash [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPublishBlockHash is a free log retrieval operation binding the contract event 0xe13623d33d18131ce960c33b1282ceac1fe7b5ccfcf7f8c0f6dad32dd61e3bdd. +// +// Solidity: event PublishBlockHash(bytes32 indexed destinationChainID, address indexed destinationAddress, uint256 indexed blockHeight, bytes32 blockHash) +func (_Blockhashpublisher *BlockhashpublisherFilterer) FilterPublishBlockHash(opts *bind.FilterOpts, destinationChainID [][32]byte, destinationAddress []common.Address, blockHeight []*big.Int) (*BlockhashpublisherPublishBlockHashIterator, error) { + + var destinationChainIDRule []interface{} + for _, destinationChainIDItem := range destinationChainID { + destinationChainIDRule = append(destinationChainIDRule, destinationChainIDItem) + } + var destinationAddressRule []interface{} + for _, destinationAddressItem := range destinationAddress { + destinationAddressRule = append(destinationAddressRule, destinationAddressItem) + } + var blockHeightRule []interface{} + for _, blockHeightItem := range blockHeight { + blockHeightRule = append(blockHeightRule, blockHeightItem) + } + + logs, sub, err := _Blockhashpublisher.contract.FilterLogs(opts, "PublishBlockHash", destinationChainIDRule, destinationAddressRule, blockHeightRule) + if err != nil { + return nil, err + } + return &BlockhashpublisherPublishBlockHashIterator{contract: _Blockhashpublisher.contract, event: "PublishBlockHash", logs: logs, sub: sub}, nil +} + +// WatchPublishBlockHash is a free log subscription operation binding the contract event 0xe13623d33d18131ce960c33b1282ceac1fe7b5ccfcf7f8c0f6dad32dd61e3bdd. +// +// Solidity: event PublishBlockHash(bytes32 indexed destinationChainID, address indexed destinationAddress, uint256 indexed blockHeight, bytes32 blockHash) +func (_Blockhashpublisher *BlockhashpublisherFilterer) WatchPublishBlockHash(opts *bind.WatchOpts, sink chan<- *BlockhashpublisherPublishBlockHash, destinationChainID [][32]byte, destinationAddress []common.Address, blockHeight []*big.Int) (event.Subscription, error) { + + var destinationChainIDRule []interface{} + for _, destinationChainIDItem := range destinationChainID { + destinationChainIDRule = append(destinationChainIDRule, destinationChainIDItem) + } + var destinationAddressRule []interface{} + for _, destinationAddressItem := range destinationAddress { + destinationAddressRule = append(destinationAddressRule, destinationAddressItem) + } + var blockHeightRule []interface{} + for _, blockHeightItem := range blockHeight { + blockHeightRule = append(blockHeightRule, blockHeightItem) + } + + logs, sub, err := _Blockhashpublisher.contract.WatchLogs(opts, "PublishBlockHash", destinationChainIDRule, destinationAddressRule, blockHeightRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(BlockhashpublisherPublishBlockHash) + if err := _Blockhashpublisher.contract.UnpackLog(event, "PublishBlockHash", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParsePublishBlockHash is a log parse operation binding the contract event 0xe13623d33d18131ce960c33b1282ceac1fe7b5ccfcf7f8c0f6dad32dd61e3bdd. +// +// Solidity: event PublishBlockHash(bytes32 indexed destinationChainID, address indexed destinationAddress, uint256 indexed blockHeight, bytes32 blockHash) +func (_Blockhashpublisher *BlockhashpublisherFilterer) ParsePublishBlockHash(log types.Log) (*BlockhashpublisherPublishBlockHash, error) { + event := new(BlockhashpublisherPublishBlockHash) + if err := _Blockhashpublisher.contract.UnpackLog(event, "PublishBlockHash", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/abis/BlockHashReceiver/BlockHashReceiver.go b/abis/BlockHashReceiver/BlockHashReceiver.go new file mode 100644 index 000000000..08964d097 --- /dev/null +++ b/abis/BlockHashReceiver/BlockHashReceiver.go @@ -0,0 +1,565 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package blockhashreceiver + +import ( + "errors" + "math/big" + "strings" + + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" + "github.com/ava-labs/subnet-evm/core/types" + "github.com/ava-labs/subnet-evm/interfaces" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = interfaces.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// BlockhashreceiverMetaData contains all meta data concerning the Blockhashreceiver contract. +var BlockhashreceiverMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterMessengerAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"publisherChainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"publisherContractAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidSourceChainID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSourceChainPublisher\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"originChainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"ReceiveBlockHash\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"getLatestBlockInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"height\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestBlockHeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originChainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sourceChainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sourcePublisherContractAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterMessenger\",\"outputs\":[{\"internalType\":\"contractITeleporterMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +// BlockhashreceiverABI is the input ABI used to generate the binding from. +// Deprecated: Use BlockhashreceiverMetaData.ABI instead. +var BlockhashreceiverABI = BlockhashreceiverMetaData.ABI + +// Blockhashreceiver is an auto generated Go binding around an Ethereum contract. +type Blockhashreceiver struct { + BlockhashreceiverCaller // Read-only binding to the contract + BlockhashreceiverTransactor // Write-only binding to the contract + BlockhashreceiverFilterer // Log filterer for contract events +} + +// BlockhashreceiverCaller is an auto generated read-only Go binding around an Ethereum contract. +type BlockhashreceiverCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BlockhashreceiverTransactor is an auto generated write-only Go binding around an Ethereum contract. +type BlockhashreceiverTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BlockhashreceiverFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type BlockhashreceiverFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BlockhashreceiverSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type BlockhashreceiverSession struct { + Contract *Blockhashreceiver // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// BlockhashreceiverCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type BlockhashreceiverCallerSession struct { + Contract *BlockhashreceiverCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// BlockhashreceiverTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type BlockhashreceiverTransactorSession struct { + Contract *BlockhashreceiverTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// BlockhashreceiverRaw is an auto generated low-level Go binding around an Ethereum contract. +type BlockhashreceiverRaw struct { + Contract *Blockhashreceiver // Generic contract binding to access the raw methods on +} + +// BlockhashreceiverCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type BlockhashreceiverCallerRaw struct { + Contract *BlockhashreceiverCaller // Generic read-only contract binding to access the raw methods on +} + +// BlockhashreceiverTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type BlockhashreceiverTransactorRaw struct { + Contract *BlockhashreceiverTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewBlockhashreceiver creates a new instance of Blockhashreceiver, bound to a specific deployed contract. +func NewBlockhashreceiver(address common.Address, backend bind.ContractBackend) (*Blockhashreceiver, error) { + contract, err := bindBlockhashreceiver(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Blockhashreceiver{BlockhashreceiverCaller: BlockhashreceiverCaller{contract: contract}, BlockhashreceiverTransactor: BlockhashreceiverTransactor{contract: contract}, BlockhashreceiverFilterer: BlockhashreceiverFilterer{contract: contract}}, nil +} + +// NewBlockhashreceiverCaller creates a new read-only instance of Blockhashreceiver, bound to a specific deployed contract. +func NewBlockhashreceiverCaller(address common.Address, caller bind.ContractCaller) (*BlockhashreceiverCaller, error) { + contract, err := bindBlockhashreceiver(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &BlockhashreceiverCaller{contract: contract}, nil +} + +// NewBlockhashreceiverTransactor creates a new write-only instance of Blockhashreceiver, bound to a specific deployed contract. +func NewBlockhashreceiverTransactor(address common.Address, transactor bind.ContractTransactor) (*BlockhashreceiverTransactor, error) { + contract, err := bindBlockhashreceiver(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &BlockhashreceiverTransactor{contract: contract}, nil +} + +// NewBlockhashreceiverFilterer creates a new log filterer instance of Blockhashreceiver, bound to a specific deployed contract. +func NewBlockhashreceiverFilterer(address common.Address, filterer bind.ContractFilterer) (*BlockhashreceiverFilterer, error) { + contract, err := bindBlockhashreceiver(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &BlockhashreceiverFilterer{contract: contract}, nil +} + +// bindBlockhashreceiver binds a generic wrapper to an already deployed contract. +func bindBlockhashreceiver(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := BlockhashreceiverMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Blockhashreceiver *BlockhashreceiverRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Blockhashreceiver.Contract.BlockhashreceiverCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Blockhashreceiver *BlockhashreceiverRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Blockhashreceiver.Contract.BlockhashreceiverTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Blockhashreceiver *BlockhashreceiverRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Blockhashreceiver.Contract.BlockhashreceiverTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Blockhashreceiver *BlockhashreceiverCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Blockhashreceiver.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Blockhashreceiver *BlockhashreceiverTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Blockhashreceiver.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Blockhashreceiver *BlockhashreceiverTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Blockhashreceiver.Contract.contract.Transact(opts, method, params...) +} + +// GetLatestBlockInfo is a free data retrieval call binding the contract method 0xb17810be. +// +// Solidity: function getLatestBlockInfo() view returns(uint256 height, bytes32 hash) +func (_Blockhashreceiver *BlockhashreceiverCaller) GetLatestBlockInfo(opts *bind.CallOpts) (struct { + Height *big.Int + Hash [32]byte +}, error) { + var out []interface{} + err := _Blockhashreceiver.contract.Call(opts, &out, "getLatestBlockInfo") + + outstruct := new(struct { + Height *big.Int + Hash [32]byte + }) + if err != nil { + return *outstruct, err + } + + outstruct.Height = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Hash = *abi.ConvertType(out[1], new([32]byte)).(*[32]byte) + + return *outstruct, err + +} + +// GetLatestBlockInfo is a free data retrieval call binding the contract method 0xb17810be. +// +// Solidity: function getLatestBlockInfo() view returns(uint256 height, bytes32 hash) +func (_Blockhashreceiver *BlockhashreceiverSession) GetLatestBlockInfo() (struct { + Height *big.Int + Hash [32]byte +}, error) { + return _Blockhashreceiver.Contract.GetLatestBlockInfo(&_Blockhashreceiver.CallOpts) +} + +// GetLatestBlockInfo is a free data retrieval call binding the contract method 0xb17810be. +// +// Solidity: function getLatestBlockInfo() view returns(uint256 height, bytes32 hash) +func (_Blockhashreceiver *BlockhashreceiverCallerSession) GetLatestBlockInfo() (struct { + Height *big.Int + Hash [32]byte +}, error) { + return _Blockhashreceiver.Contract.GetLatestBlockInfo(&_Blockhashreceiver.CallOpts) +} + +// LatestBlockHash is a free data retrieval call binding the contract method 0x6c4f6ba9. +// +// Solidity: function latestBlockHash() view returns(bytes32) +func (_Blockhashreceiver *BlockhashreceiverCaller) LatestBlockHash(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _Blockhashreceiver.contract.Call(opts, &out, "latestBlockHash") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// LatestBlockHash is a free data retrieval call binding the contract method 0x6c4f6ba9. +// +// Solidity: function latestBlockHash() view returns(bytes32) +func (_Blockhashreceiver *BlockhashreceiverSession) LatestBlockHash() ([32]byte, error) { + return _Blockhashreceiver.Contract.LatestBlockHash(&_Blockhashreceiver.CallOpts) +} + +// LatestBlockHash is a free data retrieval call binding the contract method 0x6c4f6ba9. +// +// Solidity: function latestBlockHash() view returns(bytes32) +func (_Blockhashreceiver *BlockhashreceiverCallerSession) LatestBlockHash() ([32]byte, error) { + return _Blockhashreceiver.Contract.LatestBlockHash(&_Blockhashreceiver.CallOpts) +} + +// LatestBlockHeight is a free data retrieval call binding the contract method 0xf3f39ee5. +// +// Solidity: function latestBlockHeight() view returns(uint256) +func (_Blockhashreceiver *BlockhashreceiverCaller) LatestBlockHeight(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Blockhashreceiver.contract.Call(opts, &out, "latestBlockHeight") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// LatestBlockHeight is a free data retrieval call binding the contract method 0xf3f39ee5. +// +// Solidity: function latestBlockHeight() view returns(uint256) +func (_Blockhashreceiver *BlockhashreceiverSession) LatestBlockHeight() (*big.Int, error) { + return _Blockhashreceiver.Contract.LatestBlockHeight(&_Blockhashreceiver.CallOpts) +} + +// LatestBlockHeight is a free data retrieval call binding the contract method 0xf3f39ee5. +// +// Solidity: function latestBlockHeight() view returns(uint256) +func (_Blockhashreceiver *BlockhashreceiverCallerSession) LatestBlockHeight() (*big.Int, error) { + return _Blockhashreceiver.Contract.LatestBlockHeight(&_Blockhashreceiver.CallOpts) +} + +// SourceChainID is a free data retrieval call binding the contract method 0x4c335368. +// +// Solidity: function sourceChainID() view returns(bytes32) +func (_Blockhashreceiver *BlockhashreceiverCaller) SourceChainID(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _Blockhashreceiver.contract.Call(opts, &out, "sourceChainID") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// SourceChainID is a free data retrieval call binding the contract method 0x4c335368. +// +// Solidity: function sourceChainID() view returns(bytes32) +func (_Blockhashreceiver *BlockhashreceiverSession) SourceChainID() ([32]byte, error) { + return _Blockhashreceiver.Contract.SourceChainID(&_Blockhashreceiver.CallOpts) +} + +// SourceChainID is a free data retrieval call binding the contract method 0x4c335368. +// +// Solidity: function sourceChainID() view returns(bytes32) +func (_Blockhashreceiver *BlockhashreceiverCallerSession) SourceChainID() ([32]byte, error) { + return _Blockhashreceiver.Contract.SourceChainID(&_Blockhashreceiver.CallOpts) +} + +// SourcePublisherContractAddress is a free data retrieval call binding the contract method 0x79a0710c. +// +// Solidity: function sourcePublisherContractAddress() view returns(address) +func (_Blockhashreceiver *BlockhashreceiverCaller) SourcePublisherContractAddress(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Blockhashreceiver.contract.Call(opts, &out, "sourcePublisherContractAddress") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// SourcePublisherContractAddress is a free data retrieval call binding the contract method 0x79a0710c. +// +// Solidity: function sourcePublisherContractAddress() view returns(address) +func (_Blockhashreceiver *BlockhashreceiverSession) SourcePublisherContractAddress() (common.Address, error) { + return _Blockhashreceiver.Contract.SourcePublisherContractAddress(&_Blockhashreceiver.CallOpts) +} + +// SourcePublisherContractAddress is a free data retrieval call binding the contract method 0x79a0710c. +// +// Solidity: function sourcePublisherContractAddress() view returns(address) +func (_Blockhashreceiver *BlockhashreceiverCallerSession) SourcePublisherContractAddress() (common.Address, error) { + return _Blockhashreceiver.Contract.SourcePublisherContractAddress(&_Blockhashreceiver.CallOpts) +} + +// TeleporterMessenger is a free data retrieval call binding the contract method 0x9b3e5803. +// +// Solidity: function teleporterMessenger() view returns(address) +func (_Blockhashreceiver *BlockhashreceiverCaller) TeleporterMessenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Blockhashreceiver.contract.Call(opts, &out, "teleporterMessenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// TeleporterMessenger is a free data retrieval call binding the contract method 0x9b3e5803. +// +// Solidity: function teleporterMessenger() view returns(address) +func (_Blockhashreceiver *BlockhashreceiverSession) TeleporterMessenger() (common.Address, error) { + return _Blockhashreceiver.Contract.TeleporterMessenger(&_Blockhashreceiver.CallOpts) +} + +// TeleporterMessenger is a free data retrieval call binding the contract method 0x9b3e5803. +// +// Solidity: function teleporterMessenger() view returns(address) +func (_Blockhashreceiver *BlockhashreceiverCallerSession) TeleporterMessenger() (common.Address, error) { + return _Blockhashreceiver.Contract.TeleporterMessenger(&_Blockhashreceiver.CallOpts) +} + +// ReceiveTeleporterMessage is a paid mutator transaction binding the contract method 0xc868efaa. +// +// Solidity: function receiveTeleporterMessage(bytes32 originChainID, address originSenderAddress, bytes message) returns() +func (_Blockhashreceiver *BlockhashreceiverTransactor) ReceiveTeleporterMessage(opts *bind.TransactOpts, originChainID [32]byte, originSenderAddress common.Address, message []byte) (*types.Transaction, error) { + return _Blockhashreceiver.contract.Transact(opts, "receiveTeleporterMessage", originChainID, originSenderAddress, message) +} + +// ReceiveTeleporterMessage is a paid mutator transaction binding the contract method 0xc868efaa. +// +// Solidity: function receiveTeleporterMessage(bytes32 originChainID, address originSenderAddress, bytes message) returns() +func (_Blockhashreceiver *BlockhashreceiverSession) ReceiveTeleporterMessage(originChainID [32]byte, originSenderAddress common.Address, message []byte) (*types.Transaction, error) { + return _Blockhashreceiver.Contract.ReceiveTeleporterMessage(&_Blockhashreceiver.TransactOpts, originChainID, originSenderAddress, message) +} + +// ReceiveTeleporterMessage is a paid mutator transaction binding the contract method 0xc868efaa. +// +// Solidity: function receiveTeleporterMessage(bytes32 originChainID, address originSenderAddress, bytes message) returns() +func (_Blockhashreceiver *BlockhashreceiverTransactorSession) ReceiveTeleporterMessage(originChainID [32]byte, originSenderAddress common.Address, message []byte) (*types.Transaction, error) { + return _Blockhashreceiver.Contract.ReceiveTeleporterMessage(&_Blockhashreceiver.TransactOpts, originChainID, originSenderAddress, message) +} + +// BlockhashreceiverReceiveBlockHashIterator is returned from FilterReceiveBlockHash and is used to iterate over the raw logs and unpacked data for ReceiveBlockHash events raised by the Blockhashreceiver contract. +type BlockhashreceiverReceiveBlockHashIterator struct { + Event *BlockhashreceiverReceiveBlockHash // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *BlockhashreceiverReceiveBlockHashIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(BlockhashreceiverReceiveBlockHash) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(BlockhashreceiverReceiveBlockHash) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *BlockhashreceiverReceiveBlockHashIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BlockhashreceiverReceiveBlockHashIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BlockhashreceiverReceiveBlockHash represents a ReceiveBlockHash event raised by the Blockhashreceiver contract. +type BlockhashreceiverReceiveBlockHash struct { + OriginChainID [32]byte + OriginSenderAddress common.Address + BlockHeight *big.Int + BlockHash [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterReceiveBlockHash is a free log retrieval operation binding the contract event 0x0bca78aa82d7575f42e4b4b2fe04765a4b2f3661786403788ce987e065ac590d. +// +// Solidity: event ReceiveBlockHash(bytes32 indexed originChainID, address indexed originSenderAddress, uint256 indexed blockHeight, bytes32 blockHash) +func (_Blockhashreceiver *BlockhashreceiverFilterer) FilterReceiveBlockHash(opts *bind.FilterOpts, originChainID [][32]byte, originSenderAddress []common.Address, blockHeight []*big.Int) (*BlockhashreceiverReceiveBlockHashIterator, error) { + + var originChainIDRule []interface{} + for _, originChainIDItem := range originChainID { + originChainIDRule = append(originChainIDRule, originChainIDItem) + } + var originSenderAddressRule []interface{} + for _, originSenderAddressItem := range originSenderAddress { + originSenderAddressRule = append(originSenderAddressRule, originSenderAddressItem) + } + var blockHeightRule []interface{} + for _, blockHeightItem := range blockHeight { + blockHeightRule = append(blockHeightRule, blockHeightItem) + } + + logs, sub, err := _Blockhashreceiver.contract.FilterLogs(opts, "ReceiveBlockHash", originChainIDRule, originSenderAddressRule, blockHeightRule) + if err != nil { + return nil, err + } + return &BlockhashreceiverReceiveBlockHashIterator{contract: _Blockhashreceiver.contract, event: "ReceiveBlockHash", logs: logs, sub: sub}, nil +} + +// WatchReceiveBlockHash is a free log subscription operation binding the contract event 0x0bca78aa82d7575f42e4b4b2fe04765a4b2f3661786403788ce987e065ac590d. +// +// Solidity: event ReceiveBlockHash(bytes32 indexed originChainID, address indexed originSenderAddress, uint256 indexed blockHeight, bytes32 blockHash) +func (_Blockhashreceiver *BlockhashreceiverFilterer) WatchReceiveBlockHash(opts *bind.WatchOpts, sink chan<- *BlockhashreceiverReceiveBlockHash, originChainID [][32]byte, originSenderAddress []common.Address, blockHeight []*big.Int) (event.Subscription, error) { + + var originChainIDRule []interface{} + for _, originChainIDItem := range originChainID { + originChainIDRule = append(originChainIDRule, originChainIDItem) + } + var originSenderAddressRule []interface{} + for _, originSenderAddressItem := range originSenderAddress { + originSenderAddressRule = append(originSenderAddressRule, originSenderAddressItem) + } + var blockHeightRule []interface{} + for _, blockHeightItem := range blockHeight { + blockHeightRule = append(blockHeightRule, blockHeightItem) + } + + logs, sub, err := _Blockhashreceiver.contract.WatchLogs(opts, "ReceiveBlockHash", originChainIDRule, originSenderAddressRule, blockHeightRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(BlockhashreceiverReceiveBlockHash) + if err := _Blockhashreceiver.contract.UnpackLog(event, "ReceiveBlockHash", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseReceiveBlockHash is a log parse operation binding the contract event 0x0bca78aa82d7575f42e4b4b2fe04765a4b2f3661786403788ce987e065ac590d. +// +// Solidity: event ReceiveBlockHash(bytes32 indexed originChainID, address indexed originSenderAddress, uint256 indexed blockHeight, bytes32 blockHash) +func (_Blockhashreceiver *BlockhashreceiverFilterer) ParseReceiveBlockHash(log types.Log) (*BlockhashreceiverReceiveBlockHash, error) { + event := new(BlockhashreceiverReceiveBlockHash) + if err := _Blockhashreceiver.contract.UnpackLog(event, "ReceiveBlockHash", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/abis/BridgeToken/BridgeToken.go b/abis/BridgeToken/BridgeToken.go new file mode 100644 index 000000000..15cb47a61 --- /dev/null +++ b/abis/BridgeToken/BridgeToken.go @@ -0,0 +1,967 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bridgetoken + +import ( + "errors" + "math/big" + "strings" + + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" + "github.com/ava-labs/subnet-evm/core/types" + "github.com/ava-labs/subnet-evm/interfaces" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = interfaces.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// BridgetokenMetaData contains all meta data concerning the Bridgetoken contract. +var BridgetokenMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"sourceChainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"sourceBridge\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sourceAsset\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"tokenName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"tokenSymbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"tokenDecimals\",\"type\":\"uint8\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidSourceAsset\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSourceBridgeAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSourceChainID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bridgeContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeAsset\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeBridge\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nativeChainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// BridgetokenABI is the input ABI used to generate the binding from. +// Deprecated: Use BridgetokenMetaData.ABI instead. +var BridgetokenABI = BridgetokenMetaData.ABI + +// Bridgetoken is an auto generated Go binding around an Ethereum contract. +type Bridgetoken struct { + BridgetokenCaller // Read-only binding to the contract + BridgetokenTransactor // Write-only binding to the contract + BridgetokenFilterer // Log filterer for contract events +} + +// BridgetokenCaller is an auto generated read-only Go binding around an Ethereum contract. +type BridgetokenCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BridgetokenTransactor is an auto generated write-only Go binding around an Ethereum contract. +type BridgetokenTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BridgetokenFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type BridgetokenFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// BridgetokenSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type BridgetokenSession struct { + Contract *Bridgetoken // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// BridgetokenCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type BridgetokenCallerSession struct { + Contract *BridgetokenCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// BridgetokenTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type BridgetokenTransactorSession struct { + Contract *BridgetokenTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// BridgetokenRaw is an auto generated low-level Go binding around an Ethereum contract. +type BridgetokenRaw struct { + Contract *Bridgetoken // Generic contract binding to access the raw methods on +} + +// BridgetokenCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type BridgetokenCallerRaw struct { + Contract *BridgetokenCaller // Generic read-only contract binding to access the raw methods on +} + +// BridgetokenTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type BridgetokenTransactorRaw struct { + Contract *BridgetokenTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewBridgetoken creates a new instance of Bridgetoken, bound to a specific deployed contract. +func NewBridgetoken(address common.Address, backend bind.ContractBackend) (*Bridgetoken, error) { + contract, err := bindBridgetoken(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Bridgetoken{BridgetokenCaller: BridgetokenCaller{contract: contract}, BridgetokenTransactor: BridgetokenTransactor{contract: contract}, BridgetokenFilterer: BridgetokenFilterer{contract: contract}}, nil +} + +// NewBridgetokenCaller creates a new read-only instance of Bridgetoken, bound to a specific deployed contract. +func NewBridgetokenCaller(address common.Address, caller bind.ContractCaller) (*BridgetokenCaller, error) { + contract, err := bindBridgetoken(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &BridgetokenCaller{contract: contract}, nil +} + +// NewBridgetokenTransactor creates a new write-only instance of Bridgetoken, bound to a specific deployed contract. +func NewBridgetokenTransactor(address common.Address, transactor bind.ContractTransactor) (*BridgetokenTransactor, error) { + contract, err := bindBridgetoken(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &BridgetokenTransactor{contract: contract}, nil +} + +// NewBridgetokenFilterer creates a new log filterer instance of Bridgetoken, bound to a specific deployed contract. +func NewBridgetokenFilterer(address common.Address, filterer bind.ContractFilterer) (*BridgetokenFilterer, error) { + contract, err := bindBridgetoken(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &BridgetokenFilterer{contract: contract}, nil +} + +// bindBridgetoken binds a generic wrapper to an already deployed contract. +func bindBridgetoken(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := BridgetokenMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Bridgetoken *BridgetokenRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Bridgetoken.Contract.BridgetokenCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Bridgetoken *BridgetokenRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Bridgetoken.Contract.BridgetokenTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Bridgetoken *BridgetokenRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Bridgetoken.Contract.BridgetokenTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Bridgetoken *BridgetokenCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Bridgetoken.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Bridgetoken *BridgetokenTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Bridgetoken.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Bridgetoken *BridgetokenTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Bridgetoken.Contract.contract.Transact(opts, method, params...) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_Bridgetoken *BridgetokenCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var out []interface{} + err := _Bridgetoken.contract.Call(opts, &out, "allowance", owner, spender) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_Bridgetoken *BridgetokenSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _Bridgetoken.Contract.Allowance(&_Bridgetoken.CallOpts, owner, spender) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_Bridgetoken *BridgetokenCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _Bridgetoken.Contract.Allowance(&_Bridgetoken.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_Bridgetoken *BridgetokenCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _Bridgetoken.contract.Call(opts, &out, "balanceOf", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_Bridgetoken *BridgetokenSession) BalanceOf(account common.Address) (*big.Int, error) { + return _Bridgetoken.Contract.BalanceOf(&_Bridgetoken.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_Bridgetoken *BridgetokenCallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _Bridgetoken.Contract.BalanceOf(&_Bridgetoken.CallOpts, account) +} + +// BridgeContract is a free data retrieval call binding the contract method 0xcd596583. +// +// Solidity: function bridgeContract() view returns(address) +func (_Bridgetoken *BridgetokenCaller) BridgeContract(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Bridgetoken.contract.Call(opts, &out, "bridgeContract") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// BridgeContract is a free data retrieval call binding the contract method 0xcd596583. +// +// Solidity: function bridgeContract() view returns(address) +func (_Bridgetoken *BridgetokenSession) BridgeContract() (common.Address, error) { + return _Bridgetoken.Contract.BridgeContract(&_Bridgetoken.CallOpts) +} + +// BridgeContract is a free data retrieval call binding the contract method 0xcd596583. +// +// Solidity: function bridgeContract() view returns(address) +func (_Bridgetoken *BridgetokenCallerSession) BridgeContract() (common.Address, error) { + return _Bridgetoken.Contract.BridgeContract(&_Bridgetoken.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_Bridgetoken *BridgetokenCaller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _Bridgetoken.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_Bridgetoken *BridgetokenSession) Decimals() (uint8, error) { + return _Bridgetoken.Contract.Decimals(&_Bridgetoken.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_Bridgetoken *BridgetokenCallerSession) Decimals() (uint8, error) { + return _Bridgetoken.Contract.Decimals(&_Bridgetoken.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_Bridgetoken *BridgetokenCaller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _Bridgetoken.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_Bridgetoken *BridgetokenSession) Name() (string, error) { + return _Bridgetoken.Contract.Name(&_Bridgetoken.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_Bridgetoken *BridgetokenCallerSession) Name() (string, error) { + return _Bridgetoken.Contract.Name(&_Bridgetoken.CallOpts) +} + +// NativeAsset is a free data retrieval call binding the contract method 0x74d32ad4. +// +// Solidity: function nativeAsset() view returns(address) +func (_Bridgetoken *BridgetokenCaller) NativeAsset(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Bridgetoken.contract.Call(opts, &out, "nativeAsset") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// NativeAsset is a free data retrieval call binding the contract method 0x74d32ad4. +// +// Solidity: function nativeAsset() view returns(address) +func (_Bridgetoken *BridgetokenSession) NativeAsset() (common.Address, error) { + return _Bridgetoken.Contract.NativeAsset(&_Bridgetoken.CallOpts) +} + +// NativeAsset is a free data retrieval call binding the contract method 0x74d32ad4. +// +// Solidity: function nativeAsset() view returns(address) +func (_Bridgetoken *BridgetokenCallerSession) NativeAsset() (common.Address, error) { + return _Bridgetoken.Contract.NativeAsset(&_Bridgetoken.CallOpts) +} + +// NativeBridge is a free data retrieval call binding the contract method 0x1a0b79bf. +// +// Solidity: function nativeBridge() view returns(address) +func (_Bridgetoken *BridgetokenCaller) NativeBridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Bridgetoken.contract.Call(opts, &out, "nativeBridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// NativeBridge is a free data retrieval call binding the contract method 0x1a0b79bf. +// +// Solidity: function nativeBridge() view returns(address) +func (_Bridgetoken *BridgetokenSession) NativeBridge() (common.Address, error) { + return _Bridgetoken.Contract.NativeBridge(&_Bridgetoken.CallOpts) +} + +// NativeBridge is a free data retrieval call binding the contract method 0x1a0b79bf. +// +// Solidity: function nativeBridge() view returns(address) +func (_Bridgetoken *BridgetokenCallerSession) NativeBridge() (common.Address, error) { + return _Bridgetoken.Contract.NativeBridge(&_Bridgetoken.CallOpts) +} + +// NativeChainID is a free data retrieval call binding the contract method 0xd8121a53. +// +// Solidity: function nativeChainID() view returns(bytes32) +func (_Bridgetoken *BridgetokenCaller) NativeChainID(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _Bridgetoken.contract.Call(opts, &out, "nativeChainID") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// NativeChainID is a free data retrieval call binding the contract method 0xd8121a53. +// +// Solidity: function nativeChainID() view returns(bytes32) +func (_Bridgetoken *BridgetokenSession) NativeChainID() ([32]byte, error) { + return _Bridgetoken.Contract.NativeChainID(&_Bridgetoken.CallOpts) +} + +// NativeChainID is a free data retrieval call binding the contract method 0xd8121a53. +// +// Solidity: function nativeChainID() view returns(bytes32) +func (_Bridgetoken *BridgetokenCallerSession) NativeChainID() ([32]byte, error) { + return _Bridgetoken.Contract.NativeChainID(&_Bridgetoken.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_Bridgetoken *BridgetokenCaller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _Bridgetoken.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_Bridgetoken *BridgetokenSession) Symbol() (string, error) { + return _Bridgetoken.Contract.Symbol(&_Bridgetoken.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_Bridgetoken *BridgetokenCallerSession) Symbol() (string, error) { + return _Bridgetoken.Contract.Symbol(&_Bridgetoken.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_Bridgetoken *BridgetokenCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Bridgetoken.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_Bridgetoken *BridgetokenSession) TotalSupply() (*big.Int, error) { + return _Bridgetoken.Contract.TotalSupply(&_Bridgetoken.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_Bridgetoken *BridgetokenCallerSession) TotalSupply() (*big.Int, error) { + return _Bridgetoken.Contract.TotalSupply(&_Bridgetoken.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_Bridgetoken *BridgetokenTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.contract.Transact(opts, "approve", spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_Bridgetoken *BridgetokenSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.Contract.Approve(&_Bridgetoken.TransactOpts, spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_Bridgetoken *BridgetokenTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.Contract.Approve(&_Bridgetoken.TransactOpts, spender, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x42966c68. +// +// Solidity: function burn(uint256 amount) returns() +func (_Bridgetoken *BridgetokenTransactor) Burn(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.contract.Transact(opts, "burn", amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x42966c68. +// +// Solidity: function burn(uint256 amount) returns() +func (_Bridgetoken *BridgetokenSession) Burn(amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.Contract.Burn(&_Bridgetoken.TransactOpts, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x42966c68. +// +// Solidity: function burn(uint256 amount) returns() +func (_Bridgetoken *BridgetokenTransactorSession) Burn(amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.Contract.Burn(&_Bridgetoken.TransactOpts, amount) +} + +// BurnFrom is a paid mutator transaction binding the contract method 0x79cc6790. +// +// Solidity: function burnFrom(address account, uint256 amount) returns() +func (_Bridgetoken *BridgetokenTransactor) BurnFrom(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.contract.Transact(opts, "burnFrom", account, amount) +} + +// BurnFrom is a paid mutator transaction binding the contract method 0x79cc6790. +// +// Solidity: function burnFrom(address account, uint256 amount) returns() +func (_Bridgetoken *BridgetokenSession) BurnFrom(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.Contract.BurnFrom(&_Bridgetoken.TransactOpts, account, amount) +} + +// BurnFrom is a paid mutator transaction binding the contract method 0x79cc6790. +// +// Solidity: function burnFrom(address account, uint256 amount) returns() +func (_Bridgetoken *BridgetokenTransactorSession) BurnFrom(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.Contract.BurnFrom(&_Bridgetoken.TransactOpts, account, amount) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_Bridgetoken *BridgetokenTransactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _Bridgetoken.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_Bridgetoken *BridgetokenSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _Bridgetoken.Contract.DecreaseAllowance(&_Bridgetoken.TransactOpts, spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_Bridgetoken *BridgetokenTransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _Bridgetoken.Contract.DecreaseAllowance(&_Bridgetoken.TransactOpts, spender, subtractedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_Bridgetoken *BridgetokenTransactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _Bridgetoken.contract.Transact(opts, "increaseAllowance", spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_Bridgetoken *BridgetokenSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _Bridgetoken.Contract.IncreaseAllowance(&_Bridgetoken.TransactOpts, spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_Bridgetoken *BridgetokenTransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _Bridgetoken.Contract.IncreaseAllowance(&_Bridgetoken.TransactOpts, spender, addedValue) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address account, uint256 amount) returns() +func (_Bridgetoken *BridgetokenTransactor) Mint(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.contract.Transact(opts, "mint", account, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address account, uint256 amount) returns() +func (_Bridgetoken *BridgetokenSession) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.Contract.Mint(&_Bridgetoken.TransactOpts, account, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address account, uint256 amount) returns() +func (_Bridgetoken *BridgetokenTransactorSession) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.Contract.Mint(&_Bridgetoken.TransactOpts, account, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_Bridgetoken *BridgetokenTransactor) Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.contract.Transact(opts, "transfer", to, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_Bridgetoken *BridgetokenSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.Contract.Transfer(&_Bridgetoken.TransactOpts, to, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_Bridgetoken *BridgetokenTransactorSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.Contract.Transfer(&_Bridgetoken.TransactOpts, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_Bridgetoken *BridgetokenTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.contract.Transact(opts, "transferFrom", from, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_Bridgetoken *BridgetokenSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.Contract.TransferFrom(&_Bridgetoken.TransactOpts, from, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_Bridgetoken *BridgetokenTransactorSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Bridgetoken.Contract.TransferFrom(&_Bridgetoken.TransactOpts, from, to, amount) +} + +// BridgetokenApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the Bridgetoken contract. +type BridgetokenApprovalIterator struct { + Event *BridgetokenApproval // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *BridgetokenApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(BridgetokenApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(BridgetokenApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *BridgetokenApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BridgetokenApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BridgetokenApproval represents a Approval event raised by the Bridgetoken contract. +type BridgetokenApproval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_Bridgetoken *BridgetokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*BridgetokenApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _Bridgetoken.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &BridgetokenApprovalIterator{contract: _Bridgetoken.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_Bridgetoken *BridgetokenFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *BridgetokenApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _Bridgetoken.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(BridgetokenApproval) + if err := _Bridgetoken.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_Bridgetoken *BridgetokenFilterer) ParseApproval(log types.Log) (*BridgetokenApproval, error) { + event := new(BridgetokenApproval) + if err := _Bridgetoken.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// BridgetokenTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the Bridgetoken contract. +type BridgetokenTransferIterator struct { + Event *BridgetokenTransfer // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *BridgetokenTransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(BridgetokenTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(BridgetokenTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *BridgetokenTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BridgetokenTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BridgetokenTransfer represents a Transfer event raised by the Bridgetoken contract. +type BridgetokenTransfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_Bridgetoken *BridgetokenFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*BridgetokenTransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _Bridgetoken.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &BridgetokenTransferIterator{contract: _Bridgetoken.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_Bridgetoken *BridgetokenFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *BridgetokenTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _Bridgetoken.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(BridgetokenTransfer) + if err := _Bridgetoken.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_Bridgetoken *BridgetokenFilterer) ParseTransfer(log types.Log) (*BridgetokenTransfer, error) { + event := new(BridgetokenTransfer) + if err := _Bridgetoken.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/abis/ERC20Bridge/ERC20Bridge.go b/abis/ERC20Bridge/ERC20Bridge.go new file mode 100644 index 000000000..95e3b9997 --- /dev/null +++ b/abis/ERC20Bridge/ERC20Bridge.go @@ -0,0 +1,1284 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package erc20bridge + +import ( + "errors" + "math/big" + "strings" + + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" + "github.com/ava-labs/subnet-evm/core/types" + "github.com/ava-labs/subnet-evm/interfaces" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = interfaces.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// Erc20bridgeMetaData contains all meta data concerning the Erc20bridge contract. +var Erc20bridgeMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterMessengerAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BalanceNotIncreased\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeTokenAddress\",\"type\":\"address\"}],\"name\":\"BridgeTokenAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotBridgeTokenWithinSameChain\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nativeTokenAddress\",\"type\":\"address\"}],\"name\":\"CannotBridgeWrappedToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"adjustedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"}],\"name\":\"InsufficientAdjustedAmount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"totalAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"}],\"name\":\"InsufficientTotalAmount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"currentBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestAmount\",\"type\":\"uint256\"}],\"name\":\"InsufficientWrappedTokenBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAction\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidBridgeTokenAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDestinationBridgeAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRecipientAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTeleporterMessengerAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationChainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"teleporterMessageID\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"nativeChainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nativeBridgeAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nativeContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"bridgeTokenAddress\",\"type\":\"address\"}],\"name\":\"CreateBridgeToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"MintBridgeTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationChainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nativeContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"teleporterMessageID\",\"type\":\"uint256\"}],\"name\":\"SubmitCreateBridgeToken\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CREATE_BRIDGE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINT_BRIDGE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TRANSFER_BRIDGE_TOKENS_REQUIRED_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WARP_PRECOMPILE_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationChainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenContractAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"totalAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"primaryFeeAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"secondaryFeeAmount\",\"type\":\"uint256\"}],\"name\":\"bridgeTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"bridgedBalances\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"currentChainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nativeContractAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"nativeName\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"nativeSymbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"nativeDecimals\",\"type\":\"uint8\"}],\"name\":\"encodeCreateBridgeTokenData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nativeContractAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"bridgeAmount\",\"type\":\"uint256\"}],\"name\":\"encodeMintBridgeTokensData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationChainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nativeContractAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"}],\"name\":\"encodeTransferBridgeTokensData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"nativeToWrappedTokens\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"nativeChainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"nativeBridgeAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationChainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationBridgeAddress\",\"type\":\"address\"},{\"internalType\":\"contractERC20\",\"name\":\"nativeToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"messageFeeAsset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"messageFeeAmount\",\"type\":\"uint256\"}],\"name\":\"submitCreateBridgeToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"submittedBridgeTokenCreations\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterMessenger\",\"outputs\":[{\"internalType\":\"contractITeleporterMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"wrappedTokenContracts\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +// Erc20bridgeABI is the input ABI used to generate the binding from. +// Deprecated: Use Erc20bridgeMetaData.ABI instead. +var Erc20bridgeABI = Erc20bridgeMetaData.ABI + +// Erc20bridge is an auto generated Go binding around an Ethereum contract. +type Erc20bridge struct { + Erc20bridgeCaller // Read-only binding to the contract + Erc20bridgeTransactor // Write-only binding to the contract + Erc20bridgeFilterer // Log filterer for contract events +} + +// Erc20bridgeCaller is an auto generated read-only Go binding around an Ethereum contract. +type Erc20bridgeCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Erc20bridgeTransactor is an auto generated write-only Go binding around an Ethereum contract. +type Erc20bridgeTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Erc20bridgeFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type Erc20bridgeFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Erc20bridgeSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type Erc20bridgeSession struct { + Contract *Erc20bridge // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// Erc20bridgeCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type Erc20bridgeCallerSession struct { + Contract *Erc20bridgeCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// Erc20bridgeTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type Erc20bridgeTransactorSession struct { + Contract *Erc20bridgeTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// Erc20bridgeRaw is an auto generated low-level Go binding around an Ethereum contract. +type Erc20bridgeRaw struct { + Contract *Erc20bridge // Generic contract binding to access the raw methods on +} + +// Erc20bridgeCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type Erc20bridgeCallerRaw struct { + Contract *Erc20bridgeCaller // Generic read-only contract binding to access the raw methods on +} + +// Erc20bridgeTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type Erc20bridgeTransactorRaw struct { + Contract *Erc20bridgeTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewErc20bridge creates a new instance of Erc20bridge, bound to a specific deployed contract. +func NewErc20bridge(address common.Address, backend bind.ContractBackend) (*Erc20bridge, error) { + contract, err := bindErc20bridge(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Erc20bridge{Erc20bridgeCaller: Erc20bridgeCaller{contract: contract}, Erc20bridgeTransactor: Erc20bridgeTransactor{contract: contract}, Erc20bridgeFilterer: Erc20bridgeFilterer{contract: contract}}, nil +} + +// NewErc20bridgeCaller creates a new read-only instance of Erc20bridge, bound to a specific deployed contract. +func NewErc20bridgeCaller(address common.Address, caller bind.ContractCaller) (*Erc20bridgeCaller, error) { + contract, err := bindErc20bridge(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &Erc20bridgeCaller{contract: contract}, nil +} + +// NewErc20bridgeTransactor creates a new write-only instance of Erc20bridge, bound to a specific deployed contract. +func NewErc20bridgeTransactor(address common.Address, transactor bind.ContractTransactor) (*Erc20bridgeTransactor, error) { + contract, err := bindErc20bridge(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &Erc20bridgeTransactor{contract: contract}, nil +} + +// NewErc20bridgeFilterer creates a new log filterer instance of Erc20bridge, bound to a specific deployed contract. +func NewErc20bridgeFilterer(address common.Address, filterer bind.ContractFilterer) (*Erc20bridgeFilterer, error) { + contract, err := bindErc20bridge(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &Erc20bridgeFilterer{contract: contract}, nil +} + +// bindErc20bridge binds a generic wrapper to an already deployed contract. +func bindErc20bridge(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := Erc20bridgeMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Erc20bridge *Erc20bridgeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Erc20bridge.Contract.Erc20bridgeCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Erc20bridge *Erc20bridgeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Erc20bridge.Contract.Erc20bridgeTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Erc20bridge *Erc20bridgeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Erc20bridge.Contract.Erc20bridgeTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Erc20bridge *Erc20bridgeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Erc20bridge.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Erc20bridge *Erc20bridgeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Erc20bridge.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Erc20bridge *Erc20bridgeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Erc20bridge.Contract.contract.Transact(opts, method, params...) +} + +// CREATEBRIDGETOKENSREQUIREDGAS is a free data retrieval call binding the contract method 0x5f217bcc. +// +// Solidity: function CREATE_BRIDGE_TOKENS_REQUIRED_GAS() view returns(uint256) +func (_Erc20bridge *Erc20bridgeCaller) CREATEBRIDGETOKENSREQUIREDGAS(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Erc20bridge.contract.Call(opts, &out, "CREATE_BRIDGE_TOKENS_REQUIRED_GAS") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// CREATEBRIDGETOKENSREQUIREDGAS is a free data retrieval call binding the contract method 0x5f217bcc. +// +// Solidity: function CREATE_BRIDGE_TOKENS_REQUIRED_GAS() view returns(uint256) +func (_Erc20bridge *Erc20bridgeSession) CREATEBRIDGETOKENSREQUIREDGAS() (*big.Int, error) { + return _Erc20bridge.Contract.CREATEBRIDGETOKENSREQUIREDGAS(&_Erc20bridge.CallOpts) +} + +// CREATEBRIDGETOKENSREQUIREDGAS is a free data retrieval call binding the contract method 0x5f217bcc. +// +// Solidity: function CREATE_BRIDGE_TOKENS_REQUIRED_GAS() view returns(uint256) +func (_Erc20bridge *Erc20bridgeCallerSession) CREATEBRIDGETOKENSREQUIREDGAS() (*big.Int, error) { + return _Erc20bridge.Contract.CREATEBRIDGETOKENSREQUIREDGAS(&_Erc20bridge.CallOpts) +} + +// MINTBRIDGETOKENSREQUIREDGAS is a free data retrieval call binding the contract method 0x7a465fd9. +// +// Solidity: function MINT_BRIDGE_TOKENS_REQUIRED_GAS() view returns(uint256) +func (_Erc20bridge *Erc20bridgeCaller) MINTBRIDGETOKENSREQUIREDGAS(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Erc20bridge.contract.Call(opts, &out, "MINT_BRIDGE_TOKENS_REQUIRED_GAS") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MINTBRIDGETOKENSREQUIREDGAS is a free data retrieval call binding the contract method 0x7a465fd9. +// +// Solidity: function MINT_BRIDGE_TOKENS_REQUIRED_GAS() view returns(uint256) +func (_Erc20bridge *Erc20bridgeSession) MINTBRIDGETOKENSREQUIREDGAS() (*big.Int, error) { + return _Erc20bridge.Contract.MINTBRIDGETOKENSREQUIREDGAS(&_Erc20bridge.CallOpts) +} + +// MINTBRIDGETOKENSREQUIREDGAS is a free data retrieval call binding the contract method 0x7a465fd9. +// +// Solidity: function MINT_BRIDGE_TOKENS_REQUIRED_GAS() view returns(uint256) +func (_Erc20bridge *Erc20bridgeCallerSession) MINTBRIDGETOKENSREQUIREDGAS() (*big.Int, error) { + return _Erc20bridge.Contract.MINTBRIDGETOKENSREQUIREDGAS(&_Erc20bridge.CallOpts) +} + +// TRANSFERBRIDGETOKENSREQUIREDGAS is a free data retrieval call binding the contract method 0x6b47cd9a. +// +// Solidity: function TRANSFER_BRIDGE_TOKENS_REQUIRED_GAS() view returns(uint256) +func (_Erc20bridge *Erc20bridgeCaller) TRANSFERBRIDGETOKENSREQUIREDGAS(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Erc20bridge.contract.Call(opts, &out, "TRANSFER_BRIDGE_TOKENS_REQUIRED_GAS") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TRANSFERBRIDGETOKENSREQUIREDGAS is a free data retrieval call binding the contract method 0x6b47cd9a. +// +// Solidity: function TRANSFER_BRIDGE_TOKENS_REQUIRED_GAS() view returns(uint256) +func (_Erc20bridge *Erc20bridgeSession) TRANSFERBRIDGETOKENSREQUIREDGAS() (*big.Int, error) { + return _Erc20bridge.Contract.TRANSFERBRIDGETOKENSREQUIREDGAS(&_Erc20bridge.CallOpts) +} + +// TRANSFERBRIDGETOKENSREQUIREDGAS is a free data retrieval call binding the contract method 0x6b47cd9a. +// +// Solidity: function TRANSFER_BRIDGE_TOKENS_REQUIRED_GAS() view returns(uint256) +func (_Erc20bridge *Erc20bridgeCallerSession) TRANSFERBRIDGETOKENSREQUIREDGAS() (*big.Int, error) { + return _Erc20bridge.Contract.TRANSFERBRIDGETOKENSREQUIREDGAS(&_Erc20bridge.CallOpts) +} + +// WARPPRECOMPILEADDRESS is a free data retrieval call binding the contract method 0x74971856. +// +// Solidity: function WARP_PRECOMPILE_ADDRESS() view returns(address) +func (_Erc20bridge *Erc20bridgeCaller) WARPPRECOMPILEADDRESS(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Erc20bridge.contract.Call(opts, &out, "WARP_PRECOMPILE_ADDRESS") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// WARPPRECOMPILEADDRESS is a free data retrieval call binding the contract method 0x74971856. +// +// Solidity: function WARP_PRECOMPILE_ADDRESS() view returns(address) +func (_Erc20bridge *Erc20bridgeSession) WARPPRECOMPILEADDRESS() (common.Address, error) { + return _Erc20bridge.Contract.WARPPRECOMPILEADDRESS(&_Erc20bridge.CallOpts) +} + +// WARPPRECOMPILEADDRESS is a free data retrieval call binding the contract method 0x74971856. +// +// Solidity: function WARP_PRECOMPILE_ADDRESS() view returns(address) +func (_Erc20bridge *Erc20bridgeCallerSession) WARPPRECOMPILEADDRESS() (common.Address, error) { + return _Erc20bridge.Contract.WARPPRECOMPILEADDRESS(&_Erc20bridge.CallOpts) +} + +// BridgedBalances is a free data retrieval call binding the contract method 0xb9e55da1. +// +// Solidity: function bridgedBalances(bytes32 , address , address ) view returns(uint256) +func (_Erc20bridge *Erc20bridgeCaller) BridgedBalances(opts *bind.CallOpts, arg0 [32]byte, arg1 common.Address, arg2 common.Address) (*big.Int, error) { + var out []interface{} + err := _Erc20bridge.contract.Call(opts, &out, "bridgedBalances", arg0, arg1, arg2) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BridgedBalances is a free data retrieval call binding the contract method 0xb9e55da1. +// +// Solidity: function bridgedBalances(bytes32 , address , address ) view returns(uint256) +func (_Erc20bridge *Erc20bridgeSession) BridgedBalances(arg0 [32]byte, arg1 common.Address, arg2 common.Address) (*big.Int, error) { + return _Erc20bridge.Contract.BridgedBalances(&_Erc20bridge.CallOpts, arg0, arg1, arg2) +} + +// BridgedBalances is a free data retrieval call binding the contract method 0xb9e55da1. +// +// Solidity: function bridgedBalances(bytes32 , address , address ) view returns(uint256) +func (_Erc20bridge *Erc20bridgeCallerSession) BridgedBalances(arg0 [32]byte, arg1 common.Address, arg2 common.Address) (*big.Int, error) { + return _Erc20bridge.Contract.BridgedBalances(&_Erc20bridge.CallOpts, arg0, arg1, arg2) +} + +// CurrentChainID is a free data retrieval call binding the contract method 0xb179e1e7. +// +// Solidity: function currentChainID() view returns(bytes32) +func (_Erc20bridge *Erc20bridgeCaller) CurrentChainID(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _Erc20bridge.contract.Call(opts, &out, "currentChainID") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// CurrentChainID is a free data retrieval call binding the contract method 0xb179e1e7. +// +// Solidity: function currentChainID() view returns(bytes32) +func (_Erc20bridge *Erc20bridgeSession) CurrentChainID() ([32]byte, error) { + return _Erc20bridge.Contract.CurrentChainID(&_Erc20bridge.CallOpts) +} + +// CurrentChainID is a free data retrieval call binding the contract method 0xb179e1e7. +// +// Solidity: function currentChainID() view returns(bytes32) +func (_Erc20bridge *Erc20bridgeCallerSession) CurrentChainID() ([32]byte, error) { + return _Erc20bridge.Contract.CurrentChainID(&_Erc20bridge.CallOpts) +} + +// EncodeCreateBridgeTokenData is a free data retrieval call binding the contract method 0x367e9584. +// +// Solidity: function encodeCreateBridgeTokenData(address nativeContractAddress, string nativeName, string nativeSymbol, uint8 nativeDecimals) pure returns(bytes) +func (_Erc20bridge *Erc20bridgeCaller) EncodeCreateBridgeTokenData(opts *bind.CallOpts, nativeContractAddress common.Address, nativeName string, nativeSymbol string, nativeDecimals uint8) ([]byte, error) { + var out []interface{} + err := _Erc20bridge.contract.Call(opts, &out, "encodeCreateBridgeTokenData", nativeContractAddress, nativeName, nativeSymbol, nativeDecimals) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// EncodeCreateBridgeTokenData is a free data retrieval call binding the contract method 0x367e9584. +// +// Solidity: function encodeCreateBridgeTokenData(address nativeContractAddress, string nativeName, string nativeSymbol, uint8 nativeDecimals) pure returns(bytes) +func (_Erc20bridge *Erc20bridgeSession) EncodeCreateBridgeTokenData(nativeContractAddress common.Address, nativeName string, nativeSymbol string, nativeDecimals uint8) ([]byte, error) { + return _Erc20bridge.Contract.EncodeCreateBridgeTokenData(&_Erc20bridge.CallOpts, nativeContractAddress, nativeName, nativeSymbol, nativeDecimals) +} + +// EncodeCreateBridgeTokenData is a free data retrieval call binding the contract method 0x367e9584. +// +// Solidity: function encodeCreateBridgeTokenData(address nativeContractAddress, string nativeName, string nativeSymbol, uint8 nativeDecimals) pure returns(bytes) +func (_Erc20bridge *Erc20bridgeCallerSession) EncodeCreateBridgeTokenData(nativeContractAddress common.Address, nativeName string, nativeSymbol string, nativeDecimals uint8) ([]byte, error) { + return _Erc20bridge.Contract.EncodeCreateBridgeTokenData(&_Erc20bridge.CallOpts, nativeContractAddress, nativeName, nativeSymbol, nativeDecimals) +} + +// EncodeMintBridgeTokensData is a free data retrieval call binding the contract method 0x8c56fcf0. +// +// Solidity: function encodeMintBridgeTokensData(address nativeContractAddress, address recipient, uint256 bridgeAmount) pure returns(bytes) +func (_Erc20bridge *Erc20bridgeCaller) EncodeMintBridgeTokensData(opts *bind.CallOpts, nativeContractAddress common.Address, recipient common.Address, bridgeAmount *big.Int) ([]byte, error) { + var out []interface{} + err := _Erc20bridge.contract.Call(opts, &out, "encodeMintBridgeTokensData", nativeContractAddress, recipient, bridgeAmount) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// EncodeMintBridgeTokensData is a free data retrieval call binding the contract method 0x8c56fcf0. +// +// Solidity: function encodeMintBridgeTokensData(address nativeContractAddress, address recipient, uint256 bridgeAmount) pure returns(bytes) +func (_Erc20bridge *Erc20bridgeSession) EncodeMintBridgeTokensData(nativeContractAddress common.Address, recipient common.Address, bridgeAmount *big.Int) ([]byte, error) { + return _Erc20bridge.Contract.EncodeMintBridgeTokensData(&_Erc20bridge.CallOpts, nativeContractAddress, recipient, bridgeAmount) +} + +// EncodeMintBridgeTokensData is a free data retrieval call binding the contract method 0x8c56fcf0. +// +// Solidity: function encodeMintBridgeTokensData(address nativeContractAddress, address recipient, uint256 bridgeAmount) pure returns(bytes) +func (_Erc20bridge *Erc20bridgeCallerSession) EncodeMintBridgeTokensData(nativeContractAddress common.Address, recipient common.Address, bridgeAmount *big.Int) ([]byte, error) { + return _Erc20bridge.Contract.EncodeMintBridgeTokensData(&_Erc20bridge.CallOpts, nativeContractAddress, recipient, bridgeAmount) +} + +// EncodeTransferBridgeTokensData is a free data retrieval call binding the contract method 0xc60da612. +// +// Solidity: function encodeTransferBridgeTokensData(bytes32 destinationChainID, address destinationBridgeAddress, address nativeContractAddress, address recipient, uint256 amount, uint256 feeAmount) pure returns(bytes) +func (_Erc20bridge *Erc20bridgeCaller) EncodeTransferBridgeTokensData(opts *bind.CallOpts, destinationChainID [32]byte, destinationBridgeAddress common.Address, nativeContractAddress common.Address, recipient common.Address, amount *big.Int, feeAmount *big.Int) ([]byte, error) { + var out []interface{} + err := _Erc20bridge.contract.Call(opts, &out, "encodeTransferBridgeTokensData", destinationChainID, destinationBridgeAddress, nativeContractAddress, recipient, amount, feeAmount) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// EncodeTransferBridgeTokensData is a free data retrieval call binding the contract method 0xc60da612. +// +// Solidity: function encodeTransferBridgeTokensData(bytes32 destinationChainID, address destinationBridgeAddress, address nativeContractAddress, address recipient, uint256 amount, uint256 feeAmount) pure returns(bytes) +func (_Erc20bridge *Erc20bridgeSession) EncodeTransferBridgeTokensData(destinationChainID [32]byte, destinationBridgeAddress common.Address, nativeContractAddress common.Address, recipient common.Address, amount *big.Int, feeAmount *big.Int) ([]byte, error) { + return _Erc20bridge.Contract.EncodeTransferBridgeTokensData(&_Erc20bridge.CallOpts, destinationChainID, destinationBridgeAddress, nativeContractAddress, recipient, amount, feeAmount) +} + +// EncodeTransferBridgeTokensData is a free data retrieval call binding the contract method 0xc60da612. +// +// Solidity: function encodeTransferBridgeTokensData(bytes32 destinationChainID, address destinationBridgeAddress, address nativeContractAddress, address recipient, uint256 amount, uint256 feeAmount) pure returns(bytes) +func (_Erc20bridge *Erc20bridgeCallerSession) EncodeTransferBridgeTokensData(destinationChainID [32]byte, destinationBridgeAddress common.Address, nativeContractAddress common.Address, recipient common.Address, amount *big.Int, feeAmount *big.Int) ([]byte, error) { + return _Erc20bridge.Contract.EncodeTransferBridgeTokensData(&_Erc20bridge.CallOpts, destinationChainID, destinationBridgeAddress, nativeContractAddress, recipient, amount, feeAmount) +} + +// NativeToWrappedTokens is a free data retrieval call binding the contract method 0x65435568. +// +// Solidity: function nativeToWrappedTokens(bytes32 , address , address ) view returns(address) +func (_Erc20bridge *Erc20bridgeCaller) NativeToWrappedTokens(opts *bind.CallOpts, arg0 [32]byte, arg1 common.Address, arg2 common.Address) (common.Address, error) { + var out []interface{} + err := _Erc20bridge.contract.Call(opts, &out, "nativeToWrappedTokens", arg0, arg1, arg2) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// NativeToWrappedTokens is a free data retrieval call binding the contract method 0x65435568. +// +// Solidity: function nativeToWrappedTokens(bytes32 , address , address ) view returns(address) +func (_Erc20bridge *Erc20bridgeSession) NativeToWrappedTokens(arg0 [32]byte, arg1 common.Address, arg2 common.Address) (common.Address, error) { + return _Erc20bridge.Contract.NativeToWrappedTokens(&_Erc20bridge.CallOpts, arg0, arg1, arg2) +} + +// NativeToWrappedTokens is a free data retrieval call binding the contract method 0x65435568. +// +// Solidity: function nativeToWrappedTokens(bytes32 , address , address ) view returns(address) +func (_Erc20bridge *Erc20bridgeCallerSession) NativeToWrappedTokens(arg0 [32]byte, arg1 common.Address, arg2 common.Address) (common.Address, error) { + return _Erc20bridge.Contract.NativeToWrappedTokens(&_Erc20bridge.CallOpts, arg0, arg1, arg2) +} + +// SubmittedBridgeTokenCreations is a free data retrieval call binding the contract method 0x8343f661. +// +// Solidity: function submittedBridgeTokenCreations(bytes32 , address , address ) view returns(bool) +func (_Erc20bridge *Erc20bridgeCaller) SubmittedBridgeTokenCreations(opts *bind.CallOpts, arg0 [32]byte, arg1 common.Address, arg2 common.Address) (bool, error) { + var out []interface{} + err := _Erc20bridge.contract.Call(opts, &out, "submittedBridgeTokenCreations", arg0, arg1, arg2) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// SubmittedBridgeTokenCreations is a free data retrieval call binding the contract method 0x8343f661. +// +// Solidity: function submittedBridgeTokenCreations(bytes32 , address , address ) view returns(bool) +func (_Erc20bridge *Erc20bridgeSession) SubmittedBridgeTokenCreations(arg0 [32]byte, arg1 common.Address, arg2 common.Address) (bool, error) { + return _Erc20bridge.Contract.SubmittedBridgeTokenCreations(&_Erc20bridge.CallOpts, arg0, arg1, arg2) +} + +// SubmittedBridgeTokenCreations is a free data retrieval call binding the contract method 0x8343f661. +// +// Solidity: function submittedBridgeTokenCreations(bytes32 , address , address ) view returns(bool) +func (_Erc20bridge *Erc20bridgeCallerSession) SubmittedBridgeTokenCreations(arg0 [32]byte, arg1 common.Address, arg2 common.Address) (bool, error) { + return _Erc20bridge.Contract.SubmittedBridgeTokenCreations(&_Erc20bridge.CallOpts, arg0, arg1, arg2) +} + +// TeleporterMessenger is a free data retrieval call binding the contract method 0x9b3e5803. +// +// Solidity: function teleporterMessenger() view returns(address) +func (_Erc20bridge *Erc20bridgeCaller) TeleporterMessenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Erc20bridge.contract.Call(opts, &out, "teleporterMessenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// TeleporterMessenger is a free data retrieval call binding the contract method 0x9b3e5803. +// +// Solidity: function teleporterMessenger() view returns(address) +func (_Erc20bridge *Erc20bridgeSession) TeleporterMessenger() (common.Address, error) { + return _Erc20bridge.Contract.TeleporterMessenger(&_Erc20bridge.CallOpts) +} + +// TeleporterMessenger is a free data retrieval call binding the contract method 0x9b3e5803. +// +// Solidity: function teleporterMessenger() view returns(address) +func (_Erc20bridge *Erc20bridgeCallerSession) TeleporterMessenger() (common.Address, error) { + return _Erc20bridge.Contract.TeleporterMessenger(&_Erc20bridge.CallOpts) +} + +// WrappedTokenContracts is a free data retrieval call binding the contract method 0x9bd9abc0. +// +// Solidity: function wrappedTokenContracts(address ) view returns(bool) +func (_Erc20bridge *Erc20bridgeCaller) WrappedTokenContracts(opts *bind.CallOpts, arg0 common.Address) (bool, error) { + var out []interface{} + err := _Erc20bridge.contract.Call(opts, &out, "wrappedTokenContracts", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// WrappedTokenContracts is a free data retrieval call binding the contract method 0x9bd9abc0. +// +// Solidity: function wrappedTokenContracts(address ) view returns(bool) +func (_Erc20bridge *Erc20bridgeSession) WrappedTokenContracts(arg0 common.Address) (bool, error) { + return _Erc20bridge.Contract.WrappedTokenContracts(&_Erc20bridge.CallOpts, arg0) +} + +// WrappedTokenContracts is a free data retrieval call binding the contract method 0x9bd9abc0. +// +// Solidity: function wrappedTokenContracts(address ) view returns(bool) +func (_Erc20bridge *Erc20bridgeCallerSession) WrappedTokenContracts(arg0 common.Address) (bool, error) { + return _Erc20bridge.Contract.WrappedTokenContracts(&_Erc20bridge.CallOpts, arg0) +} + +// BridgeTokens is a paid mutator transaction binding the contract method 0xc63d2207. +// +// Solidity: function bridgeTokens(bytes32 destinationChainID, address destinationBridgeAddress, address tokenContractAddress, address recipient, uint256 totalAmount, uint256 primaryFeeAmount, uint256 secondaryFeeAmount) returns() +func (_Erc20bridge *Erc20bridgeTransactor) BridgeTokens(opts *bind.TransactOpts, destinationChainID [32]byte, destinationBridgeAddress common.Address, tokenContractAddress common.Address, recipient common.Address, totalAmount *big.Int, primaryFeeAmount *big.Int, secondaryFeeAmount *big.Int) (*types.Transaction, error) { + return _Erc20bridge.contract.Transact(opts, "bridgeTokens", destinationChainID, destinationBridgeAddress, tokenContractAddress, recipient, totalAmount, primaryFeeAmount, secondaryFeeAmount) +} + +// BridgeTokens is a paid mutator transaction binding the contract method 0xc63d2207. +// +// Solidity: function bridgeTokens(bytes32 destinationChainID, address destinationBridgeAddress, address tokenContractAddress, address recipient, uint256 totalAmount, uint256 primaryFeeAmount, uint256 secondaryFeeAmount) returns() +func (_Erc20bridge *Erc20bridgeSession) BridgeTokens(destinationChainID [32]byte, destinationBridgeAddress common.Address, tokenContractAddress common.Address, recipient common.Address, totalAmount *big.Int, primaryFeeAmount *big.Int, secondaryFeeAmount *big.Int) (*types.Transaction, error) { + return _Erc20bridge.Contract.BridgeTokens(&_Erc20bridge.TransactOpts, destinationChainID, destinationBridgeAddress, tokenContractAddress, recipient, totalAmount, primaryFeeAmount, secondaryFeeAmount) +} + +// BridgeTokens is a paid mutator transaction binding the contract method 0xc63d2207. +// +// Solidity: function bridgeTokens(bytes32 destinationChainID, address destinationBridgeAddress, address tokenContractAddress, address recipient, uint256 totalAmount, uint256 primaryFeeAmount, uint256 secondaryFeeAmount) returns() +func (_Erc20bridge *Erc20bridgeTransactorSession) BridgeTokens(destinationChainID [32]byte, destinationBridgeAddress common.Address, tokenContractAddress common.Address, recipient common.Address, totalAmount *big.Int, primaryFeeAmount *big.Int, secondaryFeeAmount *big.Int) (*types.Transaction, error) { + return _Erc20bridge.Contract.BridgeTokens(&_Erc20bridge.TransactOpts, destinationChainID, destinationBridgeAddress, tokenContractAddress, recipient, totalAmount, primaryFeeAmount, secondaryFeeAmount) +} + +// ReceiveTeleporterMessage is a paid mutator transaction binding the contract method 0xc868efaa. +// +// Solidity: function receiveTeleporterMessage(bytes32 nativeChainID, address nativeBridgeAddress, bytes message) returns() +func (_Erc20bridge *Erc20bridgeTransactor) ReceiveTeleporterMessage(opts *bind.TransactOpts, nativeChainID [32]byte, nativeBridgeAddress common.Address, message []byte) (*types.Transaction, error) { + return _Erc20bridge.contract.Transact(opts, "receiveTeleporterMessage", nativeChainID, nativeBridgeAddress, message) +} + +// ReceiveTeleporterMessage is a paid mutator transaction binding the contract method 0xc868efaa. +// +// Solidity: function receiveTeleporterMessage(bytes32 nativeChainID, address nativeBridgeAddress, bytes message) returns() +func (_Erc20bridge *Erc20bridgeSession) ReceiveTeleporterMessage(nativeChainID [32]byte, nativeBridgeAddress common.Address, message []byte) (*types.Transaction, error) { + return _Erc20bridge.Contract.ReceiveTeleporterMessage(&_Erc20bridge.TransactOpts, nativeChainID, nativeBridgeAddress, message) +} + +// ReceiveTeleporterMessage is a paid mutator transaction binding the contract method 0xc868efaa. +// +// Solidity: function receiveTeleporterMessage(bytes32 nativeChainID, address nativeBridgeAddress, bytes message) returns() +func (_Erc20bridge *Erc20bridgeTransactorSession) ReceiveTeleporterMessage(nativeChainID [32]byte, nativeBridgeAddress common.Address, message []byte) (*types.Transaction, error) { + return _Erc20bridge.Contract.ReceiveTeleporterMessage(&_Erc20bridge.TransactOpts, nativeChainID, nativeBridgeAddress, message) +} + +// SubmitCreateBridgeToken is a paid mutator transaction binding the contract method 0x6c7e40d1. +// +// Solidity: function submitCreateBridgeToken(bytes32 destinationChainID, address destinationBridgeAddress, address nativeToken, address messageFeeAsset, uint256 messageFeeAmount) returns() +func (_Erc20bridge *Erc20bridgeTransactor) SubmitCreateBridgeToken(opts *bind.TransactOpts, destinationChainID [32]byte, destinationBridgeAddress common.Address, nativeToken common.Address, messageFeeAsset common.Address, messageFeeAmount *big.Int) (*types.Transaction, error) { + return _Erc20bridge.contract.Transact(opts, "submitCreateBridgeToken", destinationChainID, destinationBridgeAddress, nativeToken, messageFeeAsset, messageFeeAmount) +} + +// SubmitCreateBridgeToken is a paid mutator transaction binding the contract method 0x6c7e40d1. +// +// Solidity: function submitCreateBridgeToken(bytes32 destinationChainID, address destinationBridgeAddress, address nativeToken, address messageFeeAsset, uint256 messageFeeAmount) returns() +func (_Erc20bridge *Erc20bridgeSession) SubmitCreateBridgeToken(destinationChainID [32]byte, destinationBridgeAddress common.Address, nativeToken common.Address, messageFeeAsset common.Address, messageFeeAmount *big.Int) (*types.Transaction, error) { + return _Erc20bridge.Contract.SubmitCreateBridgeToken(&_Erc20bridge.TransactOpts, destinationChainID, destinationBridgeAddress, nativeToken, messageFeeAsset, messageFeeAmount) +} + +// SubmitCreateBridgeToken is a paid mutator transaction binding the contract method 0x6c7e40d1. +// +// Solidity: function submitCreateBridgeToken(bytes32 destinationChainID, address destinationBridgeAddress, address nativeToken, address messageFeeAsset, uint256 messageFeeAmount) returns() +func (_Erc20bridge *Erc20bridgeTransactorSession) SubmitCreateBridgeToken(destinationChainID [32]byte, destinationBridgeAddress common.Address, nativeToken common.Address, messageFeeAsset common.Address, messageFeeAmount *big.Int) (*types.Transaction, error) { + return _Erc20bridge.Contract.SubmitCreateBridgeToken(&_Erc20bridge.TransactOpts, destinationChainID, destinationBridgeAddress, nativeToken, messageFeeAsset, messageFeeAmount) +} + +// Erc20bridgeBridgeTokensIterator is returned from FilterBridgeTokens and is used to iterate over the raw logs and unpacked data for BridgeTokens events raised by the Erc20bridge contract. +type Erc20bridgeBridgeTokensIterator struct { + Event *Erc20bridgeBridgeTokens // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *Erc20bridgeBridgeTokensIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(Erc20bridgeBridgeTokens) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(Erc20bridgeBridgeTokens) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *Erc20bridgeBridgeTokensIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *Erc20bridgeBridgeTokensIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// Erc20bridgeBridgeTokens represents a BridgeTokens event raised by the Erc20bridge contract. +type Erc20bridgeBridgeTokens struct { + TokenContractAddress common.Address + DestinationChainID [32]byte + TeleporterMessageID *big.Int + DestinationBridgeAddress common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBridgeTokens is a free log retrieval operation binding the contract event 0x97935c4470efae40c8440c3abfe968a5512232dd375cc974e712f487c2b99c31. +// +// Solidity: event BridgeTokens(address indexed tokenContractAddress, bytes32 indexed destinationChainID, uint256 indexed teleporterMessageID, address destinationBridgeAddress, address recipient, uint256 amount) +func (_Erc20bridge *Erc20bridgeFilterer) FilterBridgeTokens(opts *bind.FilterOpts, tokenContractAddress []common.Address, destinationChainID [][32]byte, teleporterMessageID []*big.Int) (*Erc20bridgeBridgeTokensIterator, error) { + + var tokenContractAddressRule []interface{} + for _, tokenContractAddressItem := range tokenContractAddress { + tokenContractAddressRule = append(tokenContractAddressRule, tokenContractAddressItem) + } + var destinationChainIDRule []interface{} + for _, destinationChainIDItem := range destinationChainID { + destinationChainIDRule = append(destinationChainIDRule, destinationChainIDItem) + } + var teleporterMessageIDRule []interface{} + for _, teleporterMessageIDItem := range teleporterMessageID { + teleporterMessageIDRule = append(teleporterMessageIDRule, teleporterMessageIDItem) + } + + logs, sub, err := _Erc20bridge.contract.FilterLogs(opts, "BridgeTokens", tokenContractAddressRule, destinationChainIDRule, teleporterMessageIDRule) + if err != nil { + return nil, err + } + return &Erc20bridgeBridgeTokensIterator{contract: _Erc20bridge.contract, event: "BridgeTokens", logs: logs, sub: sub}, nil +} + +// WatchBridgeTokens is a free log subscription operation binding the contract event 0x97935c4470efae40c8440c3abfe968a5512232dd375cc974e712f487c2b99c31. +// +// Solidity: event BridgeTokens(address indexed tokenContractAddress, bytes32 indexed destinationChainID, uint256 indexed teleporterMessageID, address destinationBridgeAddress, address recipient, uint256 amount) +func (_Erc20bridge *Erc20bridgeFilterer) WatchBridgeTokens(opts *bind.WatchOpts, sink chan<- *Erc20bridgeBridgeTokens, tokenContractAddress []common.Address, destinationChainID [][32]byte, teleporterMessageID []*big.Int) (event.Subscription, error) { + + var tokenContractAddressRule []interface{} + for _, tokenContractAddressItem := range tokenContractAddress { + tokenContractAddressRule = append(tokenContractAddressRule, tokenContractAddressItem) + } + var destinationChainIDRule []interface{} + for _, destinationChainIDItem := range destinationChainID { + destinationChainIDRule = append(destinationChainIDRule, destinationChainIDItem) + } + var teleporterMessageIDRule []interface{} + for _, teleporterMessageIDItem := range teleporterMessageID { + teleporterMessageIDRule = append(teleporterMessageIDRule, teleporterMessageIDItem) + } + + logs, sub, err := _Erc20bridge.contract.WatchLogs(opts, "BridgeTokens", tokenContractAddressRule, destinationChainIDRule, teleporterMessageIDRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(Erc20bridgeBridgeTokens) + if err := _Erc20bridge.contract.UnpackLog(event, "BridgeTokens", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseBridgeTokens is a log parse operation binding the contract event 0x97935c4470efae40c8440c3abfe968a5512232dd375cc974e712f487c2b99c31. +// +// Solidity: event BridgeTokens(address indexed tokenContractAddress, bytes32 indexed destinationChainID, uint256 indexed teleporterMessageID, address destinationBridgeAddress, address recipient, uint256 amount) +func (_Erc20bridge *Erc20bridgeFilterer) ParseBridgeTokens(log types.Log) (*Erc20bridgeBridgeTokens, error) { + event := new(Erc20bridgeBridgeTokens) + if err := _Erc20bridge.contract.UnpackLog(event, "BridgeTokens", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// Erc20bridgeCreateBridgeTokenIterator is returned from FilterCreateBridgeToken and is used to iterate over the raw logs and unpacked data for CreateBridgeToken events raised by the Erc20bridge contract. +type Erc20bridgeCreateBridgeTokenIterator struct { + Event *Erc20bridgeCreateBridgeToken // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *Erc20bridgeCreateBridgeTokenIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(Erc20bridgeCreateBridgeToken) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(Erc20bridgeCreateBridgeToken) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *Erc20bridgeCreateBridgeTokenIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *Erc20bridgeCreateBridgeTokenIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// Erc20bridgeCreateBridgeToken represents a CreateBridgeToken event raised by the Erc20bridge contract. +type Erc20bridgeCreateBridgeToken struct { + NativeChainID [32]byte + NativeBridgeAddress common.Address + NativeContractAddress common.Address + BridgeTokenAddress common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterCreateBridgeToken is a free log retrieval operation binding the contract event 0xe1c61a845f79534e11924517ddbedc668d0c20e467eafb4d3bd2858e2815f3b5. +// +// Solidity: event CreateBridgeToken(bytes32 indexed nativeChainID, address indexed nativeBridgeAddress, address indexed nativeContractAddress, address bridgeTokenAddress) +func (_Erc20bridge *Erc20bridgeFilterer) FilterCreateBridgeToken(opts *bind.FilterOpts, nativeChainID [][32]byte, nativeBridgeAddress []common.Address, nativeContractAddress []common.Address) (*Erc20bridgeCreateBridgeTokenIterator, error) { + + var nativeChainIDRule []interface{} + for _, nativeChainIDItem := range nativeChainID { + nativeChainIDRule = append(nativeChainIDRule, nativeChainIDItem) + } + var nativeBridgeAddressRule []interface{} + for _, nativeBridgeAddressItem := range nativeBridgeAddress { + nativeBridgeAddressRule = append(nativeBridgeAddressRule, nativeBridgeAddressItem) + } + var nativeContractAddressRule []interface{} + for _, nativeContractAddressItem := range nativeContractAddress { + nativeContractAddressRule = append(nativeContractAddressRule, nativeContractAddressItem) + } + + logs, sub, err := _Erc20bridge.contract.FilterLogs(opts, "CreateBridgeToken", nativeChainIDRule, nativeBridgeAddressRule, nativeContractAddressRule) + if err != nil { + return nil, err + } + return &Erc20bridgeCreateBridgeTokenIterator{contract: _Erc20bridge.contract, event: "CreateBridgeToken", logs: logs, sub: sub}, nil +} + +// WatchCreateBridgeToken is a free log subscription operation binding the contract event 0xe1c61a845f79534e11924517ddbedc668d0c20e467eafb4d3bd2858e2815f3b5. +// +// Solidity: event CreateBridgeToken(bytes32 indexed nativeChainID, address indexed nativeBridgeAddress, address indexed nativeContractAddress, address bridgeTokenAddress) +func (_Erc20bridge *Erc20bridgeFilterer) WatchCreateBridgeToken(opts *bind.WatchOpts, sink chan<- *Erc20bridgeCreateBridgeToken, nativeChainID [][32]byte, nativeBridgeAddress []common.Address, nativeContractAddress []common.Address) (event.Subscription, error) { + + var nativeChainIDRule []interface{} + for _, nativeChainIDItem := range nativeChainID { + nativeChainIDRule = append(nativeChainIDRule, nativeChainIDItem) + } + var nativeBridgeAddressRule []interface{} + for _, nativeBridgeAddressItem := range nativeBridgeAddress { + nativeBridgeAddressRule = append(nativeBridgeAddressRule, nativeBridgeAddressItem) + } + var nativeContractAddressRule []interface{} + for _, nativeContractAddressItem := range nativeContractAddress { + nativeContractAddressRule = append(nativeContractAddressRule, nativeContractAddressItem) + } + + logs, sub, err := _Erc20bridge.contract.WatchLogs(opts, "CreateBridgeToken", nativeChainIDRule, nativeBridgeAddressRule, nativeContractAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(Erc20bridgeCreateBridgeToken) + if err := _Erc20bridge.contract.UnpackLog(event, "CreateBridgeToken", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseCreateBridgeToken is a log parse operation binding the contract event 0xe1c61a845f79534e11924517ddbedc668d0c20e467eafb4d3bd2858e2815f3b5. +// +// Solidity: event CreateBridgeToken(bytes32 indexed nativeChainID, address indexed nativeBridgeAddress, address indexed nativeContractAddress, address bridgeTokenAddress) +func (_Erc20bridge *Erc20bridgeFilterer) ParseCreateBridgeToken(log types.Log) (*Erc20bridgeCreateBridgeToken, error) { + event := new(Erc20bridgeCreateBridgeToken) + if err := _Erc20bridge.contract.UnpackLog(event, "CreateBridgeToken", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// Erc20bridgeMintBridgeTokensIterator is returned from FilterMintBridgeTokens and is used to iterate over the raw logs and unpacked data for MintBridgeTokens events raised by the Erc20bridge contract. +type Erc20bridgeMintBridgeTokensIterator struct { + Event *Erc20bridgeMintBridgeTokens // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *Erc20bridgeMintBridgeTokensIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(Erc20bridgeMintBridgeTokens) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(Erc20bridgeMintBridgeTokens) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *Erc20bridgeMintBridgeTokensIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *Erc20bridgeMintBridgeTokensIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// Erc20bridgeMintBridgeTokens represents a MintBridgeTokens event raised by the Erc20bridge contract. +type Erc20bridgeMintBridgeTokens struct { + ContractAddress common.Address + Recipient common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMintBridgeTokens is a free log retrieval operation binding the contract event 0xc0767f158f0d5394b598489a51ed607cd55a8be2dcef113ba1626efcf4c63954. +// +// Solidity: event MintBridgeTokens(address indexed contractAddress, address recipient, uint256 amount) +func (_Erc20bridge *Erc20bridgeFilterer) FilterMintBridgeTokens(opts *bind.FilterOpts, contractAddress []common.Address) (*Erc20bridgeMintBridgeTokensIterator, error) { + + var contractAddressRule []interface{} + for _, contractAddressItem := range contractAddress { + contractAddressRule = append(contractAddressRule, contractAddressItem) + } + + logs, sub, err := _Erc20bridge.contract.FilterLogs(opts, "MintBridgeTokens", contractAddressRule) + if err != nil { + return nil, err + } + return &Erc20bridgeMintBridgeTokensIterator{contract: _Erc20bridge.contract, event: "MintBridgeTokens", logs: logs, sub: sub}, nil +} + +// WatchMintBridgeTokens is a free log subscription operation binding the contract event 0xc0767f158f0d5394b598489a51ed607cd55a8be2dcef113ba1626efcf4c63954. +// +// Solidity: event MintBridgeTokens(address indexed contractAddress, address recipient, uint256 amount) +func (_Erc20bridge *Erc20bridgeFilterer) WatchMintBridgeTokens(opts *bind.WatchOpts, sink chan<- *Erc20bridgeMintBridgeTokens, contractAddress []common.Address) (event.Subscription, error) { + + var contractAddressRule []interface{} + for _, contractAddressItem := range contractAddress { + contractAddressRule = append(contractAddressRule, contractAddressItem) + } + + logs, sub, err := _Erc20bridge.contract.WatchLogs(opts, "MintBridgeTokens", contractAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(Erc20bridgeMintBridgeTokens) + if err := _Erc20bridge.contract.UnpackLog(event, "MintBridgeTokens", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseMintBridgeTokens is a log parse operation binding the contract event 0xc0767f158f0d5394b598489a51ed607cd55a8be2dcef113ba1626efcf4c63954. +// +// Solidity: event MintBridgeTokens(address indexed contractAddress, address recipient, uint256 amount) +func (_Erc20bridge *Erc20bridgeFilterer) ParseMintBridgeTokens(log types.Log) (*Erc20bridgeMintBridgeTokens, error) { + event := new(Erc20bridgeMintBridgeTokens) + if err := _Erc20bridge.contract.UnpackLog(event, "MintBridgeTokens", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// Erc20bridgeSubmitCreateBridgeTokenIterator is returned from FilterSubmitCreateBridgeToken and is used to iterate over the raw logs and unpacked data for SubmitCreateBridgeToken events raised by the Erc20bridge contract. +type Erc20bridgeSubmitCreateBridgeTokenIterator struct { + Event *Erc20bridgeSubmitCreateBridgeToken // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *Erc20bridgeSubmitCreateBridgeTokenIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(Erc20bridgeSubmitCreateBridgeToken) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(Erc20bridgeSubmitCreateBridgeToken) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *Erc20bridgeSubmitCreateBridgeTokenIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *Erc20bridgeSubmitCreateBridgeTokenIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// Erc20bridgeSubmitCreateBridgeToken represents a SubmitCreateBridgeToken event raised by the Erc20bridge contract. +type Erc20bridgeSubmitCreateBridgeToken struct { + DestinationChainID [32]byte + DestinationBridgeAddress common.Address + NativeContractAddress common.Address + TeleporterMessageID *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSubmitCreateBridgeToken is a free log retrieval operation binding the contract event 0x110b902745a3d7d6b66732479f01de654a3bc6e501be7c8ba2c3a6f9868cb539. +// +// Solidity: event SubmitCreateBridgeToken(bytes32 indexed destinationChainID, address indexed destinationBridgeAddress, address indexed nativeContractAddress, uint256 teleporterMessageID) +func (_Erc20bridge *Erc20bridgeFilterer) FilterSubmitCreateBridgeToken(opts *bind.FilterOpts, destinationChainID [][32]byte, destinationBridgeAddress []common.Address, nativeContractAddress []common.Address) (*Erc20bridgeSubmitCreateBridgeTokenIterator, error) { + + var destinationChainIDRule []interface{} + for _, destinationChainIDItem := range destinationChainID { + destinationChainIDRule = append(destinationChainIDRule, destinationChainIDItem) + } + var destinationBridgeAddressRule []interface{} + for _, destinationBridgeAddressItem := range destinationBridgeAddress { + destinationBridgeAddressRule = append(destinationBridgeAddressRule, destinationBridgeAddressItem) + } + var nativeContractAddressRule []interface{} + for _, nativeContractAddressItem := range nativeContractAddress { + nativeContractAddressRule = append(nativeContractAddressRule, nativeContractAddressItem) + } + + logs, sub, err := _Erc20bridge.contract.FilterLogs(opts, "SubmitCreateBridgeToken", destinationChainIDRule, destinationBridgeAddressRule, nativeContractAddressRule) + if err != nil { + return nil, err + } + return &Erc20bridgeSubmitCreateBridgeTokenIterator{contract: _Erc20bridge.contract, event: "SubmitCreateBridgeToken", logs: logs, sub: sub}, nil +} + +// WatchSubmitCreateBridgeToken is a free log subscription operation binding the contract event 0x110b902745a3d7d6b66732479f01de654a3bc6e501be7c8ba2c3a6f9868cb539. +// +// Solidity: event SubmitCreateBridgeToken(bytes32 indexed destinationChainID, address indexed destinationBridgeAddress, address indexed nativeContractAddress, uint256 teleporterMessageID) +func (_Erc20bridge *Erc20bridgeFilterer) WatchSubmitCreateBridgeToken(opts *bind.WatchOpts, sink chan<- *Erc20bridgeSubmitCreateBridgeToken, destinationChainID [][32]byte, destinationBridgeAddress []common.Address, nativeContractAddress []common.Address) (event.Subscription, error) { + + var destinationChainIDRule []interface{} + for _, destinationChainIDItem := range destinationChainID { + destinationChainIDRule = append(destinationChainIDRule, destinationChainIDItem) + } + var destinationBridgeAddressRule []interface{} + for _, destinationBridgeAddressItem := range destinationBridgeAddress { + destinationBridgeAddressRule = append(destinationBridgeAddressRule, destinationBridgeAddressItem) + } + var nativeContractAddressRule []interface{} + for _, nativeContractAddressItem := range nativeContractAddress { + nativeContractAddressRule = append(nativeContractAddressRule, nativeContractAddressItem) + } + + logs, sub, err := _Erc20bridge.contract.WatchLogs(opts, "SubmitCreateBridgeToken", destinationChainIDRule, destinationBridgeAddressRule, nativeContractAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(Erc20bridgeSubmitCreateBridgeToken) + if err := _Erc20bridge.contract.UnpackLog(event, "SubmitCreateBridgeToken", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSubmitCreateBridgeToken is a log parse operation binding the contract event 0x110b902745a3d7d6b66732479f01de654a3bc6e501be7c8ba2c3a6f9868cb539. +// +// Solidity: event SubmitCreateBridgeToken(bytes32 indexed destinationChainID, address indexed destinationBridgeAddress, address indexed nativeContractAddress, uint256 teleporterMessageID) +func (_Erc20bridge *Erc20bridgeFilterer) ParseSubmitCreateBridgeToken(log types.Log) (*Erc20bridgeSubmitCreateBridgeToken, error) { + event := new(Erc20bridgeSubmitCreateBridgeToken) + if err := _Erc20bridge.contract.UnpackLog(event, "SubmitCreateBridgeToken", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/abis/ExampleCrossChainMessenger/ExampleCrossChainMessenger.go b/abis/ExampleCrossChainMessenger/ExampleCrossChainMessenger.go new file mode 100644 index 000000000..0d752f9a5 --- /dev/null +++ b/abis/ExampleCrossChainMessenger/ExampleCrossChainMessenger.go @@ -0,0 +1,610 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package examplecrosschainmessenger + +import ( + "errors" + "math/big" + "strings" + + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" + "github.com/ava-labs/subnet-evm/core/types" + "github.com/ava-labs/subnet-evm/interfaces" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = interfaces.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// ExamplecrosschainmessengerMetaData contains all meta data concerning the Examplecrosschainmessenger contract. +var ExamplecrosschainmessengerMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"teleporterMessengerAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BalanceNotIncreased\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"originChainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"ReceiveMessage\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationChainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"feeAsset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"SendMessage\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originChainID\",\"type\":\"bytes32\"}],\"name\":\"getCurrentMessage\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originChainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"originSenderAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"receiveTeleporterMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationChainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"feeContractAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"sendMessage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"teleporterMessenger\",\"outputs\":[{\"internalType\":\"contractITeleporterMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +// ExamplecrosschainmessengerABI is the input ABI used to generate the binding from. +// Deprecated: Use ExamplecrosschainmessengerMetaData.ABI instead. +var ExamplecrosschainmessengerABI = ExamplecrosschainmessengerMetaData.ABI + +// Examplecrosschainmessenger is an auto generated Go binding around an Ethereum contract. +type Examplecrosschainmessenger struct { + ExamplecrosschainmessengerCaller // Read-only binding to the contract + ExamplecrosschainmessengerTransactor // Write-only binding to the contract + ExamplecrosschainmessengerFilterer // Log filterer for contract events +} + +// ExamplecrosschainmessengerCaller is an auto generated read-only Go binding around an Ethereum contract. +type ExamplecrosschainmessengerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ExamplecrosschainmessengerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ExamplecrosschainmessengerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ExamplecrosschainmessengerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ExamplecrosschainmessengerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ExamplecrosschainmessengerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ExamplecrosschainmessengerSession struct { + Contract *Examplecrosschainmessenger // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ExamplecrosschainmessengerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ExamplecrosschainmessengerCallerSession struct { + Contract *ExamplecrosschainmessengerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ExamplecrosschainmessengerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ExamplecrosschainmessengerTransactorSession struct { + Contract *ExamplecrosschainmessengerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ExamplecrosschainmessengerRaw is an auto generated low-level Go binding around an Ethereum contract. +type ExamplecrosschainmessengerRaw struct { + Contract *Examplecrosschainmessenger // Generic contract binding to access the raw methods on +} + +// ExamplecrosschainmessengerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ExamplecrosschainmessengerCallerRaw struct { + Contract *ExamplecrosschainmessengerCaller // Generic read-only contract binding to access the raw methods on +} + +// ExamplecrosschainmessengerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ExamplecrosschainmessengerTransactorRaw struct { + Contract *ExamplecrosschainmessengerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewExamplecrosschainmessenger creates a new instance of Examplecrosschainmessenger, bound to a specific deployed contract. +func NewExamplecrosschainmessenger(address common.Address, backend bind.ContractBackend) (*Examplecrosschainmessenger, error) { + contract, err := bindExamplecrosschainmessenger(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Examplecrosschainmessenger{ExamplecrosschainmessengerCaller: ExamplecrosschainmessengerCaller{contract: contract}, ExamplecrosschainmessengerTransactor: ExamplecrosschainmessengerTransactor{contract: contract}, ExamplecrosschainmessengerFilterer: ExamplecrosschainmessengerFilterer{contract: contract}}, nil +} + +// NewExamplecrosschainmessengerCaller creates a new read-only instance of Examplecrosschainmessenger, bound to a specific deployed contract. +func NewExamplecrosschainmessengerCaller(address common.Address, caller bind.ContractCaller) (*ExamplecrosschainmessengerCaller, error) { + contract, err := bindExamplecrosschainmessenger(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ExamplecrosschainmessengerCaller{contract: contract}, nil +} + +// NewExamplecrosschainmessengerTransactor creates a new write-only instance of Examplecrosschainmessenger, bound to a specific deployed contract. +func NewExamplecrosschainmessengerTransactor(address common.Address, transactor bind.ContractTransactor) (*ExamplecrosschainmessengerTransactor, error) { + contract, err := bindExamplecrosschainmessenger(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ExamplecrosschainmessengerTransactor{contract: contract}, nil +} + +// NewExamplecrosschainmessengerFilterer creates a new log filterer instance of Examplecrosschainmessenger, bound to a specific deployed contract. +func NewExamplecrosschainmessengerFilterer(address common.Address, filterer bind.ContractFilterer) (*ExamplecrosschainmessengerFilterer, error) { + contract, err := bindExamplecrosschainmessenger(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ExamplecrosschainmessengerFilterer{contract: contract}, nil +} + +// bindExamplecrosschainmessenger binds a generic wrapper to an already deployed contract. +func bindExamplecrosschainmessenger(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ExamplecrosschainmessengerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Examplecrosschainmessenger.Contract.ExamplecrosschainmessengerCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Examplecrosschainmessenger.Contract.ExamplecrosschainmessengerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Examplecrosschainmessenger.Contract.ExamplecrosschainmessengerTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Examplecrosschainmessenger.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Examplecrosschainmessenger.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Examplecrosschainmessenger.Contract.contract.Transact(opts, method, params...) +} + +// GetCurrentMessage is a free data retrieval call binding the contract method 0xb33fead4. +// +// Solidity: function getCurrentMessage(bytes32 originChainID) view returns(address sender, string message) +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerCaller) GetCurrentMessage(opts *bind.CallOpts, originChainID [32]byte) (struct { + Sender common.Address + Message string +}, error) { + var out []interface{} + err := _Examplecrosschainmessenger.contract.Call(opts, &out, "getCurrentMessage", originChainID) + + outstruct := new(struct { + Sender common.Address + Message string + }) + if err != nil { + return *outstruct, err + } + + outstruct.Sender = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.Message = *abi.ConvertType(out[1], new(string)).(*string) + + return *outstruct, err + +} + +// GetCurrentMessage is a free data retrieval call binding the contract method 0xb33fead4. +// +// Solidity: function getCurrentMessage(bytes32 originChainID) view returns(address sender, string message) +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerSession) GetCurrentMessage(originChainID [32]byte) (struct { + Sender common.Address + Message string +}, error) { + return _Examplecrosschainmessenger.Contract.GetCurrentMessage(&_Examplecrosschainmessenger.CallOpts, originChainID) +} + +// GetCurrentMessage is a free data retrieval call binding the contract method 0xb33fead4. +// +// Solidity: function getCurrentMessage(bytes32 originChainID) view returns(address sender, string message) +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerCallerSession) GetCurrentMessage(originChainID [32]byte) (struct { + Sender common.Address + Message string +}, error) { + return _Examplecrosschainmessenger.Contract.GetCurrentMessage(&_Examplecrosschainmessenger.CallOpts, originChainID) +} + +// TeleporterMessenger is a free data retrieval call binding the contract method 0x9b3e5803. +// +// Solidity: function teleporterMessenger() view returns(address) +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerCaller) TeleporterMessenger(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Examplecrosschainmessenger.contract.Call(opts, &out, "teleporterMessenger") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// TeleporterMessenger is a free data retrieval call binding the contract method 0x9b3e5803. +// +// Solidity: function teleporterMessenger() view returns(address) +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerSession) TeleporterMessenger() (common.Address, error) { + return _Examplecrosschainmessenger.Contract.TeleporterMessenger(&_Examplecrosschainmessenger.CallOpts) +} + +// TeleporterMessenger is a free data retrieval call binding the contract method 0x9b3e5803. +// +// Solidity: function teleporterMessenger() view returns(address) +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerCallerSession) TeleporterMessenger() (common.Address, error) { + return _Examplecrosschainmessenger.Contract.TeleporterMessenger(&_Examplecrosschainmessenger.CallOpts) +} + +// ReceiveTeleporterMessage is a paid mutator transaction binding the contract method 0xc868efaa. +// +// Solidity: function receiveTeleporterMessage(bytes32 originChainID, address originSenderAddress, bytes message) returns() +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerTransactor) ReceiveTeleporterMessage(opts *bind.TransactOpts, originChainID [32]byte, originSenderAddress common.Address, message []byte) (*types.Transaction, error) { + return _Examplecrosschainmessenger.contract.Transact(opts, "receiveTeleporterMessage", originChainID, originSenderAddress, message) +} + +// ReceiveTeleporterMessage is a paid mutator transaction binding the contract method 0xc868efaa. +// +// Solidity: function receiveTeleporterMessage(bytes32 originChainID, address originSenderAddress, bytes message) returns() +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerSession) ReceiveTeleporterMessage(originChainID [32]byte, originSenderAddress common.Address, message []byte) (*types.Transaction, error) { + return _Examplecrosschainmessenger.Contract.ReceiveTeleporterMessage(&_Examplecrosschainmessenger.TransactOpts, originChainID, originSenderAddress, message) +} + +// ReceiveTeleporterMessage is a paid mutator transaction binding the contract method 0xc868efaa. +// +// Solidity: function receiveTeleporterMessage(bytes32 originChainID, address originSenderAddress, bytes message) returns() +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerTransactorSession) ReceiveTeleporterMessage(originChainID [32]byte, originSenderAddress common.Address, message []byte) (*types.Transaction, error) { + return _Examplecrosschainmessenger.Contract.ReceiveTeleporterMessage(&_Examplecrosschainmessenger.TransactOpts, originChainID, originSenderAddress, message) +} + +// SendMessage is a paid mutator transaction binding the contract method 0xf63d09d7. +// +// Solidity: function sendMessage(bytes32 destinationChainID, address destinationAddress, address feeContractAddress, uint256 feeAmount, uint256 requiredGasLimit, string message) returns(uint256 messageID) +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerTransactor) SendMessage(opts *bind.TransactOpts, destinationChainID [32]byte, destinationAddress common.Address, feeContractAddress common.Address, feeAmount *big.Int, requiredGasLimit *big.Int, message string) (*types.Transaction, error) { + return _Examplecrosschainmessenger.contract.Transact(opts, "sendMessage", destinationChainID, destinationAddress, feeContractAddress, feeAmount, requiredGasLimit, message) +} + +// SendMessage is a paid mutator transaction binding the contract method 0xf63d09d7. +// +// Solidity: function sendMessage(bytes32 destinationChainID, address destinationAddress, address feeContractAddress, uint256 feeAmount, uint256 requiredGasLimit, string message) returns(uint256 messageID) +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerSession) SendMessage(destinationChainID [32]byte, destinationAddress common.Address, feeContractAddress common.Address, feeAmount *big.Int, requiredGasLimit *big.Int, message string) (*types.Transaction, error) { + return _Examplecrosschainmessenger.Contract.SendMessage(&_Examplecrosschainmessenger.TransactOpts, destinationChainID, destinationAddress, feeContractAddress, feeAmount, requiredGasLimit, message) +} + +// SendMessage is a paid mutator transaction binding the contract method 0xf63d09d7. +// +// Solidity: function sendMessage(bytes32 destinationChainID, address destinationAddress, address feeContractAddress, uint256 feeAmount, uint256 requiredGasLimit, string message) returns(uint256 messageID) +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerTransactorSession) SendMessage(destinationChainID [32]byte, destinationAddress common.Address, feeContractAddress common.Address, feeAmount *big.Int, requiredGasLimit *big.Int, message string) (*types.Transaction, error) { + return _Examplecrosschainmessenger.Contract.SendMessage(&_Examplecrosschainmessenger.TransactOpts, destinationChainID, destinationAddress, feeContractAddress, feeAmount, requiredGasLimit, message) +} + +// ExamplecrosschainmessengerReceiveMessageIterator is returned from FilterReceiveMessage and is used to iterate over the raw logs and unpacked data for ReceiveMessage events raised by the Examplecrosschainmessenger contract. +type ExamplecrosschainmessengerReceiveMessageIterator struct { + Event *ExamplecrosschainmessengerReceiveMessage // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ExamplecrosschainmessengerReceiveMessageIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ExamplecrosschainmessengerReceiveMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ExamplecrosschainmessengerReceiveMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ExamplecrosschainmessengerReceiveMessageIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ExamplecrosschainmessengerReceiveMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ExamplecrosschainmessengerReceiveMessage represents a ReceiveMessage event raised by the Examplecrosschainmessenger contract. +type ExamplecrosschainmessengerReceiveMessage struct { + OriginChainID [32]byte + OriginSenderAddress common.Address + Message string + Raw types.Log // Blockchain specific contextual infos +} + +// FilterReceiveMessage is a free log retrieval operation binding the contract event 0x1f5c800b5f2b573929a7948f82a199c2a212851b53a6c5bd703ece23999d24aa. +// +// Solidity: event ReceiveMessage(bytes32 indexed originChainID, address indexed originSenderAddress, string message) +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerFilterer) FilterReceiveMessage(opts *bind.FilterOpts, originChainID [][32]byte, originSenderAddress []common.Address) (*ExamplecrosschainmessengerReceiveMessageIterator, error) { + + var originChainIDRule []interface{} + for _, originChainIDItem := range originChainID { + originChainIDRule = append(originChainIDRule, originChainIDItem) + } + var originSenderAddressRule []interface{} + for _, originSenderAddressItem := range originSenderAddress { + originSenderAddressRule = append(originSenderAddressRule, originSenderAddressItem) + } + + logs, sub, err := _Examplecrosschainmessenger.contract.FilterLogs(opts, "ReceiveMessage", originChainIDRule, originSenderAddressRule) + if err != nil { + return nil, err + } + return &ExamplecrosschainmessengerReceiveMessageIterator{contract: _Examplecrosschainmessenger.contract, event: "ReceiveMessage", logs: logs, sub: sub}, nil +} + +// WatchReceiveMessage is a free log subscription operation binding the contract event 0x1f5c800b5f2b573929a7948f82a199c2a212851b53a6c5bd703ece23999d24aa. +// +// Solidity: event ReceiveMessage(bytes32 indexed originChainID, address indexed originSenderAddress, string message) +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerFilterer) WatchReceiveMessage(opts *bind.WatchOpts, sink chan<- *ExamplecrosschainmessengerReceiveMessage, originChainID [][32]byte, originSenderAddress []common.Address) (event.Subscription, error) { + + var originChainIDRule []interface{} + for _, originChainIDItem := range originChainID { + originChainIDRule = append(originChainIDRule, originChainIDItem) + } + var originSenderAddressRule []interface{} + for _, originSenderAddressItem := range originSenderAddress { + originSenderAddressRule = append(originSenderAddressRule, originSenderAddressItem) + } + + logs, sub, err := _Examplecrosschainmessenger.contract.WatchLogs(opts, "ReceiveMessage", originChainIDRule, originSenderAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ExamplecrosschainmessengerReceiveMessage) + if err := _Examplecrosschainmessenger.contract.UnpackLog(event, "ReceiveMessage", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseReceiveMessage is a log parse operation binding the contract event 0x1f5c800b5f2b573929a7948f82a199c2a212851b53a6c5bd703ece23999d24aa. +// +// Solidity: event ReceiveMessage(bytes32 indexed originChainID, address indexed originSenderAddress, string message) +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerFilterer) ParseReceiveMessage(log types.Log) (*ExamplecrosschainmessengerReceiveMessage, error) { + event := new(ExamplecrosschainmessengerReceiveMessage) + if err := _Examplecrosschainmessenger.contract.UnpackLog(event, "ReceiveMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ExamplecrosschainmessengerSendMessageIterator is returned from FilterSendMessage and is used to iterate over the raw logs and unpacked data for SendMessage events raised by the Examplecrosschainmessenger contract. +type ExamplecrosschainmessengerSendMessageIterator struct { + Event *ExamplecrosschainmessengerSendMessage // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *ExamplecrosschainmessengerSendMessageIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(ExamplecrosschainmessengerSendMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(ExamplecrosschainmessengerSendMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *ExamplecrosschainmessengerSendMessageIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ExamplecrosschainmessengerSendMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ExamplecrosschainmessengerSendMessage represents a SendMessage event raised by the Examplecrosschainmessenger contract. +type ExamplecrosschainmessengerSendMessage struct { + DestinationChainID [32]byte + DestinationAddress common.Address + FeeAsset common.Address + FeeAmount *big.Int + RequiredGasLimit *big.Int + Message string + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSendMessage is a free log retrieval operation binding the contract event 0xa06eff1edd0c66b8dc96d086dda7ba263edf88d7417e6cb15073b5e7bff8a8ca. +// +// Solidity: event SendMessage(bytes32 indexed destinationChainID, address indexed destinationAddress, address feeAsset, uint256 feeAmount, uint256 requiredGasLimit, string message) +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerFilterer) FilterSendMessage(opts *bind.FilterOpts, destinationChainID [][32]byte, destinationAddress []common.Address) (*ExamplecrosschainmessengerSendMessageIterator, error) { + + var destinationChainIDRule []interface{} + for _, destinationChainIDItem := range destinationChainID { + destinationChainIDRule = append(destinationChainIDRule, destinationChainIDItem) + } + var destinationAddressRule []interface{} + for _, destinationAddressItem := range destinationAddress { + destinationAddressRule = append(destinationAddressRule, destinationAddressItem) + } + + logs, sub, err := _Examplecrosschainmessenger.contract.FilterLogs(opts, "SendMessage", destinationChainIDRule, destinationAddressRule) + if err != nil { + return nil, err + } + return &ExamplecrosschainmessengerSendMessageIterator{contract: _Examplecrosschainmessenger.contract, event: "SendMessage", logs: logs, sub: sub}, nil +} + +// WatchSendMessage is a free log subscription operation binding the contract event 0xa06eff1edd0c66b8dc96d086dda7ba263edf88d7417e6cb15073b5e7bff8a8ca. +// +// Solidity: event SendMessage(bytes32 indexed destinationChainID, address indexed destinationAddress, address feeAsset, uint256 feeAmount, uint256 requiredGasLimit, string message) +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerFilterer) WatchSendMessage(opts *bind.WatchOpts, sink chan<- *ExamplecrosschainmessengerSendMessage, destinationChainID [][32]byte, destinationAddress []common.Address) (event.Subscription, error) { + + var destinationChainIDRule []interface{} + for _, destinationChainIDItem := range destinationChainID { + destinationChainIDRule = append(destinationChainIDRule, destinationChainIDItem) + } + var destinationAddressRule []interface{} + for _, destinationAddressItem := range destinationAddress { + destinationAddressRule = append(destinationAddressRule, destinationAddressItem) + } + + logs, sub, err := _Examplecrosschainmessenger.contract.WatchLogs(opts, "SendMessage", destinationChainIDRule, destinationAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ExamplecrosschainmessengerSendMessage) + if err := _Examplecrosschainmessenger.contract.UnpackLog(event, "SendMessage", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSendMessage is a log parse operation binding the contract event 0xa06eff1edd0c66b8dc96d086dda7ba263edf88d7417e6cb15073b5e7bff8a8ca. +// +// Solidity: event SendMessage(bytes32 indexed destinationChainID, address indexed destinationAddress, address feeAsset, uint256 feeAmount, uint256 requiredGasLimit, string message) +func (_Examplecrosschainmessenger *ExamplecrosschainmessengerFilterer) ParseSendMessage(log types.Log) (*ExamplecrosschainmessengerSendMessage, error) { + event := new(ExamplecrosschainmessengerSendMessage) + if err := _Examplecrosschainmessenger.contract.UnpackLog(event, "SendMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/abis/TeleporterMessenger/TeleporterMessenger.go b/abis/TeleporterMessenger/TeleporterMessenger.go new file mode 100644 index 000000000..3bf06056c --- /dev/null +++ b/abis/TeleporterMessenger/TeleporterMessenger.go @@ -0,0 +1,1716 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package teleportermessenger + +import ( + "errors" + "math/big" + "strings" + + "github.com/ava-labs/subnet-evm/accounts/abi" + "github.com/ava-labs/subnet-evm/accounts/abi/bind" + "github.com/ava-labs/subnet-evm/core/types" + "github.com/ava-labs/subnet-evm/interfaces" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = interfaces.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// TeleporterFeeInfo is an auto generated low-level Go binding around an user-defined struct. +type TeleporterFeeInfo struct { + ContractAddress common.Address + Amount *big.Int +} + +// TeleporterMessage is an auto generated low-level Go binding around an user-defined struct. +type TeleporterMessage struct { + MessageID *big.Int + SenderAddress common.Address + DestinationAddress common.Address + RequiredGasLimit *big.Int + AllowedRelayerAddresses []common.Address + Receipts []TeleporterMessageReceipt + Message []byte +} + +// TeleporterMessageInput is an auto generated low-level Go binding around an user-defined struct. +type TeleporterMessageInput struct { + DestinationChainID [32]byte + DestinationAddress common.Address + FeeInfo TeleporterFeeInfo + RequiredGasLimit *big.Int + AllowedRelayerAddresses []common.Address + Message []byte +} + +// TeleporterMessageReceipt is an auto generated low-level Go binding around an user-defined struct. +type TeleporterMessageReceipt struct { + ReceivedMessageID *big.Int + RelayerRewardAddress common.Address +} + +// TeleportermessengerMetaData contains all meta data concerning the Teleportermessenger contract. +var TeleportermessengerMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BalanceNotIncreased\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientGas\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAdditionalFeeAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDestinationAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDestinationChainID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFeeAssetContractAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidMessageHash\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidOriginSenderAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRelayerRewardAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidWarpMessage\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MessageAlreadyDelivered\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MessageNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MessageRetryExecutionFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoRelayerRewardToRedeem\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReceiptNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReceiverReentrancy\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderReentrancy\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedRelayer\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationChainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"updatedFeeInfo\",\"type\":\"tuple\"}],\"name\":\"AddFeeAmount\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"originChainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt[]\",\"name\":\"receipts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structTeleporterMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"FailedMessageExecution\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"originChainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"name\":\"MessageExecutionRetried\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"originChainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt[]\",\"name\":\"receipts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structTeleporterMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"ReceiveCrossChainMessage\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"destinationChainID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt[]\",\"name\":\"receipts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"structTeleporterMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"SendCrossChainMessage\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAXIMUM_RECEIPT_COUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINIMUM_REQUIRED_CALL_DATA_LENGTH\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REQUIRED_ORIGIN_CHAIN_ID_START_INDEX\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WARP_MESSENGER\",\"outputs\":[{\"internalType\":\"contractWarpMessenger\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationChainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeContractAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"additionalFeeAmount\",\"type\":\"uint256\"}],\"name\":\"addFeeAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blockchainID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delivererAddress\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayers\",\"type\":\"address[]\"}],\"name\":\"checkIsAllowedRelayer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"feeAsset\",\"type\":\"address\"}],\"name\":\"checkRelayerRewardAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationChainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"name\":\"getFeeInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"feeAsset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationChainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"name\":\"getMessageHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"chainID\",\"type\":\"bytes32\"}],\"name\":\"getNextMessageID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originChainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"name\":\"getRelayerRewardAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"latestMessageIDs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originChainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"name\":\"messageReceived\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"delivered\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"outstandingReceipts\",\"outputs\":[{\"internalType\":\"contractReceiptQueue\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"messageIndex\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"name\":\"receiveCrossChainMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"receivedFailedMessageHashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"feeAsset\",\"type\":\"address\"}],\"name\":\"redeemRelayerRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"relayerRewardAddresses\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"relayerRewardAmounts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originChainID\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt[]\",\"name\":\"receipts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"internalType\":\"structTeleporterMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"retryMessageExecution\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"originChainID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256[]\",\"name\":\"messageIDs\",\"type\":\"uint256[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"feeInfo\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"}],\"name\":\"retryReceipts\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"destinationChainID\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"senderAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"receivedMessageID\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"relayerRewardAddress\",\"type\":\"address\"}],\"internalType\":\"structTeleporterMessageReceipt[]\",\"name\":\"receipts\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"internalType\":\"structTeleporterMessage\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"retrySendCrossChainMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"destinationChainID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"feeInfo\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"requiredGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"allowedRelayerAddresses\",\"type\":\"address[]\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"internalType\":\"structTeleporterMessageInput\",\"name\":\"messageInput\",\"type\":\"tuple\"}],\"name\":\"sendCrossChainMessage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"messageID\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"sentMessageInfo\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"messageHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"structTeleporterFeeInfo\",\"name\":\"feeInfo\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +// TeleportermessengerABI is the input ABI used to generate the binding from. +// Deprecated: Use TeleportermessengerMetaData.ABI instead. +var TeleportermessengerABI = TeleportermessengerMetaData.ABI + +// Teleportermessenger is an auto generated Go binding around an Ethereum contract. +type Teleportermessenger struct { + TeleportermessengerCaller // Read-only binding to the contract + TeleportermessengerTransactor // Write-only binding to the contract + TeleportermessengerFilterer // Log filterer for contract events +} + +// TeleportermessengerCaller is an auto generated read-only Go binding around an Ethereum contract. +type TeleportermessengerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TeleportermessengerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type TeleportermessengerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TeleportermessengerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type TeleportermessengerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TeleportermessengerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type TeleportermessengerSession struct { + Contract *Teleportermessenger // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TeleportermessengerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type TeleportermessengerCallerSession struct { + Contract *TeleportermessengerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// TeleportermessengerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type TeleportermessengerTransactorSession struct { + Contract *TeleportermessengerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TeleportermessengerRaw is an auto generated low-level Go binding around an Ethereum contract. +type TeleportermessengerRaw struct { + Contract *Teleportermessenger // Generic contract binding to access the raw methods on +} + +// TeleportermessengerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type TeleportermessengerCallerRaw struct { + Contract *TeleportermessengerCaller // Generic read-only contract binding to access the raw methods on +} + +// TeleportermessengerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type TeleportermessengerTransactorRaw struct { + Contract *TeleportermessengerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewTeleportermessenger creates a new instance of Teleportermessenger, bound to a specific deployed contract. +func NewTeleportermessenger(address common.Address, backend bind.ContractBackend) (*Teleportermessenger, error) { + contract, err := bindTeleportermessenger(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Teleportermessenger{TeleportermessengerCaller: TeleportermessengerCaller{contract: contract}, TeleportermessengerTransactor: TeleportermessengerTransactor{contract: contract}, TeleportermessengerFilterer: TeleportermessengerFilterer{contract: contract}}, nil +} + +// NewTeleportermessengerCaller creates a new read-only instance of Teleportermessenger, bound to a specific deployed contract. +func NewTeleportermessengerCaller(address common.Address, caller bind.ContractCaller) (*TeleportermessengerCaller, error) { + contract, err := bindTeleportermessenger(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &TeleportermessengerCaller{contract: contract}, nil +} + +// NewTeleportermessengerTransactor creates a new write-only instance of Teleportermessenger, bound to a specific deployed contract. +func NewTeleportermessengerTransactor(address common.Address, transactor bind.ContractTransactor) (*TeleportermessengerTransactor, error) { + contract, err := bindTeleportermessenger(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &TeleportermessengerTransactor{contract: contract}, nil +} + +// NewTeleportermessengerFilterer creates a new log filterer instance of Teleportermessenger, bound to a specific deployed contract. +func NewTeleportermessengerFilterer(address common.Address, filterer bind.ContractFilterer) (*TeleportermessengerFilterer, error) { + contract, err := bindTeleportermessenger(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &TeleportermessengerFilterer{contract: contract}, nil +} + +// bindTeleportermessenger binds a generic wrapper to an already deployed contract. +func bindTeleportermessenger(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := TeleportermessengerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Teleportermessenger *TeleportermessengerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Teleportermessenger.Contract.TeleportermessengerCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Teleportermessenger *TeleportermessengerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Teleportermessenger.Contract.TeleportermessengerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Teleportermessenger *TeleportermessengerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Teleportermessenger.Contract.TeleportermessengerTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Teleportermessenger *TeleportermessengerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Teleportermessenger.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Teleportermessenger *TeleportermessengerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Teleportermessenger.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Teleportermessenger *TeleportermessengerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Teleportermessenger.Contract.contract.Transact(opts, method, params...) +} + +// MAXIMUMRECEIPTCOUNT is a free data retrieval call binding the contract method 0x10534371. +// +// Solidity: function MAXIMUM_RECEIPT_COUNT() view returns(uint256) +func (_Teleportermessenger *TeleportermessengerCaller) MAXIMUMRECEIPTCOUNT(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "MAXIMUM_RECEIPT_COUNT") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MAXIMUMRECEIPTCOUNT is a free data retrieval call binding the contract method 0x10534371. +// +// Solidity: function MAXIMUM_RECEIPT_COUNT() view returns(uint256) +func (_Teleportermessenger *TeleportermessengerSession) MAXIMUMRECEIPTCOUNT() (*big.Int, error) { + return _Teleportermessenger.Contract.MAXIMUMRECEIPTCOUNT(&_Teleportermessenger.CallOpts) +} + +// MAXIMUMRECEIPTCOUNT is a free data retrieval call binding the contract method 0x10534371. +// +// Solidity: function MAXIMUM_RECEIPT_COUNT() view returns(uint256) +func (_Teleportermessenger *TeleportermessengerCallerSession) MAXIMUMRECEIPTCOUNT() (*big.Int, error) { + return _Teleportermessenger.Contract.MAXIMUMRECEIPTCOUNT(&_Teleportermessenger.CallOpts) +} + +// MINIMUMREQUIREDCALLDATALENGTH is a free data retrieval call binding the contract method 0x8f12376f. +// +// Solidity: function MINIMUM_REQUIRED_CALL_DATA_LENGTH() view returns(uint256) +func (_Teleportermessenger *TeleportermessengerCaller) MINIMUMREQUIREDCALLDATALENGTH(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "MINIMUM_REQUIRED_CALL_DATA_LENGTH") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MINIMUMREQUIREDCALLDATALENGTH is a free data retrieval call binding the contract method 0x8f12376f. +// +// Solidity: function MINIMUM_REQUIRED_CALL_DATA_LENGTH() view returns(uint256) +func (_Teleportermessenger *TeleportermessengerSession) MINIMUMREQUIREDCALLDATALENGTH() (*big.Int, error) { + return _Teleportermessenger.Contract.MINIMUMREQUIREDCALLDATALENGTH(&_Teleportermessenger.CallOpts) +} + +// MINIMUMREQUIREDCALLDATALENGTH is a free data retrieval call binding the contract method 0x8f12376f. +// +// Solidity: function MINIMUM_REQUIRED_CALL_DATA_LENGTH() view returns(uint256) +func (_Teleportermessenger *TeleportermessengerCallerSession) MINIMUMREQUIREDCALLDATALENGTH() (*big.Int, error) { + return _Teleportermessenger.Contract.MINIMUMREQUIREDCALLDATALENGTH(&_Teleportermessenger.CallOpts) +} + +// REQUIREDORIGINCHAINIDSTARTINDEX is a free data retrieval call binding the contract method 0x5bf91119. +// +// Solidity: function REQUIRED_ORIGIN_CHAIN_ID_START_INDEX() view returns(uint256) +func (_Teleportermessenger *TeleportermessengerCaller) REQUIREDORIGINCHAINIDSTARTINDEX(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "REQUIRED_ORIGIN_CHAIN_ID_START_INDEX") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// REQUIREDORIGINCHAINIDSTARTINDEX is a free data retrieval call binding the contract method 0x5bf91119. +// +// Solidity: function REQUIRED_ORIGIN_CHAIN_ID_START_INDEX() view returns(uint256) +func (_Teleportermessenger *TeleportermessengerSession) REQUIREDORIGINCHAINIDSTARTINDEX() (*big.Int, error) { + return _Teleportermessenger.Contract.REQUIREDORIGINCHAINIDSTARTINDEX(&_Teleportermessenger.CallOpts) +} + +// REQUIREDORIGINCHAINIDSTARTINDEX is a free data retrieval call binding the contract method 0x5bf91119. +// +// Solidity: function REQUIRED_ORIGIN_CHAIN_ID_START_INDEX() view returns(uint256) +func (_Teleportermessenger *TeleportermessengerCallerSession) REQUIREDORIGINCHAINIDSTARTINDEX() (*big.Int, error) { + return _Teleportermessenger.Contract.REQUIREDORIGINCHAINIDSTARTINDEX(&_Teleportermessenger.CallOpts) +} + +// WARPMESSENGER is a free data retrieval call binding the contract method 0xb771b3bc. +// +// Solidity: function WARP_MESSENGER() view returns(address) +func (_Teleportermessenger *TeleportermessengerCaller) WARPMESSENGER(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "WARP_MESSENGER") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// WARPMESSENGER is a free data retrieval call binding the contract method 0xb771b3bc. +// +// Solidity: function WARP_MESSENGER() view returns(address) +func (_Teleportermessenger *TeleportermessengerSession) WARPMESSENGER() (common.Address, error) { + return _Teleportermessenger.Contract.WARPMESSENGER(&_Teleportermessenger.CallOpts) +} + +// WARPMESSENGER is a free data retrieval call binding the contract method 0xb771b3bc. +// +// Solidity: function WARP_MESSENGER() view returns(address) +func (_Teleportermessenger *TeleportermessengerCallerSession) WARPMESSENGER() (common.Address, error) { + return _Teleportermessenger.Contract.WARPMESSENGER(&_Teleportermessenger.CallOpts) +} + +// BlockchainID is a free data retrieval call binding the contract method 0xd127dc9b. +// +// Solidity: function blockchainID() view returns(bytes32) +func (_Teleportermessenger *TeleportermessengerCaller) BlockchainID(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "blockchainID") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// BlockchainID is a free data retrieval call binding the contract method 0xd127dc9b. +// +// Solidity: function blockchainID() view returns(bytes32) +func (_Teleportermessenger *TeleportermessengerSession) BlockchainID() ([32]byte, error) { + return _Teleportermessenger.Contract.BlockchainID(&_Teleportermessenger.CallOpts) +} + +// BlockchainID is a free data retrieval call binding the contract method 0xd127dc9b. +// +// Solidity: function blockchainID() view returns(bytes32) +func (_Teleportermessenger *TeleportermessengerCallerSession) BlockchainID() ([32]byte, error) { + return _Teleportermessenger.Contract.BlockchainID(&_Teleportermessenger.CallOpts) +} + +// CheckIsAllowedRelayer is a free data retrieval call binding the contract method 0x65171908. +// +// Solidity: function checkIsAllowedRelayer(address delivererAddress, address[] allowedRelayers) pure returns(bool) +func (_Teleportermessenger *TeleportermessengerCaller) CheckIsAllowedRelayer(opts *bind.CallOpts, delivererAddress common.Address, allowedRelayers []common.Address) (bool, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "checkIsAllowedRelayer", delivererAddress, allowedRelayers) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// CheckIsAllowedRelayer is a free data retrieval call binding the contract method 0x65171908. +// +// Solidity: function checkIsAllowedRelayer(address delivererAddress, address[] allowedRelayers) pure returns(bool) +func (_Teleportermessenger *TeleportermessengerSession) CheckIsAllowedRelayer(delivererAddress common.Address, allowedRelayers []common.Address) (bool, error) { + return _Teleportermessenger.Contract.CheckIsAllowedRelayer(&_Teleportermessenger.CallOpts, delivererAddress, allowedRelayers) +} + +// CheckIsAllowedRelayer is a free data retrieval call binding the contract method 0x65171908. +// +// Solidity: function checkIsAllowedRelayer(address delivererAddress, address[] allowedRelayers) pure returns(bool) +func (_Teleportermessenger *TeleportermessengerCallerSession) CheckIsAllowedRelayer(delivererAddress common.Address, allowedRelayers []common.Address) (bool, error) { + return _Teleportermessenger.Contract.CheckIsAllowedRelayer(&_Teleportermessenger.CallOpts, delivererAddress, allowedRelayers) +} + +// CheckRelayerRewardAmount is a free data retrieval call binding the contract method 0xc473eef8. +// +// Solidity: function checkRelayerRewardAmount(address relayer, address feeAsset) view returns(uint256) +func (_Teleportermessenger *TeleportermessengerCaller) CheckRelayerRewardAmount(opts *bind.CallOpts, relayer common.Address, feeAsset common.Address) (*big.Int, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "checkRelayerRewardAmount", relayer, feeAsset) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// CheckRelayerRewardAmount is a free data retrieval call binding the contract method 0xc473eef8. +// +// Solidity: function checkRelayerRewardAmount(address relayer, address feeAsset) view returns(uint256) +func (_Teleportermessenger *TeleportermessengerSession) CheckRelayerRewardAmount(relayer common.Address, feeAsset common.Address) (*big.Int, error) { + return _Teleportermessenger.Contract.CheckRelayerRewardAmount(&_Teleportermessenger.CallOpts, relayer, feeAsset) +} + +// CheckRelayerRewardAmount is a free data retrieval call binding the contract method 0xc473eef8. +// +// Solidity: function checkRelayerRewardAmount(address relayer, address feeAsset) view returns(uint256) +func (_Teleportermessenger *TeleportermessengerCallerSession) CheckRelayerRewardAmount(relayer common.Address, feeAsset common.Address) (*big.Int, error) { + return _Teleportermessenger.Contract.CheckRelayerRewardAmount(&_Teleportermessenger.CallOpts, relayer, feeAsset) +} + +// GetFeeInfo is a free data retrieval call binding the contract method 0x82f2c43a. +// +// Solidity: function getFeeInfo(bytes32 destinationChainID, uint256 messageID) view returns(address feeAsset, uint256 feeAmount) +func (_Teleportermessenger *TeleportermessengerCaller) GetFeeInfo(opts *bind.CallOpts, destinationChainID [32]byte, messageID *big.Int) (struct { + FeeAsset common.Address + FeeAmount *big.Int +}, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "getFeeInfo", destinationChainID, messageID) + + outstruct := new(struct { + FeeAsset common.Address + FeeAmount *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.FeeAsset = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.FeeAmount = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// GetFeeInfo is a free data retrieval call binding the contract method 0x82f2c43a. +// +// Solidity: function getFeeInfo(bytes32 destinationChainID, uint256 messageID) view returns(address feeAsset, uint256 feeAmount) +func (_Teleportermessenger *TeleportermessengerSession) GetFeeInfo(destinationChainID [32]byte, messageID *big.Int) (struct { + FeeAsset common.Address + FeeAmount *big.Int +}, error) { + return _Teleportermessenger.Contract.GetFeeInfo(&_Teleportermessenger.CallOpts, destinationChainID, messageID) +} + +// GetFeeInfo is a free data retrieval call binding the contract method 0x82f2c43a. +// +// Solidity: function getFeeInfo(bytes32 destinationChainID, uint256 messageID) view returns(address feeAsset, uint256 feeAmount) +func (_Teleportermessenger *TeleportermessengerCallerSession) GetFeeInfo(destinationChainID [32]byte, messageID *big.Int) (struct { + FeeAsset common.Address + FeeAmount *big.Int +}, error) { + return _Teleportermessenger.Contract.GetFeeInfo(&_Teleportermessenger.CallOpts, destinationChainID, messageID) +} + +// GetMessageHash is a free data retrieval call binding the contract method 0x220c9568. +// +// Solidity: function getMessageHash(bytes32 destinationChainID, uint256 messageID) view returns(bytes32 messageHash) +func (_Teleportermessenger *TeleportermessengerCaller) GetMessageHash(opts *bind.CallOpts, destinationChainID [32]byte, messageID *big.Int) ([32]byte, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "getMessageHash", destinationChainID, messageID) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetMessageHash is a free data retrieval call binding the contract method 0x220c9568. +// +// Solidity: function getMessageHash(bytes32 destinationChainID, uint256 messageID) view returns(bytes32 messageHash) +func (_Teleportermessenger *TeleportermessengerSession) GetMessageHash(destinationChainID [32]byte, messageID *big.Int) ([32]byte, error) { + return _Teleportermessenger.Contract.GetMessageHash(&_Teleportermessenger.CallOpts, destinationChainID, messageID) +} + +// GetMessageHash is a free data retrieval call binding the contract method 0x220c9568. +// +// Solidity: function getMessageHash(bytes32 destinationChainID, uint256 messageID) view returns(bytes32 messageHash) +func (_Teleportermessenger *TeleportermessengerCallerSession) GetMessageHash(destinationChainID [32]byte, messageID *big.Int) ([32]byte, error) { + return _Teleportermessenger.Contract.GetMessageHash(&_Teleportermessenger.CallOpts, destinationChainID, messageID) +} + +// GetNextMessageID is a free data retrieval call binding the contract method 0xdf20e8bc. +// +// Solidity: function getNextMessageID(bytes32 chainID) view returns(uint256 messageID) +func (_Teleportermessenger *TeleportermessengerCaller) GetNextMessageID(opts *bind.CallOpts, chainID [32]byte) (*big.Int, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "getNextMessageID", chainID) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetNextMessageID is a free data retrieval call binding the contract method 0xdf20e8bc. +// +// Solidity: function getNextMessageID(bytes32 chainID) view returns(uint256 messageID) +func (_Teleportermessenger *TeleportermessengerSession) GetNextMessageID(chainID [32]byte) (*big.Int, error) { + return _Teleportermessenger.Contract.GetNextMessageID(&_Teleportermessenger.CallOpts, chainID) +} + +// GetNextMessageID is a free data retrieval call binding the contract method 0xdf20e8bc. +// +// Solidity: function getNextMessageID(bytes32 chainID) view returns(uint256 messageID) +func (_Teleportermessenger *TeleportermessengerCallerSession) GetNextMessageID(chainID [32]byte) (*big.Int, error) { + return _Teleportermessenger.Contract.GetNextMessageID(&_Teleportermessenger.CallOpts, chainID) +} + +// GetRelayerRewardAddress is a free data retrieval call binding the contract method 0x33e890fe. +// +// Solidity: function getRelayerRewardAddress(bytes32 originChainID, uint256 messageID) view returns(address relayerRewardAddress) +func (_Teleportermessenger *TeleportermessengerCaller) GetRelayerRewardAddress(opts *bind.CallOpts, originChainID [32]byte, messageID *big.Int) (common.Address, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "getRelayerRewardAddress", originChainID, messageID) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetRelayerRewardAddress is a free data retrieval call binding the contract method 0x33e890fe. +// +// Solidity: function getRelayerRewardAddress(bytes32 originChainID, uint256 messageID) view returns(address relayerRewardAddress) +func (_Teleportermessenger *TeleportermessengerSession) GetRelayerRewardAddress(originChainID [32]byte, messageID *big.Int) (common.Address, error) { + return _Teleportermessenger.Contract.GetRelayerRewardAddress(&_Teleportermessenger.CallOpts, originChainID, messageID) +} + +// GetRelayerRewardAddress is a free data retrieval call binding the contract method 0x33e890fe. +// +// Solidity: function getRelayerRewardAddress(bytes32 originChainID, uint256 messageID) view returns(address relayerRewardAddress) +func (_Teleportermessenger *TeleportermessengerCallerSession) GetRelayerRewardAddress(originChainID [32]byte, messageID *big.Int) (common.Address, error) { + return _Teleportermessenger.Contract.GetRelayerRewardAddress(&_Teleportermessenger.CallOpts, originChainID, messageID) +} + +// LatestMessageIDs is a free data retrieval call binding the contract method 0x29ec9beb. +// +// Solidity: function latestMessageIDs(bytes32 ) view returns(uint256) +func (_Teleportermessenger *TeleportermessengerCaller) LatestMessageIDs(opts *bind.CallOpts, arg0 [32]byte) (*big.Int, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "latestMessageIDs", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// LatestMessageIDs is a free data retrieval call binding the contract method 0x29ec9beb. +// +// Solidity: function latestMessageIDs(bytes32 ) view returns(uint256) +func (_Teleportermessenger *TeleportermessengerSession) LatestMessageIDs(arg0 [32]byte) (*big.Int, error) { + return _Teleportermessenger.Contract.LatestMessageIDs(&_Teleportermessenger.CallOpts, arg0) +} + +// LatestMessageIDs is a free data retrieval call binding the contract method 0x29ec9beb. +// +// Solidity: function latestMessageIDs(bytes32 ) view returns(uint256) +func (_Teleportermessenger *TeleportermessengerCallerSession) LatestMessageIDs(arg0 [32]byte) (*big.Int, error) { + return _Teleportermessenger.Contract.LatestMessageIDs(&_Teleportermessenger.CallOpts, arg0) +} + +// MessageReceived is a free data retrieval call binding the contract method 0xe03555df. +// +// Solidity: function messageReceived(bytes32 originChainID, uint256 messageID) view returns(bool delivered) +func (_Teleportermessenger *TeleportermessengerCaller) MessageReceived(opts *bind.CallOpts, originChainID [32]byte, messageID *big.Int) (bool, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "messageReceived", originChainID, messageID) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// MessageReceived is a free data retrieval call binding the contract method 0xe03555df. +// +// Solidity: function messageReceived(bytes32 originChainID, uint256 messageID) view returns(bool delivered) +func (_Teleportermessenger *TeleportermessengerSession) MessageReceived(originChainID [32]byte, messageID *big.Int) (bool, error) { + return _Teleportermessenger.Contract.MessageReceived(&_Teleportermessenger.CallOpts, originChainID, messageID) +} + +// MessageReceived is a free data retrieval call binding the contract method 0xe03555df. +// +// Solidity: function messageReceived(bytes32 originChainID, uint256 messageID) view returns(bool delivered) +func (_Teleportermessenger *TeleportermessengerCallerSession) MessageReceived(originChainID [32]byte, messageID *big.Int) (bool, error) { + return _Teleportermessenger.Contract.MessageReceived(&_Teleportermessenger.CallOpts, originChainID, messageID) +} + +// OutstandingReceipts is a free data retrieval call binding the contract method 0x781f9744. +// +// Solidity: function outstandingReceipts(bytes32 ) view returns(address) +func (_Teleportermessenger *TeleportermessengerCaller) OutstandingReceipts(opts *bind.CallOpts, arg0 [32]byte) (common.Address, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "outstandingReceipts", arg0) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// OutstandingReceipts is a free data retrieval call binding the contract method 0x781f9744. +// +// Solidity: function outstandingReceipts(bytes32 ) view returns(address) +func (_Teleportermessenger *TeleportermessengerSession) OutstandingReceipts(arg0 [32]byte) (common.Address, error) { + return _Teleportermessenger.Contract.OutstandingReceipts(&_Teleportermessenger.CallOpts, arg0) +} + +// OutstandingReceipts is a free data retrieval call binding the contract method 0x781f9744. +// +// Solidity: function outstandingReceipts(bytes32 ) view returns(address) +func (_Teleportermessenger *TeleportermessengerCallerSession) OutstandingReceipts(arg0 [32]byte) (common.Address, error) { + return _Teleportermessenger.Contract.OutstandingReceipts(&_Teleportermessenger.CallOpts, arg0) +} + +// ReceivedFailedMessageHashes is a free data retrieval call binding the contract method 0xc9bb1143. +// +// Solidity: function receivedFailedMessageHashes(bytes32 , uint256 ) view returns(bytes32) +func (_Teleportermessenger *TeleportermessengerCaller) ReceivedFailedMessageHashes(opts *bind.CallOpts, arg0 [32]byte, arg1 *big.Int) ([32]byte, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "receivedFailedMessageHashes", arg0, arg1) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ReceivedFailedMessageHashes is a free data retrieval call binding the contract method 0xc9bb1143. +// +// Solidity: function receivedFailedMessageHashes(bytes32 , uint256 ) view returns(bytes32) +func (_Teleportermessenger *TeleportermessengerSession) ReceivedFailedMessageHashes(arg0 [32]byte, arg1 *big.Int) ([32]byte, error) { + return _Teleportermessenger.Contract.ReceivedFailedMessageHashes(&_Teleportermessenger.CallOpts, arg0, arg1) +} + +// ReceivedFailedMessageHashes is a free data retrieval call binding the contract method 0xc9bb1143. +// +// Solidity: function receivedFailedMessageHashes(bytes32 , uint256 ) view returns(bytes32) +func (_Teleportermessenger *TeleportermessengerCallerSession) ReceivedFailedMessageHashes(arg0 [32]byte, arg1 *big.Int) ([32]byte, error) { + return _Teleportermessenger.Contract.ReceivedFailedMessageHashes(&_Teleportermessenger.CallOpts, arg0, arg1) +} + +// RelayerRewardAddresses is a free data retrieval call binding the contract method 0x21f18054. +// +// Solidity: function relayerRewardAddresses(bytes32 , uint256 ) view returns(address) +func (_Teleportermessenger *TeleportermessengerCaller) RelayerRewardAddresses(opts *bind.CallOpts, arg0 [32]byte, arg1 *big.Int) (common.Address, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "relayerRewardAddresses", arg0, arg1) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// RelayerRewardAddresses is a free data retrieval call binding the contract method 0x21f18054. +// +// Solidity: function relayerRewardAddresses(bytes32 , uint256 ) view returns(address) +func (_Teleportermessenger *TeleportermessengerSession) RelayerRewardAddresses(arg0 [32]byte, arg1 *big.Int) (common.Address, error) { + return _Teleportermessenger.Contract.RelayerRewardAddresses(&_Teleportermessenger.CallOpts, arg0, arg1) +} + +// RelayerRewardAddresses is a free data retrieval call binding the contract method 0x21f18054. +// +// Solidity: function relayerRewardAddresses(bytes32 , uint256 ) view returns(address) +func (_Teleportermessenger *TeleportermessengerCallerSession) RelayerRewardAddresses(arg0 [32]byte, arg1 *big.Int) (common.Address, error) { + return _Teleportermessenger.Contract.RelayerRewardAddresses(&_Teleportermessenger.CallOpts, arg0, arg1) +} + +// RelayerRewardAmounts is a free data retrieval call binding the contract method 0x6192762c. +// +// Solidity: function relayerRewardAmounts(address , address ) view returns(uint256) +func (_Teleportermessenger *TeleportermessengerCaller) RelayerRewardAmounts(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "relayerRewardAmounts", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// RelayerRewardAmounts is a free data retrieval call binding the contract method 0x6192762c. +// +// Solidity: function relayerRewardAmounts(address , address ) view returns(uint256) +func (_Teleportermessenger *TeleportermessengerSession) RelayerRewardAmounts(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _Teleportermessenger.Contract.RelayerRewardAmounts(&_Teleportermessenger.CallOpts, arg0, arg1) +} + +// RelayerRewardAmounts is a free data retrieval call binding the contract method 0x6192762c. +// +// Solidity: function relayerRewardAmounts(address , address ) view returns(uint256) +func (_Teleportermessenger *TeleportermessengerCallerSession) RelayerRewardAmounts(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _Teleportermessenger.Contract.RelayerRewardAmounts(&_Teleportermessenger.CallOpts, arg0, arg1) +} + +// SentMessageInfo is a free data retrieval call binding the contract method 0x66533d12. +// +// Solidity: function sentMessageInfo(bytes32 , uint256 ) view returns(bytes32 messageHash, (address,uint256) feeInfo) +func (_Teleportermessenger *TeleportermessengerCaller) SentMessageInfo(opts *bind.CallOpts, arg0 [32]byte, arg1 *big.Int) (struct { + MessageHash [32]byte + FeeInfo TeleporterFeeInfo +}, error) { + var out []interface{} + err := _Teleportermessenger.contract.Call(opts, &out, "sentMessageInfo", arg0, arg1) + + outstruct := new(struct { + MessageHash [32]byte + FeeInfo TeleporterFeeInfo + }) + if err != nil { + return *outstruct, err + } + + outstruct.MessageHash = *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + outstruct.FeeInfo = *abi.ConvertType(out[1], new(TeleporterFeeInfo)).(*TeleporterFeeInfo) + + return *outstruct, err + +} + +// SentMessageInfo is a free data retrieval call binding the contract method 0x66533d12. +// +// Solidity: function sentMessageInfo(bytes32 , uint256 ) view returns(bytes32 messageHash, (address,uint256) feeInfo) +func (_Teleportermessenger *TeleportermessengerSession) SentMessageInfo(arg0 [32]byte, arg1 *big.Int) (struct { + MessageHash [32]byte + FeeInfo TeleporterFeeInfo +}, error) { + return _Teleportermessenger.Contract.SentMessageInfo(&_Teleportermessenger.CallOpts, arg0, arg1) +} + +// SentMessageInfo is a free data retrieval call binding the contract method 0x66533d12. +// +// Solidity: function sentMessageInfo(bytes32 , uint256 ) view returns(bytes32 messageHash, (address,uint256) feeInfo) +func (_Teleportermessenger *TeleportermessengerCallerSession) SentMessageInfo(arg0 [32]byte, arg1 *big.Int) (struct { + MessageHash [32]byte + FeeInfo TeleporterFeeInfo +}, error) { + return _Teleportermessenger.Contract.SentMessageInfo(&_Teleportermessenger.CallOpts, arg0, arg1) +} + +// AddFeeAmount is a paid mutator transaction binding the contract method 0x19570c74. +// +// Solidity: function addFeeAmount(bytes32 destinationChainID, uint256 messageID, address feeContractAddress, uint256 additionalFeeAmount) returns() +func (_Teleportermessenger *TeleportermessengerTransactor) AddFeeAmount(opts *bind.TransactOpts, destinationChainID [32]byte, messageID *big.Int, feeContractAddress common.Address, additionalFeeAmount *big.Int) (*types.Transaction, error) { + return _Teleportermessenger.contract.Transact(opts, "addFeeAmount", destinationChainID, messageID, feeContractAddress, additionalFeeAmount) +} + +// AddFeeAmount is a paid mutator transaction binding the contract method 0x19570c74. +// +// Solidity: function addFeeAmount(bytes32 destinationChainID, uint256 messageID, address feeContractAddress, uint256 additionalFeeAmount) returns() +func (_Teleportermessenger *TeleportermessengerSession) AddFeeAmount(destinationChainID [32]byte, messageID *big.Int, feeContractAddress common.Address, additionalFeeAmount *big.Int) (*types.Transaction, error) { + return _Teleportermessenger.Contract.AddFeeAmount(&_Teleportermessenger.TransactOpts, destinationChainID, messageID, feeContractAddress, additionalFeeAmount) +} + +// AddFeeAmount is a paid mutator transaction binding the contract method 0x19570c74. +// +// Solidity: function addFeeAmount(bytes32 destinationChainID, uint256 messageID, address feeContractAddress, uint256 additionalFeeAmount) returns() +func (_Teleportermessenger *TeleportermessengerTransactorSession) AddFeeAmount(destinationChainID [32]byte, messageID *big.Int, feeContractAddress common.Address, additionalFeeAmount *big.Int) (*types.Transaction, error) { + return _Teleportermessenger.Contract.AddFeeAmount(&_Teleportermessenger.TransactOpts, destinationChainID, messageID, feeContractAddress, additionalFeeAmount) +} + +// ReceiveCrossChainMessage is a paid mutator transaction binding the contract method 0xccb5f809. +// +// Solidity: function receiveCrossChainMessage(uint32 messageIndex, address relayerRewardAddress) returns() +func (_Teleportermessenger *TeleportermessengerTransactor) ReceiveCrossChainMessage(opts *bind.TransactOpts, messageIndex uint32, relayerRewardAddress common.Address) (*types.Transaction, error) { + return _Teleportermessenger.contract.Transact(opts, "receiveCrossChainMessage", messageIndex, relayerRewardAddress) +} + +// ReceiveCrossChainMessage is a paid mutator transaction binding the contract method 0xccb5f809. +// +// Solidity: function receiveCrossChainMessage(uint32 messageIndex, address relayerRewardAddress) returns() +func (_Teleportermessenger *TeleportermessengerSession) ReceiveCrossChainMessage(messageIndex uint32, relayerRewardAddress common.Address) (*types.Transaction, error) { + return _Teleportermessenger.Contract.ReceiveCrossChainMessage(&_Teleportermessenger.TransactOpts, messageIndex, relayerRewardAddress) +} + +// ReceiveCrossChainMessage is a paid mutator transaction binding the contract method 0xccb5f809. +// +// Solidity: function receiveCrossChainMessage(uint32 messageIndex, address relayerRewardAddress) returns() +func (_Teleportermessenger *TeleportermessengerTransactorSession) ReceiveCrossChainMessage(messageIndex uint32, relayerRewardAddress common.Address) (*types.Transaction, error) { + return _Teleportermessenger.Contract.ReceiveCrossChainMessage(&_Teleportermessenger.TransactOpts, messageIndex, relayerRewardAddress) +} + +// RedeemRelayerRewards is a paid mutator transaction binding the contract method 0x22296c3a. +// +// Solidity: function redeemRelayerRewards(address feeAsset) returns() +func (_Teleportermessenger *TeleportermessengerTransactor) RedeemRelayerRewards(opts *bind.TransactOpts, feeAsset common.Address) (*types.Transaction, error) { + return _Teleportermessenger.contract.Transact(opts, "redeemRelayerRewards", feeAsset) +} + +// RedeemRelayerRewards is a paid mutator transaction binding the contract method 0x22296c3a. +// +// Solidity: function redeemRelayerRewards(address feeAsset) returns() +func (_Teleportermessenger *TeleportermessengerSession) RedeemRelayerRewards(feeAsset common.Address) (*types.Transaction, error) { + return _Teleportermessenger.Contract.RedeemRelayerRewards(&_Teleportermessenger.TransactOpts, feeAsset) +} + +// RedeemRelayerRewards is a paid mutator transaction binding the contract method 0x22296c3a. +// +// Solidity: function redeemRelayerRewards(address feeAsset) returns() +func (_Teleportermessenger *TeleportermessengerTransactorSession) RedeemRelayerRewards(feeAsset common.Address) (*types.Transaction, error) { + return _Teleportermessenger.Contract.RedeemRelayerRewards(&_Teleportermessenger.TransactOpts, feeAsset) +} + +// RetryMessageExecution is a paid mutator transaction binding the contract method 0xcd3f2daa. +// +// Solidity: function retryMessageExecution(bytes32 originChainID, (uint256,address,address,uint256,address[],(uint256,address)[],bytes) message) returns() +func (_Teleportermessenger *TeleportermessengerTransactor) RetryMessageExecution(opts *bind.TransactOpts, originChainID [32]byte, message TeleporterMessage) (*types.Transaction, error) { + return _Teleportermessenger.contract.Transact(opts, "retryMessageExecution", originChainID, message) +} + +// RetryMessageExecution is a paid mutator transaction binding the contract method 0xcd3f2daa. +// +// Solidity: function retryMessageExecution(bytes32 originChainID, (uint256,address,address,uint256,address[],(uint256,address)[],bytes) message) returns() +func (_Teleportermessenger *TeleportermessengerSession) RetryMessageExecution(originChainID [32]byte, message TeleporterMessage) (*types.Transaction, error) { + return _Teleportermessenger.Contract.RetryMessageExecution(&_Teleportermessenger.TransactOpts, originChainID, message) +} + +// RetryMessageExecution is a paid mutator transaction binding the contract method 0xcd3f2daa. +// +// Solidity: function retryMessageExecution(bytes32 originChainID, (uint256,address,address,uint256,address[],(uint256,address)[],bytes) message) returns() +func (_Teleportermessenger *TeleportermessengerTransactorSession) RetryMessageExecution(originChainID [32]byte, message TeleporterMessage) (*types.Transaction, error) { + return _Teleportermessenger.Contract.RetryMessageExecution(&_Teleportermessenger.TransactOpts, originChainID, message) +} + +// RetryReceipts is a paid mutator transaction binding the contract method 0x9a496900. +// +// Solidity: function retryReceipts(bytes32 originChainID, uint256[] messageIDs, (address,uint256) feeInfo, address[] allowedRelayerAddresses) returns(uint256 messageID) +func (_Teleportermessenger *TeleportermessengerTransactor) RetryReceipts(opts *bind.TransactOpts, originChainID [32]byte, messageIDs []*big.Int, feeInfo TeleporterFeeInfo, allowedRelayerAddresses []common.Address) (*types.Transaction, error) { + return _Teleportermessenger.contract.Transact(opts, "retryReceipts", originChainID, messageIDs, feeInfo, allowedRelayerAddresses) +} + +// RetryReceipts is a paid mutator transaction binding the contract method 0x9a496900. +// +// Solidity: function retryReceipts(bytes32 originChainID, uint256[] messageIDs, (address,uint256) feeInfo, address[] allowedRelayerAddresses) returns(uint256 messageID) +func (_Teleportermessenger *TeleportermessengerSession) RetryReceipts(originChainID [32]byte, messageIDs []*big.Int, feeInfo TeleporterFeeInfo, allowedRelayerAddresses []common.Address) (*types.Transaction, error) { + return _Teleportermessenger.Contract.RetryReceipts(&_Teleportermessenger.TransactOpts, originChainID, messageIDs, feeInfo, allowedRelayerAddresses) +} + +// RetryReceipts is a paid mutator transaction binding the contract method 0x9a496900. +// +// Solidity: function retryReceipts(bytes32 originChainID, uint256[] messageIDs, (address,uint256) feeInfo, address[] allowedRelayerAddresses) returns(uint256 messageID) +func (_Teleportermessenger *TeleportermessengerTransactorSession) RetryReceipts(originChainID [32]byte, messageIDs []*big.Int, feeInfo TeleporterFeeInfo, allowedRelayerAddresses []common.Address) (*types.Transaction, error) { + return _Teleportermessenger.Contract.RetryReceipts(&_Teleportermessenger.TransactOpts, originChainID, messageIDs, feeInfo, allowedRelayerAddresses) +} + +// RetrySendCrossChainMessage is a paid mutator transaction binding the contract method 0x1af671f8. +// +// Solidity: function retrySendCrossChainMessage(bytes32 destinationChainID, (uint256,address,address,uint256,address[],(uint256,address)[],bytes) message) returns() +func (_Teleportermessenger *TeleportermessengerTransactor) RetrySendCrossChainMessage(opts *bind.TransactOpts, destinationChainID [32]byte, message TeleporterMessage) (*types.Transaction, error) { + return _Teleportermessenger.contract.Transact(opts, "retrySendCrossChainMessage", destinationChainID, message) +} + +// RetrySendCrossChainMessage is a paid mutator transaction binding the contract method 0x1af671f8. +// +// Solidity: function retrySendCrossChainMessage(bytes32 destinationChainID, (uint256,address,address,uint256,address[],(uint256,address)[],bytes) message) returns() +func (_Teleportermessenger *TeleportermessengerSession) RetrySendCrossChainMessage(destinationChainID [32]byte, message TeleporterMessage) (*types.Transaction, error) { + return _Teleportermessenger.Contract.RetrySendCrossChainMessage(&_Teleportermessenger.TransactOpts, destinationChainID, message) +} + +// RetrySendCrossChainMessage is a paid mutator transaction binding the contract method 0x1af671f8. +// +// Solidity: function retrySendCrossChainMessage(bytes32 destinationChainID, (uint256,address,address,uint256,address[],(uint256,address)[],bytes) message) returns() +func (_Teleportermessenger *TeleportermessengerTransactorSession) RetrySendCrossChainMessage(destinationChainID [32]byte, message TeleporterMessage) (*types.Transaction, error) { + return _Teleportermessenger.Contract.RetrySendCrossChainMessage(&_Teleportermessenger.TransactOpts, destinationChainID, message) +} + +// SendCrossChainMessage is a paid mutator transaction binding the contract method 0x62448850. +// +// Solidity: function sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes) messageInput) returns(uint256 messageID) +func (_Teleportermessenger *TeleportermessengerTransactor) SendCrossChainMessage(opts *bind.TransactOpts, messageInput TeleporterMessageInput) (*types.Transaction, error) { + return _Teleportermessenger.contract.Transact(opts, "sendCrossChainMessage", messageInput) +} + +// SendCrossChainMessage is a paid mutator transaction binding the contract method 0x62448850. +// +// Solidity: function sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes) messageInput) returns(uint256 messageID) +func (_Teleportermessenger *TeleportermessengerSession) SendCrossChainMessage(messageInput TeleporterMessageInput) (*types.Transaction, error) { + return _Teleportermessenger.Contract.SendCrossChainMessage(&_Teleportermessenger.TransactOpts, messageInput) +} + +// SendCrossChainMessage is a paid mutator transaction binding the contract method 0x62448850. +// +// Solidity: function sendCrossChainMessage((bytes32,address,(address,uint256),uint256,address[],bytes) messageInput) returns(uint256 messageID) +func (_Teleportermessenger *TeleportermessengerTransactorSession) SendCrossChainMessage(messageInput TeleporterMessageInput) (*types.Transaction, error) { + return _Teleportermessenger.Contract.SendCrossChainMessage(&_Teleportermessenger.TransactOpts, messageInput) +} + +// TeleportermessengerAddFeeAmountIterator is returned from FilterAddFeeAmount and is used to iterate over the raw logs and unpacked data for AddFeeAmount events raised by the Teleportermessenger contract. +type TeleportermessengerAddFeeAmountIterator struct { + Event *TeleportermessengerAddFeeAmount // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TeleportermessengerAddFeeAmountIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TeleportermessengerAddFeeAmount) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TeleportermessengerAddFeeAmount) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TeleportermessengerAddFeeAmountIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TeleportermessengerAddFeeAmountIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TeleportermessengerAddFeeAmount represents a AddFeeAmount event raised by the Teleportermessenger contract. +type TeleportermessengerAddFeeAmount struct { + DestinationChainID [32]byte + MessageID *big.Int + UpdatedFeeInfo TeleporterFeeInfo + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAddFeeAmount is a free log retrieval operation binding the contract event 0x28fe05eedf0479c9159e5b6dd2a28c93fa1a408eba22dc801fd9bc493a7fc0c2. +// +// Solidity: event AddFeeAmount(bytes32 indexed destinationChainID, uint256 indexed messageID, (address,uint256) updatedFeeInfo) +func (_Teleportermessenger *TeleportermessengerFilterer) FilterAddFeeAmount(opts *bind.FilterOpts, destinationChainID [][32]byte, messageID []*big.Int) (*TeleportermessengerAddFeeAmountIterator, error) { + + var destinationChainIDRule []interface{} + for _, destinationChainIDItem := range destinationChainID { + destinationChainIDRule = append(destinationChainIDRule, destinationChainIDItem) + } + var messageIDRule []interface{} + for _, messageIDItem := range messageID { + messageIDRule = append(messageIDRule, messageIDItem) + } + + logs, sub, err := _Teleportermessenger.contract.FilterLogs(opts, "AddFeeAmount", destinationChainIDRule, messageIDRule) + if err != nil { + return nil, err + } + return &TeleportermessengerAddFeeAmountIterator{contract: _Teleportermessenger.contract, event: "AddFeeAmount", logs: logs, sub: sub}, nil +} + +// WatchAddFeeAmount is a free log subscription operation binding the contract event 0x28fe05eedf0479c9159e5b6dd2a28c93fa1a408eba22dc801fd9bc493a7fc0c2. +// +// Solidity: event AddFeeAmount(bytes32 indexed destinationChainID, uint256 indexed messageID, (address,uint256) updatedFeeInfo) +func (_Teleportermessenger *TeleportermessengerFilterer) WatchAddFeeAmount(opts *bind.WatchOpts, sink chan<- *TeleportermessengerAddFeeAmount, destinationChainID [][32]byte, messageID []*big.Int) (event.Subscription, error) { + + var destinationChainIDRule []interface{} + for _, destinationChainIDItem := range destinationChainID { + destinationChainIDRule = append(destinationChainIDRule, destinationChainIDItem) + } + var messageIDRule []interface{} + for _, messageIDItem := range messageID { + messageIDRule = append(messageIDRule, messageIDItem) + } + + logs, sub, err := _Teleportermessenger.contract.WatchLogs(opts, "AddFeeAmount", destinationChainIDRule, messageIDRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TeleportermessengerAddFeeAmount) + if err := _Teleportermessenger.contract.UnpackLog(event, "AddFeeAmount", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseAddFeeAmount is a log parse operation binding the contract event 0x28fe05eedf0479c9159e5b6dd2a28c93fa1a408eba22dc801fd9bc493a7fc0c2. +// +// Solidity: event AddFeeAmount(bytes32 indexed destinationChainID, uint256 indexed messageID, (address,uint256) updatedFeeInfo) +func (_Teleportermessenger *TeleportermessengerFilterer) ParseAddFeeAmount(log types.Log) (*TeleportermessengerAddFeeAmount, error) { + event := new(TeleportermessengerAddFeeAmount) + if err := _Teleportermessenger.contract.UnpackLog(event, "AddFeeAmount", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TeleportermessengerFailedMessageExecutionIterator is returned from FilterFailedMessageExecution and is used to iterate over the raw logs and unpacked data for FailedMessageExecution events raised by the Teleportermessenger contract. +type TeleportermessengerFailedMessageExecutionIterator struct { + Event *TeleportermessengerFailedMessageExecution // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TeleportermessengerFailedMessageExecutionIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TeleportermessengerFailedMessageExecution) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TeleportermessengerFailedMessageExecution) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TeleportermessengerFailedMessageExecutionIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TeleportermessengerFailedMessageExecutionIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TeleportermessengerFailedMessageExecution represents a FailedMessageExecution event raised by the Teleportermessenger contract. +type TeleportermessengerFailedMessageExecution struct { + OriginChainID [32]byte + MessageID *big.Int + Message TeleporterMessage + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFailedMessageExecution is a free log retrieval operation binding the contract event 0x50e5f3de5b0b3e6c82553b7e0f5f7080a291be07aa30a311084a9457f4a956bc. +// +// Solidity: event FailedMessageExecution(bytes32 indexed originChainID, uint256 indexed messageID, (uint256,address,address,uint256,address[],(uint256,address)[],bytes) message) +func (_Teleportermessenger *TeleportermessengerFilterer) FilterFailedMessageExecution(opts *bind.FilterOpts, originChainID [][32]byte, messageID []*big.Int) (*TeleportermessengerFailedMessageExecutionIterator, error) { + + var originChainIDRule []interface{} + for _, originChainIDItem := range originChainID { + originChainIDRule = append(originChainIDRule, originChainIDItem) + } + var messageIDRule []interface{} + for _, messageIDItem := range messageID { + messageIDRule = append(messageIDRule, messageIDItem) + } + + logs, sub, err := _Teleportermessenger.contract.FilterLogs(opts, "FailedMessageExecution", originChainIDRule, messageIDRule) + if err != nil { + return nil, err + } + return &TeleportermessengerFailedMessageExecutionIterator{contract: _Teleportermessenger.contract, event: "FailedMessageExecution", logs: logs, sub: sub}, nil +} + +// WatchFailedMessageExecution is a free log subscription operation binding the contract event 0x50e5f3de5b0b3e6c82553b7e0f5f7080a291be07aa30a311084a9457f4a956bc. +// +// Solidity: event FailedMessageExecution(bytes32 indexed originChainID, uint256 indexed messageID, (uint256,address,address,uint256,address[],(uint256,address)[],bytes) message) +func (_Teleportermessenger *TeleportermessengerFilterer) WatchFailedMessageExecution(opts *bind.WatchOpts, sink chan<- *TeleportermessengerFailedMessageExecution, originChainID [][32]byte, messageID []*big.Int) (event.Subscription, error) { + + var originChainIDRule []interface{} + for _, originChainIDItem := range originChainID { + originChainIDRule = append(originChainIDRule, originChainIDItem) + } + var messageIDRule []interface{} + for _, messageIDItem := range messageID { + messageIDRule = append(messageIDRule, messageIDItem) + } + + logs, sub, err := _Teleportermessenger.contract.WatchLogs(opts, "FailedMessageExecution", originChainIDRule, messageIDRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TeleportermessengerFailedMessageExecution) + if err := _Teleportermessenger.contract.UnpackLog(event, "FailedMessageExecution", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseFailedMessageExecution is a log parse operation binding the contract event 0x50e5f3de5b0b3e6c82553b7e0f5f7080a291be07aa30a311084a9457f4a956bc. +// +// Solidity: event FailedMessageExecution(bytes32 indexed originChainID, uint256 indexed messageID, (uint256,address,address,uint256,address[],(uint256,address)[],bytes) message) +func (_Teleportermessenger *TeleportermessengerFilterer) ParseFailedMessageExecution(log types.Log) (*TeleportermessengerFailedMessageExecution, error) { + event := new(TeleportermessengerFailedMessageExecution) + if err := _Teleportermessenger.contract.UnpackLog(event, "FailedMessageExecution", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TeleportermessengerMessageExecutionRetriedIterator is returned from FilterMessageExecutionRetried and is used to iterate over the raw logs and unpacked data for MessageExecutionRetried events raised by the Teleportermessenger contract. +type TeleportermessengerMessageExecutionRetriedIterator struct { + Event *TeleportermessengerMessageExecutionRetried // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TeleportermessengerMessageExecutionRetriedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TeleportermessengerMessageExecutionRetried) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TeleportermessengerMessageExecutionRetried) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TeleportermessengerMessageExecutionRetriedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TeleportermessengerMessageExecutionRetriedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TeleportermessengerMessageExecutionRetried represents a MessageExecutionRetried event raised by the Teleportermessenger contract. +type TeleportermessengerMessageExecutionRetried struct { + OriginChainID [32]byte + MessageID *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMessageExecutionRetried is a free log retrieval operation binding the contract event 0x3d5f30e93c1e27cda0e05a7b9e51144613a816cd90561f8493393bbcf4e00358. +// +// Solidity: event MessageExecutionRetried(bytes32 indexed originChainID, uint256 indexed messageID) +func (_Teleportermessenger *TeleportermessengerFilterer) FilterMessageExecutionRetried(opts *bind.FilterOpts, originChainID [][32]byte, messageID []*big.Int) (*TeleportermessengerMessageExecutionRetriedIterator, error) { + + var originChainIDRule []interface{} + for _, originChainIDItem := range originChainID { + originChainIDRule = append(originChainIDRule, originChainIDItem) + } + var messageIDRule []interface{} + for _, messageIDItem := range messageID { + messageIDRule = append(messageIDRule, messageIDItem) + } + + logs, sub, err := _Teleportermessenger.contract.FilterLogs(opts, "MessageExecutionRetried", originChainIDRule, messageIDRule) + if err != nil { + return nil, err + } + return &TeleportermessengerMessageExecutionRetriedIterator{contract: _Teleportermessenger.contract, event: "MessageExecutionRetried", logs: logs, sub: sub}, nil +} + +// WatchMessageExecutionRetried is a free log subscription operation binding the contract event 0x3d5f30e93c1e27cda0e05a7b9e51144613a816cd90561f8493393bbcf4e00358. +// +// Solidity: event MessageExecutionRetried(bytes32 indexed originChainID, uint256 indexed messageID) +func (_Teleportermessenger *TeleportermessengerFilterer) WatchMessageExecutionRetried(opts *bind.WatchOpts, sink chan<- *TeleportermessengerMessageExecutionRetried, originChainID [][32]byte, messageID []*big.Int) (event.Subscription, error) { + + var originChainIDRule []interface{} + for _, originChainIDItem := range originChainID { + originChainIDRule = append(originChainIDRule, originChainIDItem) + } + var messageIDRule []interface{} + for _, messageIDItem := range messageID { + messageIDRule = append(messageIDRule, messageIDItem) + } + + logs, sub, err := _Teleportermessenger.contract.WatchLogs(opts, "MessageExecutionRetried", originChainIDRule, messageIDRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TeleportermessengerMessageExecutionRetried) + if err := _Teleportermessenger.contract.UnpackLog(event, "MessageExecutionRetried", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseMessageExecutionRetried is a log parse operation binding the contract event 0x3d5f30e93c1e27cda0e05a7b9e51144613a816cd90561f8493393bbcf4e00358. +// +// Solidity: event MessageExecutionRetried(bytes32 indexed originChainID, uint256 indexed messageID) +func (_Teleportermessenger *TeleportermessengerFilterer) ParseMessageExecutionRetried(log types.Log) (*TeleportermessengerMessageExecutionRetried, error) { + event := new(TeleportermessengerMessageExecutionRetried) + if err := _Teleportermessenger.contract.UnpackLog(event, "MessageExecutionRetried", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TeleportermessengerReceiveCrossChainMessageIterator is returned from FilterReceiveCrossChainMessage and is used to iterate over the raw logs and unpacked data for ReceiveCrossChainMessage events raised by the Teleportermessenger contract. +type TeleportermessengerReceiveCrossChainMessageIterator struct { + Event *TeleportermessengerReceiveCrossChainMessage // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TeleportermessengerReceiveCrossChainMessageIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TeleportermessengerReceiveCrossChainMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TeleportermessengerReceiveCrossChainMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TeleportermessengerReceiveCrossChainMessageIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TeleportermessengerReceiveCrossChainMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TeleportermessengerReceiveCrossChainMessage represents a ReceiveCrossChainMessage event raised by the Teleportermessenger contract. +type TeleportermessengerReceiveCrossChainMessage struct { + OriginChainID [32]byte + MessageID *big.Int + Message TeleporterMessage + Raw types.Log // Blockchain specific contextual infos +} + +// FilterReceiveCrossChainMessage is a free log retrieval operation binding the contract event 0x522ce4da81e9fb994bf6a122282939647b6e69817be443f7d1c152e76a082cc7. +// +// Solidity: event ReceiveCrossChainMessage(bytes32 indexed originChainID, uint256 indexed messageID, (uint256,address,address,uint256,address[],(uint256,address)[],bytes) message) +func (_Teleportermessenger *TeleportermessengerFilterer) FilterReceiveCrossChainMessage(opts *bind.FilterOpts, originChainID [][32]byte, messageID []*big.Int) (*TeleportermessengerReceiveCrossChainMessageIterator, error) { + + var originChainIDRule []interface{} + for _, originChainIDItem := range originChainID { + originChainIDRule = append(originChainIDRule, originChainIDItem) + } + var messageIDRule []interface{} + for _, messageIDItem := range messageID { + messageIDRule = append(messageIDRule, messageIDItem) + } + + logs, sub, err := _Teleportermessenger.contract.FilterLogs(opts, "ReceiveCrossChainMessage", originChainIDRule, messageIDRule) + if err != nil { + return nil, err + } + return &TeleportermessengerReceiveCrossChainMessageIterator{contract: _Teleportermessenger.contract, event: "ReceiveCrossChainMessage", logs: logs, sub: sub}, nil +} + +// WatchReceiveCrossChainMessage is a free log subscription operation binding the contract event 0x522ce4da81e9fb994bf6a122282939647b6e69817be443f7d1c152e76a082cc7. +// +// Solidity: event ReceiveCrossChainMessage(bytes32 indexed originChainID, uint256 indexed messageID, (uint256,address,address,uint256,address[],(uint256,address)[],bytes) message) +func (_Teleportermessenger *TeleportermessengerFilterer) WatchReceiveCrossChainMessage(opts *bind.WatchOpts, sink chan<- *TeleportermessengerReceiveCrossChainMessage, originChainID [][32]byte, messageID []*big.Int) (event.Subscription, error) { + + var originChainIDRule []interface{} + for _, originChainIDItem := range originChainID { + originChainIDRule = append(originChainIDRule, originChainIDItem) + } + var messageIDRule []interface{} + for _, messageIDItem := range messageID { + messageIDRule = append(messageIDRule, messageIDItem) + } + + logs, sub, err := _Teleportermessenger.contract.WatchLogs(opts, "ReceiveCrossChainMessage", originChainIDRule, messageIDRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TeleportermessengerReceiveCrossChainMessage) + if err := _Teleportermessenger.contract.UnpackLog(event, "ReceiveCrossChainMessage", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseReceiveCrossChainMessage is a log parse operation binding the contract event 0x522ce4da81e9fb994bf6a122282939647b6e69817be443f7d1c152e76a082cc7. +// +// Solidity: event ReceiveCrossChainMessage(bytes32 indexed originChainID, uint256 indexed messageID, (uint256,address,address,uint256,address[],(uint256,address)[],bytes) message) +func (_Teleportermessenger *TeleportermessengerFilterer) ParseReceiveCrossChainMessage(log types.Log) (*TeleportermessengerReceiveCrossChainMessage, error) { + event := new(TeleportermessengerReceiveCrossChainMessage) + if err := _Teleportermessenger.contract.UnpackLog(event, "ReceiveCrossChainMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TeleportermessengerSendCrossChainMessageIterator is returned from FilterSendCrossChainMessage and is used to iterate over the raw logs and unpacked data for SendCrossChainMessage events raised by the Teleportermessenger contract. +type TeleportermessengerSendCrossChainMessageIterator struct { + Event *TeleportermessengerSendCrossChainMessage // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub interfaces.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TeleportermessengerSendCrossChainMessageIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TeleportermessengerSendCrossChainMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TeleportermessengerSendCrossChainMessage) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TeleportermessengerSendCrossChainMessageIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TeleportermessengerSendCrossChainMessageIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TeleportermessengerSendCrossChainMessage represents a SendCrossChainMessage event raised by the Teleportermessenger contract. +type TeleportermessengerSendCrossChainMessage struct { + DestinationChainID [32]byte + MessageID *big.Int + Message TeleporterMessage + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSendCrossChainMessage is a free log retrieval operation binding the contract event 0x7491aecf1f3e24837ce48fd97fc8729fc036cebb3e5078643f3301b72852aa07. +// +// Solidity: event SendCrossChainMessage(bytes32 indexed destinationChainID, uint256 indexed messageID, (uint256,address,address,uint256,address[],(uint256,address)[],bytes) message) +func (_Teleportermessenger *TeleportermessengerFilterer) FilterSendCrossChainMessage(opts *bind.FilterOpts, destinationChainID [][32]byte, messageID []*big.Int) (*TeleportermessengerSendCrossChainMessageIterator, error) { + + var destinationChainIDRule []interface{} + for _, destinationChainIDItem := range destinationChainID { + destinationChainIDRule = append(destinationChainIDRule, destinationChainIDItem) + } + var messageIDRule []interface{} + for _, messageIDItem := range messageID { + messageIDRule = append(messageIDRule, messageIDItem) + } + + logs, sub, err := _Teleportermessenger.contract.FilterLogs(opts, "SendCrossChainMessage", destinationChainIDRule, messageIDRule) + if err != nil { + return nil, err + } + return &TeleportermessengerSendCrossChainMessageIterator{contract: _Teleportermessenger.contract, event: "SendCrossChainMessage", logs: logs, sub: sub}, nil +} + +// WatchSendCrossChainMessage is a free log subscription operation binding the contract event 0x7491aecf1f3e24837ce48fd97fc8729fc036cebb3e5078643f3301b72852aa07. +// +// Solidity: event SendCrossChainMessage(bytes32 indexed destinationChainID, uint256 indexed messageID, (uint256,address,address,uint256,address[],(uint256,address)[],bytes) message) +func (_Teleportermessenger *TeleportermessengerFilterer) WatchSendCrossChainMessage(opts *bind.WatchOpts, sink chan<- *TeleportermessengerSendCrossChainMessage, destinationChainID [][32]byte, messageID []*big.Int) (event.Subscription, error) { + + var destinationChainIDRule []interface{} + for _, destinationChainIDItem := range destinationChainID { + destinationChainIDRule = append(destinationChainIDRule, destinationChainIDItem) + } + var messageIDRule []interface{} + for _, messageIDItem := range messageID { + messageIDRule = append(messageIDRule, messageIDItem) + } + + logs, sub, err := _Teleportermessenger.contract.WatchLogs(opts, "SendCrossChainMessage", destinationChainIDRule, messageIDRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TeleportermessengerSendCrossChainMessage) + if err := _Teleportermessenger.contract.UnpackLog(event, "SendCrossChainMessage", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSendCrossChainMessage is a log parse operation binding the contract event 0x7491aecf1f3e24837ce48fd97fc8729fc036cebb3e5078643f3301b72852aa07. +// +// Solidity: event SendCrossChainMessage(bytes32 indexed destinationChainID, uint256 indexed messageID, (uint256,address,address,uint256,address[],(uint256,address)[],bytes) message) +func (_Teleportermessenger *TeleportermessengerFilterer) ParseSendCrossChainMessage(log types.Log) (*TeleportermessengerSendCrossChainMessage, error) { + event := new(TeleportermessengerSendCrossChainMessage) + if err := _Teleportermessenger.contract.UnpackLog(event, "SendCrossChainMessage", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/scripts/abi_go_bindings.sh b/scripts/abi_go_bindings.sh new file mode 100755 index 000000000..bf50569d1 --- /dev/null +++ b/scripts/abi_go_bindings.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash +# Copyright (C) 2023, Ava Labs, Inc. All rights reserved. +# See the file LICENSE for licensing terms. + +set -e + +source ./scripts/utils.sh + +setARCH + +TELEPORTER_PATH=$( + cd "$(dirname "${BASH_SOURCE[0]}")" + cd .. && pwd +) + +DEFAULT_CONTRACT_LIST="TeleporterMessenger ERC20Bridge ExampleCrossChainMessenger BlockHashPublisher BlockHashReceiver BridgeToken" + +CONTRACT_LIST= +HELP= +while [ $# -gt 0 ]; do + case "$1" in + -c | --contract) CONTRACT_LIST=$2 ;; + -h | --help) HELP=true ;; + esac + shift +done + +if [ "$HELP" = true ]; then + echo "Usage: ./scripts/abi_go_bindings.sh [OPTIONS]" + echo "Build contracts and generate Go bindings" + echo "" + echo "Options:" + echo " -c, --contract Generate Go bindings for the contract. If empty, generate Go bindings for a default list of contracts" + echo " -c, --contract "contract1 contract2" Generate Go bindings for multiple contracts" + echo " -h, --help Print this help message" + exit 0 +fi + +if ! command -v forge &> /dev/null; then + echo "forge not found, installing" + curl -L https://foundry.paradigm.xyz | bash + source $HOME/.bashrc + foundryup +fi + +echo "Building subnet-evm abigen" +go install $TELEPORTER_PATH/subnet-evm/cmd/abigen + +echo "Building Contracts" +cd $TELEPORTER_PATH/contracts +forge build --extra-output-files abi + +contract_names=($CONTRACT_LIST) + +# If CONTRACT_LIST is empty, use DEFAULT_CONTRACT_LIST +if [[ -z "${CONTRACT_LIST}" ]]; then + contract_names=($DEFAULT_CONTRACT_LIST) +fi + +cd $TELEPORTER_PATH +for contract_name in "${contract_names[@]}" +do + abi_file=$TELEPORTER_PATH/contracts/out/$contract_name.sol/$contract_name.abi.json + if ! [ -f $abi_file ]; then + echo "Error: Contract $contract_name abi file not found" + exit 1 + fi + + echo "Generating Go bindings for $contract_name..." + mkdir -p $TELEPORTER_PATH/abis/$contract_name + $GOPATH/bin/abigen --abi $abi_file \ + --pkg $(convertToLower $contract_name) \ + --out $TELEPORTER_PATH/abis/$contract_name/$contract_name.go + echo "Done generating Go bindings for $contract_name." +done + +exit 0 \ No newline at end of file diff --git a/scripts/utils.sh b/scripts/utils.sh index 93c0682e7..a0fbb9b00 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -27,4 +27,12 @@ function setARCH() { export ARCH=$(uname -m) [ $ARCH = x86_64 ] && ARCH=amd64 echo "ARCH set to $ARCH" +} + +function convertToLower() { + if [ "$ARCH" = 'arm64' ]; then + echo $1 | perl -ne 'print lc' + else + echo $1 | sed -e 's/\(.*\)/\L\1/' + fi } \ No newline at end of file