From aedfb7bec57ace6bb8af4318cec068a0374e8955 Mon Sep 17 00:00:00 2001 From: Gwen Date: Wed, 4 Oct 2023 13:09:02 -0400 Subject: [PATCH] add BridgeToken --- abis/BridgeToken/BridgeToken.go | 967 ++++++++++++++++++++++++++++++++ scripts/abi_go_bindings.sh | 2 +- 2 files changed, 968 insertions(+), 1 deletion(-) create mode 100644 abis/BridgeToken/BridgeToken.go 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/scripts/abi_go_bindings.sh b/scripts/abi_go_bindings.sh index 5f83d2c2a..bf50569d1 100755 --- a/scripts/abi_go_bindings.sh +++ b/scripts/abi_go_bindings.sh @@ -13,7 +13,7 @@ TELEPORTER_PATH=$( cd .. && pwd ) -DEFAULT_CONTRACT_LIST="TeleporterMessenger ERC20Bridge ExampleCrossChainMessenger BlockHashPublisher BlockHashReceiver" +DEFAULT_CONTRACT_LIST="TeleporterMessenger ERC20Bridge ExampleCrossChainMessenger BlockHashPublisher BlockHashReceiver BridgeToken" CONTRACT_LIST= HELP=