mirror of
https://github.com/AthanorLabs/atomic-swap.git
synced 2026-01-07 21:34:05 -05:00
908 lines
50 KiB
Go
908 lines
50 KiB
Go
// Code generated - DO NOT EDIT.
|
|
// This file is a generated binding and any manual changes will be lost.
|
|
|
|
package contracts
|
|
|
|
import (
|
|
"errors"
|
|
"math/big"
|
|
"strings"
|
|
|
|
ethereum "github.com/ethereum/go-ethereum"
|
|
"github.com/ethereum/go-ethereum/accounts/abi"
|
|
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
|
"github.com/ethereum/go-ethereum/common"
|
|
"github.com/ethereum/go-ethereum/core/types"
|
|
"github.com/ethereum/go-ethereum/event"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var (
|
|
_ = errors.New
|
|
_ = big.NewInt
|
|
_ = strings.NewReader
|
|
_ = ethereum.NotFound
|
|
_ = bind.Bind
|
|
_ = common.Big1
|
|
_ = types.BloomLookup
|
|
_ = event.NewSubscription
|
|
_ = abi.ConvertType
|
|
)
|
|
|
|
// TestERC20MetaData contains all meta data concerning the TestERC20 contract.
|
|
var TestERC20MetaData = &bind.MetaData{
|
|
ABI: "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"numDecimals\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"initialAccount\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"initialBalance\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"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\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approveInternal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"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\":\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferInternal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]",
|
|
Bin: "0x60a0604052604051620011d8380380620011d88339810160408190526200002691620001ed565b8484600362000036838262000320565b50600462000045828262000320565b50505060ff83166080526200005b828262000066565b50505050506200040e565b6001600160a01b038216620000c15760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060025f828254620000d49190620003e8565b90915550506001600160a01b0382165f81815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b505050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f83011262000153575f80fd5b81516001600160401b03808211156200017057620001706200012f565b604051601f8301601f19908116603f011681019082821181831017156200019b576200019b6200012f565b81604052838152602092508683858801011115620001b7575f80fd5b5f91505b83821015620001da5785820183015181830184015290820190620001bb565b5f93810190920192909252949350505050565b5f805f805f60a0868803121562000202575f80fd5b85516001600160401b038082111562000219575f80fd5b6200022789838a0162000143565b965060208801519150808211156200023d575f80fd5b506200024c8882890162000143565b945050604086015160ff8116811462000263575f80fd5b60608701519093506001600160a01b038116811462000280575f80fd5b80925050608086015190509295509295909350565b600181811c90821680620002aa57607f821691505b602082108103620002c957634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156200012a575f81815260208120601f850160051c81016020861015620002f75750805b601f850160051c820191505b81811015620003185782815560010162000303565b505050505050565b81516001600160401b038111156200033c576200033c6200012f565b62000354816200034d845462000295565b84620002cf565b602080601f8311600181146200038a575f8415620003725750858301515b5f19600386901b1c1916600185901b17855562000318565b5f85815260208120601f198616915b82811015620003ba5788860151825594840194600190910190840162000399565b5085821015620003d857878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b808201808211156200040857634e487b7160e01b5f52601160045260245ffd5b92915050565b608051610dab6200042d5f395f818160f7015261022d0152610dab5ff3fe6080604052600436106100e7575f3560e01c806340c10f19116100875780639dc29fac116100575780639dc29fac146102f7578063a457c2d714610316578063a9059cbb14610335578063dd62ed3e14610354575f80fd5b806340c10f191461027657806356189cb41461029057806370a08231146102af57806395d89b41146102e3575f80fd5b8063222f5be0116100c2578063222f5be0146101dc57806323b872dd146101fb578063313ce5671461021a5780633950935114610257575f80fd5b806306fdde0314610165578063095ea7b31461018f57806318160ddd146101be575f80fd5b366101615761012e3361011e60ff7f000000000000000000000000000000000000000000000000000000000000000016600a610bf0565b610129906064610c02565b610373565b341561015f5760405133903480156108fc02915f818181858888f1935050505015801561015d573d5f803e3d5ffd5b505b005b5f80fd5b348015610170575f80fd5b50610179610381565b6040516101869190610c19565b60405180910390f35b34801561019a575f80fd5b506101ae6101a9366004610c7f565b610411565b6040519015158152602001610186565b3480156101c9575f80fd5b506002545b604051908152602001610186565b3480156101e7575f80fd5b5061015f6101f6366004610ca7565b6104ad565b348015610206575f80fd5b506101ae610215366004610ca7565b6104bd565b348015610225575f80fd5b5060405160ff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610186565b348015610262575f80fd5b506101ae610271366004610c7f565b6104e0565b348015610281575f80fd5b5061015f610129366004610c7f565b34801561029b575f80fd5b5061015f6102aa366004610ca7565b610501565b3480156102ba575f80fd5b506101ce6102c9366004610ce0565b6001600160a01b03165f9081526020819052604090205490565b3480156102ee575f80fd5b5061017961050c565b348015610302575f80fd5b5061015f610311366004610c7f565b61051b565b348015610321575f80fd5b506101ae610330366004610c7f565b610525565b348015610340575f80fd5b506101ae61034f366004610c7f565b61059f565b34801561035f575f80fd5b506101ce61036e366004610cf9565b6105ac565b61037d82826105d6565b5050565b60606003805461039090610d2a565b80601f01602080910402602001604051908101604052809291908181526020018280546103bc90610d2a565b80156104075780601f106103de57610100808354040283529160200191610407565b820191905f5260205f20905b8154815290600101906020018083116103ea57829003601f168201915b5050505050905090565b5f33821580610427575061042581856105ac565b155b6104965760405162461bcd60e51b815260206004820152603560248201527f617070726f766520616c6c6f77616e6365206d7573742062652073657420746f604482015274207a65726f206265666f7265207570646174696e6760581b60648201526084015b60405180910390fd5b6104a1818585610693565b60019150505b92915050565b6104b88383836107b6565b505050565b5f336104ca85828561095a565b6104d58585856107b6565b506001949350505050565b5f336104a18185856104f283836105ac565b6104fc9190610d62565b610693565b6104b8838383610693565b60606004805461039090610d2a565b61037d82826109cc565b5f338161053282866105ac565b9050838110156105925760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161048d565b6104d58286868403610693565b5f336104a18185856107b6565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b6001600160a01b03821661062c5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161048d565b8060025f82825461063d9190610d62565b90915550506001600160a01b0382165f81815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6001600160a01b0383166106f55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161048d565b6001600160a01b0382166107565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161048d565b6001600160a01b038381165f8181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661081a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161048d565b6001600160a01b03821661087c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161048d565b6001600160a01b0383165f90815260208190526040902054818110156108f35760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161048d565b6001600160a01b038481165f81815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35b50505050565b5f61096584846105ac565b90505f19811461095457818110156109bf5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161048d565b6109548484848403610693565b6001600160a01b038216610a2c5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161048d565b6001600160a01b0382165f9081526020819052604090205481811015610a9f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161048d565b6001600160a01b0383165f818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b634e487b7160e01b5f52601160045260245ffd5b600181815b80851115610b4a57815f1904821115610b3057610b30610afc565b80851615610b3d57918102915b93841c9390800290610b15565b509250929050565b5f82610b60575060016104a7565b81610b6c57505f6104a7565b8160018114610b825760028114610b8c57610ba8565b60019150506104a7565b60ff841115610b9d57610b9d610afc565b50506001821b6104a7565b5060208310610133831016604e8410600b8410161715610bcb575081810a6104a7565b610bd58383610b10565b805f1904821115610be857610be8610afc565b029392505050565b5f610bfb8383610b52565b9392505050565b80820281158282048414176104a7576104a7610afc565b5f6020808352835180828501525f5b81811015610c4457858101830151858201604001528201610c28565b505f604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610c7a575f80fd5b919050565b5f8060408385031215610c90575f80fd5b610c9983610c64565b946020939093013593505050565b5f805f60608486031215610cb9575f80fd5b610cc284610c64565b9250610cd060208501610c64565b9150604084013590509250925092565b5f60208284031215610cf0575f80fd5b610bfb82610c64565b5f8060408385031215610d0a575f80fd5b610d1383610c64565b9150610d2160208401610c64565b90509250929050565b600181811c90821680610d3e57607f821691505b602082108103610d5c57634e487b7160e01b5f52602260045260245ffd5b50919050565b808201808211156104a7576104a7610afc56fea2646970667358221220a577efb03dcf867e120b05615e83f659554cce90a41c538ab393917b26dca87c64736f6c63430008140033",
|
|
}
|
|
|
|
// TestERC20ABI is the input ABI used to generate the binding from.
|
|
// Deprecated: Use TestERC20MetaData.ABI instead.
|
|
var TestERC20ABI = TestERC20MetaData.ABI
|
|
|
|
// TestERC20Bin is the compiled bytecode used for deploying new contracts.
|
|
// Deprecated: Use TestERC20MetaData.Bin instead.
|
|
var TestERC20Bin = TestERC20MetaData.Bin
|
|
|
|
// DeployTestERC20 deploys a new Ethereum contract, binding an instance of TestERC20 to it.
|
|
func DeployTestERC20(auth *bind.TransactOpts, backend bind.ContractBackend, name string, symbol string, numDecimals uint8, initialAccount common.Address, initialBalance *big.Int) (common.Address, *types.Transaction, *TestERC20, error) {
|
|
parsed, err := TestERC20MetaData.GetAbi()
|
|
if err != nil {
|
|
return common.Address{}, nil, nil, err
|
|
}
|
|
if parsed == nil {
|
|
return common.Address{}, nil, nil, errors.New("GetABI returned nil")
|
|
}
|
|
|
|
address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(TestERC20Bin), backend, name, symbol, numDecimals, initialAccount, initialBalance)
|
|
if err != nil {
|
|
return common.Address{}, nil, nil, err
|
|
}
|
|
return address, tx, &TestERC20{TestERC20Caller: TestERC20Caller{contract: contract}, TestERC20Transactor: TestERC20Transactor{contract: contract}, TestERC20Filterer: TestERC20Filterer{contract: contract}}, nil
|
|
}
|
|
|
|
// TestERC20 is an auto generated Go binding around an Ethereum contract.
|
|
type TestERC20 struct {
|
|
TestERC20Caller // Read-only binding to the contract
|
|
TestERC20Transactor // Write-only binding to the contract
|
|
TestERC20Filterer // Log filterer for contract events
|
|
}
|
|
|
|
// TestERC20Caller is an auto generated read-only Go binding around an Ethereum contract.
|
|
type TestERC20Caller struct {
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
}
|
|
|
|
// TestERC20Transactor is an auto generated write-only Go binding around an Ethereum contract.
|
|
type TestERC20Transactor struct {
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
}
|
|
|
|
// TestERC20Filterer is an auto generated log filtering Go binding around an Ethereum contract events.
|
|
type TestERC20Filterer struct {
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
}
|
|
|
|
// TestERC20Session is an auto generated Go binding around an Ethereum contract,
|
|
// with pre-set call and transact options.
|
|
type TestERC20Session struct {
|
|
Contract *TestERC20 // 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
|
|
}
|
|
|
|
// TestERC20CallerSession is an auto generated read-only Go binding around an Ethereum contract,
|
|
// with pre-set call options.
|
|
type TestERC20CallerSession struct {
|
|
Contract *TestERC20Caller // Generic contract caller binding to set the session for
|
|
CallOpts bind.CallOpts // Call options to use throughout this session
|
|
}
|
|
|
|
// TestERC20TransactorSession is an auto generated write-only Go binding around an Ethereum contract,
|
|
// with pre-set transact options.
|
|
type TestERC20TransactorSession struct {
|
|
Contract *TestERC20Transactor // Generic contract transactor binding to set the session for
|
|
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
|
}
|
|
|
|
// TestERC20Raw is an auto generated low-level Go binding around an Ethereum contract.
|
|
type TestERC20Raw struct {
|
|
Contract *TestERC20 // Generic contract binding to access the raw methods on
|
|
}
|
|
|
|
// TestERC20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
|
|
type TestERC20CallerRaw struct {
|
|
Contract *TestERC20Caller // Generic read-only contract binding to access the raw methods on
|
|
}
|
|
|
|
// TestERC20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
|
|
type TestERC20TransactorRaw struct {
|
|
Contract *TestERC20Transactor // Generic write-only contract binding to access the raw methods on
|
|
}
|
|
|
|
// NewTestERC20 creates a new instance of TestERC20, bound to a specific deployed contract.
|
|
func NewTestERC20(address common.Address, backend bind.ContractBackend) (*TestERC20, error) {
|
|
contract, err := bindTestERC20(address, backend, backend, backend)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TestERC20{TestERC20Caller: TestERC20Caller{contract: contract}, TestERC20Transactor: TestERC20Transactor{contract: contract}, TestERC20Filterer: TestERC20Filterer{contract: contract}}, nil
|
|
}
|
|
|
|
// NewTestERC20Caller creates a new read-only instance of TestERC20, bound to a specific deployed contract.
|
|
func NewTestERC20Caller(address common.Address, caller bind.ContractCaller) (*TestERC20Caller, error) {
|
|
contract, err := bindTestERC20(address, caller, nil, nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TestERC20Caller{contract: contract}, nil
|
|
}
|
|
|
|
// NewTestERC20Transactor creates a new write-only instance of TestERC20, bound to a specific deployed contract.
|
|
func NewTestERC20Transactor(address common.Address, transactor bind.ContractTransactor) (*TestERC20Transactor, error) {
|
|
contract, err := bindTestERC20(address, nil, transactor, nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TestERC20Transactor{contract: contract}, nil
|
|
}
|
|
|
|
// NewTestERC20Filterer creates a new log filterer instance of TestERC20, bound to a specific deployed contract.
|
|
func NewTestERC20Filterer(address common.Address, filterer bind.ContractFilterer) (*TestERC20Filterer, error) {
|
|
contract, err := bindTestERC20(address, nil, nil, filterer)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TestERC20Filterer{contract: contract}, nil
|
|
}
|
|
|
|
// bindTestERC20 binds a generic wrapper to an already deployed contract.
|
|
func bindTestERC20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
|
|
parsed, err := TestERC20MetaData.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 (_TestERC20 *TestERC20Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
|
|
return _TestERC20.Contract.TestERC20Caller.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 (_TestERC20 *TestERC20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.TestERC20Transactor.contract.Transfer(opts)
|
|
}
|
|
|
|
// Transact invokes the (paid) contract method with params as input values.
|
|
func (_TestERC20 *TestERC20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.TestERC20Transactor.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 (_TestERC20 *TestERC20CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
|
|
return _TestERC20.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 (_TestERC20 *TestERC20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.contract.Transfer(opts)
|
|
}
|
|
|
|
// Transact invokes the (paid) contract method with params as input values.
|
|
func (_TestERC20 *TestERC20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
|
return _TestERC20.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 (_TestERC20 *TestERC20Caller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) {
|
|
var out []interface{}
|
|
err := _TestERC20.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 (_TestERC20 *TestERC20Session) Allowance(owner common.Address, spender common.Address) (*big.Int, error) {
|
|
return _TestERC20.Contract.Allowance(&_TestERC20.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 (_TestERC20 *TestERC20CallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) {
|
|
return _TestERC20.Contract.Allowance(&_TestERC20.CallOpts, owner, spender)
|
|
}
|
|
|
|
// BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
|
|
//
|
|
// Solidity: function balanceOf(address account) view returns(uint256)
|
|
func (_TestERC20 *TestERC20Caller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) {
|
|
var out []interface{}
|
|
err := _TestERC20.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 (_TestERC20 *TestERC20Session) BalanceOf(account common.Address) (*big.Int, error) {
|
|
return _TestERC20.Contract.BalanceOf(&_TestERC20.CallOpts, account)
|
|
}
|
|
|
|
// BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
|
|
//
|
|
// Solidity: function balanceOf(address account) view returns(uint256)
|
|
func (_TestERC20 *TestERC20CallerSession) BalanceOf(account common.Address) (*big.Int, error) {
|
|
return _TestERC20.Contract.BalanceOf(&_TestERC20.CallOpts, account)
|
|
}
|
|
|
|
// Decimals is a free data retrieval call binding the contract method 0x313ce567.
|
|
//
|
|
// Solidity: function decimals() view returns(uint8)
|
|
func (_TestERC20 *TestERC20Caller) Decimals(opts *bind.CallOpts) (uint8, error) {
|
|
var out []interface{}
|
|
err := _TestERC20.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 (_TestERC20 *TestERC20Session) Decimals() (uint8, error) {
|
|
return _TestERC20.Contract.Decimals(&_TestERC20.CallOpts)
|
|
}
|
|
|
|
// Decimals is a free data retrieval call binding the contract method 0x313ce567.
|
|
//
|
|
// Solidity: function decimals() view returns(uint8)
|
|
func (_TestERC20 *TestERC20CallerSession) Decimals() (uint8, error) {
|
|
return _TestERC20.Contract.Decimals(&_TestERC20.CallOpts)
|
|
}
|
|
|
|
// Name is a free data retrieval call binding the contract method 0x06fdde03.
|
|
//
|
|
// Solidity: function name() view returns(string)
|
|
func (_TestERC20 *TestERC20Caller) Name(opts *bind.CallOpts) (string, error) {
|
|
var out []interface{}
|
|
err := _TestERC20.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 (_TestERC20 *TestERC20Session) Name() (string, error) {
|
|
return _TestERC20.Contract.Name(&_TestERC20.CallOpts)
|
|
}
|
|
|
|
// Name is a free data retrieval call binding the contract method 0x06fdde03.
|
|
//
|
|
// Solidity: function name() view returns(string)
|
|
func (_TestERC20 *TestERC20CallerSession) Name() (string, error) {
|
|
return _TestERC20.Contract.Name(&_TestERC20.CallOpts)
|
|
}
|
|
|
|
// Symbol is a free data retrieval call binding the contract method 0x95d89b41.
|
|
//
|
|
// Solidity: function symbol() view returns(string)
|
|
func (_TestERC20 *TestERC20Caller) Symbol(opts *bind.CallOpts) (string, error) {
|
|
var out []interface{}
|
|
err := _TestERC20.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 (_TestERC20 *TestERC20Session) Symbol() (string, error) {
|
|
return _TestERC20.Contract.Symbol(&_TestERC20.CallOpts)
|
|
}
|
|
|
|
// Symbol is a free data retrieval call binding the contract method 0x95d89b41.
|
|
//
|
|
// Solidity: function symbol() view returns(string)
|
|
func (_TestERC20 *TestERC20CallerSession) Symbol() (string, error) {
|
|
return _TestERC20.Contract.Symbol(&_TestERC20.CallOpts)
|
|
}
|
|
|
|
// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
|
|
//
|
|
// Solidity: function totalSupply() view returns(uint256)
|
|
func (_TestERC20 *TestERC20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) {
|
|
var out []interface{}
|
|
err := _TestERC20.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 (_TestERC20 *TestERC20Session) TotalSupply() (*big.Int, error) {
|
|
return _TestERC20.Contract.TotalSupply(&_TestERC20.CallOpts)
|
|
}
|
|
|
|
// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
|
|
//
|
|
// Solidity: function totalSupply() view returns(uint256)
|
|
func (_TestERC20 *TestERC20CallerSession) TotalSupply() (*big.Int, error) {
|
|
return _TestERC20.Contract.TotalSupply(&_TestERC20.CallOpts)
|
|
}
|
|
|
|
// Approve is a paid mutator transaction binding the contract method 0x095ea7b3.
|
|
//
|
|
// Solidity: function approve(address spender, uint256 amount) returns(bool)
|
|
func (_TestERC20 *TestERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.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 (_TestERC20 *TestERC20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.Approve(&_TestERC20.TransactOpts, spender, amount)
|
|
}
|
|
|
|
// Approve is a paid mutator transaction binding the contract method 0x095ea7b3.
|
|
//
|
|
// Solidity: function approve(address spender, uint256 amount) returns(bool)
|
|
func (_TestERC20 *TestERC20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.Approve(&_TestERC20.TransactOpts, spender, amount)
|
|
}
|
|
|
|
// ApproveInternal is a paid mutator transaction binding the contract method 0x56189cb4.
|
|
//
|
|
// Solidity: function approveInternal(address owner, address spender, uint256 value) returns()
|
|
func (_TestERC20 *TestERC20Transactor) ApproveInternal(opts *bind.TransactOpts, owner common.Address, spender common.Address, value *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.contract.Transact(opts, "approveInternal", owner, spender, value)
|
|
}
|
|
|
|
// ApproveInternal is a paid mutator transaction binding the contract method 0x56189cb4.
|
|
//
|
|
// Solidity: function approveInternal(address owner, address spender, uint256 value) returns()
|
|
func (_TestERC20 *TestERC20Session) ApproveInternal(owner common.Address, spender common.Address, value *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.ApproveInternal(&_TestERC20.TransactOpts, owner, spender, value)
|
|
}
|
|
|
|
// ApproveInternal is a paid mutator transaction binding the contract method 0x56189cb4.
|
|
//
|
|
// Solidity: function approveInternal(address owner, address spender, uint256 value) returns()
|
|
func (_TestERC20 *TestERC20TransactorSession) ApproveInternal(owner common.Address, spender common.Address, value *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.ApproveInternal(&_TestERC20.TransactOpts, owner, spender, value)
|
|
}
|
|
|
|
// Burn is a paid mutator transaction binding the contract method 0x9dc29fac.
|
|
//
|
|
// Solidity: function burn(address account, uint256 amount) returns()
|
|
func (_TestERC20 *TestERC20Transactor) Burn(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.contract.Transact(opts, "burn", account, amount)
|
|
}
|
|
|
|
// Burn is a paid mutator transaction binding the contract method 0x9dc29fac.
|
|
//
|
|
// Solidity: function burn(address account, uint256 amount) returns()
|
|
func (_TestERC20 *TestERC20Session) Burn(account common.Address, amount *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.Burn(&_TestERC20.TransactOpts, account, amount)
|
|
}
|
|
|
|
// Burn is a paid mutator transaction binding the contract method 0x9dc29fac.
|
|
//
|
|
// Solidity: function burn(address account, uint256 amount) returns()
|
|
func (_TestERC20 *TestERC20TransactorSession) Burn(account common.Address, amount *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.Burn(&_TestERC20.TransactOpts, account, amount)
|
|
}
|
|
|
|
// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7.
|
|
//
|
|
// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool)
|
|
func (_TestERC20 *TestERC20Transactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.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 (_TestERC20 *TestERC20Session) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.DecreaseAllowance(&_TestERC20.TransactOpts, spender, subtractedValue)
|
|
}
|
|
|
|
// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7.
|
|
//
|
|
// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool)
|
|
func (_TestERC20 *TestERC20TransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.DecreaseAllowance(&_TestERC20.TransactOpts, spender, subtractedValue)
|
|
}
|
|
|
|
// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351.
|
|
//
|
|
// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool)
|
|
func (_TestERC20 *TestERC20Transactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.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 (_TestERC20 *TestERC20Session) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.IncreaseAllowance(&_TestERC20.TransactOpts, spender, addedValue)
|
|
}
|
|
|
|
// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351.
|
|
//
|
|
// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool)
|
|
func (_TestERC20 *TestERC20TransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.IncreaseAllowance(&_TestERC20.TransactOpts, spender, addedValue)
|
|
}
|
|
|
|
// Mint is a paid mutator transaction binding the contract method 0x40c10f19.
|
|
//
|
|
// Solidity: function mint(address account, uint256 amount) returns()
|
|
func (_TestERC20 *TestERC20Transactor) Mint(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.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 (_TestERC20 *TestERC20Session) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.Mint(&_TestERC20.TransactOpts, account, amount)
|
|
}
|
|
|
|
// Mint is a paid mutator transaction binding the contract method 0x40c10f19.
|
|
//
|
|
// Solidity: function mint(address account, uint256 amount) returns()
|
|
func (_TestERC20 *TestERC20TransactorSession) Mint(account common.Address, amount *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.Mint(&_TestERC20.TransactOpts, account, amount)
|
|
}
|
|
|
|
// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb.
|
|
//
|
|
// Solidity: function transfer(address to, uint256 amount) returns(bool)
|
|
func (_TestERC20 *TestERC20Transactor) Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.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 (_TestERC20 *TestERC20Session) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.Transfer(&_TestERC20.TransactOpts, to, amount)
|
|
}
|
|
|
|
// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb.
|
|
//
|
|
// Solidity: function transfer(address to, uint256 amount) returns(bool)
|
|
func (_TestERC20 *TestERC20TransactorSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.Transfer(&_TestERC20.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 (_TestERC20 *TestERC20Transactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.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 (_TestERC20 *TestERC20Session) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.TransferFrom(&_TestERC20.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 (_TestERC20 *TestERC20TransactorSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.TransferFrom(&_TestERC20.TransactOpts, from, to, amount)
|
|
}
|
|
|
|
// TransferInternal is a paid mutator transaction binding the contract method 0x222f5be0.
|
|
//
|
|
// Solidity: function transferInternal(address from, address to, uint256 value) returns()
|
|
func (_TestERC20 *TestERC20Transactor) TransferInternal(opts *bind.TransactOpts, from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.contract.Transact(opts, "transferInternal", from, to, value)
|
|
}
|
|
|
|
// TransferInternal is a paid mutator transaction binding the contract method 0x222f5be0.
|
|
//
|
|
// Solidity: function transferInternal(address from, address to, uint256 value) returns()
|
|
func (_TestERC20 *TestERC20Session) TransferInternal(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.TransferInternal(&_TestERC20.TransactOpts, from, to, value)
|
|
}
|
|
|
|
// TransferInternal is a paid mutator transaction binding the contract method 0x222f5be0.
|
|
//
|
|
// Solidity: function transferInternal(address from, address to, uint256 value) returns()
|
|
func (_TestERC20 *TestERC20TransactorSession) TransferInternal(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) {
|
|
return _TestERC20.Contract.TransferInternal(&_TestERC20.TransactOpts, from, to, value)
|
|
}
|
|
|
|
// Receive is a paid mutator transaction binding the contract receive function.
|
|
//
|
|
// Solidity: receive() payable returns()
|
|
func (_TestERC20 *TestERC20Transactor) Receive(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _TestERC20.contract.RawTransact(opts, nil) // calldata is disallowed for receive function
|
|
}
|
|
|
|
// Receive is a paid mutator transaction binding the contract receive function.
|
|
//
|
|
// Solidity: receive() payable returns()
|
|
func (_TestERC20 *TestERC20Session) Receive() (*types.Transaction, error) {
|
|
return _TestERC20.Contract.Receive(&_TestERC20.TransactOpts)
|
|
}
|
|
|
|
// Receive is a paid mutator transaction binding the contract receive function.
|
|
//
|
|
// Solidity: receive() payable returns()
|
|
func (_TestERC20 *TestERC20TransactorSession) Receive() (*types.Transaction, error) {
|
|
return _TestERC20.Contract.Receive(&_TestERC20.TransactOpts)
|
|
}
|
|
|
|
// TestERC20ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the TestERC20 contract.
|
|
type TestERC20ApprovalIterator struct {
|
|
Event *TestERC20Approval // 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 ethereum.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 *TestERC20ApprovalIterator) 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(TestERC20Approval)
|
|
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(TestERC20Approval)
|
|
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 *TestERC20ApprovalIterator) Error() error {
|
|
return it.fail
|
|
}
|
|
|
|
// Close terminates the iteration process, releasing any pending underlying
|
|
// resources.
|
|
func (it *TestERC20ApprovalIterator) Close() error {
|
|
it.sub.Unsubscribe()
|
|
return nil
|
|
}
|
|
|
|
// TestERC20Approval represents a Approval event raised by the TestERC20 contract.
|
|
type TestERC20Approval 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 (_TestERC20 *TestERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*TestERC20ApprovalIterator, 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 := _TestERC20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TestERC20ApprovalIterator{contract: _TestERC20.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 (_TestERC20 *TestERC20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *TestERC20Approval, 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 := _TestERC20.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(TestERC20Approval)
|
|
if err := _TestERC20.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 (_TestERC20 *TestERC20Filterer) ParseApproval(log types.Log) (*TestERC20Approval, error) {
|
|
event := new(TestERC20Approval)
|
|
if err := _TestERC20.contract.UnpackLog(event, "Approval", log); err != nil {
|
|
return nil, err
|
|
}
|
|
event.Raw = log
|
|
return event, nil
|
|
}
|
|
|
|
// TestERC20TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the TestERC20 contract.
|
|
type TestERC20TransferIterator struct {
|
|
Event *TestERC20Transfer // 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 ethereum.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 *TestERC20TransferIterator) 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(TestERC20Transfer)
|
|
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(TestERC20Transfer)
|
|
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 *TestERC20TransferIterator) Error() error {
|
|
return it.fail
|
|
}
|
|
|
|
// Close terminates the iteration process, releasing any pending underlying
|
|
// resources.
|
|
func (it *TestERC20TransferIterator) Close() error {
|
|
it.sub.Unsubscribe()
|
|
return nil
|
|
}
|
|
|
|
// TestERC20Transfer represents a Transfer event raised by the TestERC20 contract.
|
|
type TestERC20Transfer 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 (_TestERC20 *TestERC20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TestERC20TransferIterator, 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 := _TestERC20.contract.FilterLogs(opts, "Transfer", fromRule, toRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &TestERC20TransferIterator{contract: _TestERC20.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 (_TestERC20 *TestERC20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *TestERC20Transfer, 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 := _TestERC20.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(TestERC20Transfer)
|
|
if err := _TestERC20.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 (_TestERC20 *TestERC20Filterer) ParseTransfer(log types.Log) (*TestERC20Transfer, error) {
|
|
event := new(TestERC20Transfer)
|
|
if err := _TestERC20.contract.UnpackLog(event, "Transfer", log); err != nil {
|
|
return nil, err
|
|
}
|
|
event.Raw = log
|
|
return event, nil
|
|
}
|