// Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package contract import ( "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 ( _ = big.NewInt _ = strings.NewReader _ = ethereum.NotFound _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription ) // ContractABI is the input ABI used to generate the binding from. const ContractABI = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"usdtAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"authorize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" // ContractBin is the compiled bytecode used for deploying new contracts. var ContractBin = "0x608060405234801561000f575f80fd5b50604051610aa3380380610aa383398181016040528101906100319190610114565b805f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503360015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061013f565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100e3826100ba565b9050919050565b6100f3816100d9565b81146100fd575f80fd5b50565b5f8151905061010e816100ea565b92915050565b5f60208284031215610129576101286100b6565b5b5f61013684828501610100565b91505092915050565b6109578061014c5f395ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c806323b872dd1461004e578063a9059cbb1461006a578063c1dbd9b214610086578063f8b2cb4f146100a2575b5f80fd5b61006860048036038101906100639190610547565b6100d2565b005b610084600480360381019061007f9190610597565b6101b8565b005b6100a0600480360381019061009b9190610597565b61029b565b005b6100bc60048036038101906100b791906105d5565b610412565b6040516100c9919061060f565b60405180910390f35b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166323b872dd8585856040518463ffffffff1660e01b815260040161013393929190610637565b6020604051808303815f875af115801561014f573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061017391906106a1565b6101b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101a990610726565b60405180910390fd5b50505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401610217929190610744565b6020604051808303815f875af1158015610233573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061025791906106a1565b610296576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028d906107b5565b60405180910390fd5b505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461032a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161032190610843565b60405180910390fd5b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f8173ffffffffffffffffffffffffffffffffffffffff1663095ea7b385856040518363ffffffff1660e01b815260040161038a929190610744565b6020604051808303815f875af11580156103a6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103ca91906106a1565b90508061040c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610403906108ab565b60405180910390fd5b50505050565b5f805f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b815260040161046f91906108c9565b602060405180830381865afa15801561048a573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104ae91906108f6565b915050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6104e3826104ba565b9050919050565b6104f3816104d9565b81146104fd575f80fd5b50565b5f8135905061050e816104ea565b92915050565b5f819050919050565b61052681610514565b8114610530575f80fd5b50565b5f813590506105418161051d565b92915050565b5f805f6060848603121561055e5761055d6104b6565b5b5f61056b86828701610500565b935050602061057c86828701610500565b925050604061058d86828701610533565b9150509250925092565b5f80604083850312156105ad576105ac6104b6565b5b5f6105ba85828601610500565b92505060206105cb85828601610533565b9150509250929050565b5f602082840312156105ea576105e96104b6565b5b5f6105f784828501610500565b91505092915050565b61060981610514565b82525050565b5f6020820190506106225f830184610600565b92915050565b610631816104d9565b82525050565b5f60608201905061064a5f830186610628565b6106576020830185610628565b6106646040830184610600565b949350505050565b5f8115159050919050565b6106808161066c565b811461068a575f80fd5b50565b5f8151905061069b81610677565b92915050565b5f602082840312156106b6576106b56104b6565b5b5f6106c38482850161068d565b91505092915050565b5f82825260208201905092915050565b7f5472616e7366657246726f6d206661696c6564000000000000000000000000005f82015250565b5f6107106013836106cc565b915061071b826106dc565b602082019050919050565b5f6020820190508181035f83015261073d81610704565b9050919050565b5f6040820190506107575f830185610628565b6107646020830184610600565b9392505050565b7f5472616e73666572206661696c656400000000000000000000000000000000005f82015250565b5f61079f600f836106cc565b91506107aa8261076b565b602082019050919050565b5f6020820190508181035f8301526107cc81610793565b9050919050565b7f4f6e6c79206f776e65722063616e2063616c6c20746869732066756e6374696f5f8201527f6e00000000000000000000000000000000000000000000000000000000000000602082015250565b5f61082d6021836106cc565b9150610838826107d3565b604082019050919050565b5f6020820190508181035f83015261085a81610821565b9050919050565b7f417574686f72697a6174696f6e206661696c65640000000000000000000000005f82015250565b5f6108956014836106cc565b91506108a082610861565b602082019050919050565b5f6020820190508181035f8301526108c281610889565b9050919050565b5f6020820190506108dc5f830184610628565b92915050565b5f815190506108f08161051d565b92915050565b5f6020828403121561090b5761090a6104b6565b5b5f610918848285016108e2565b9150509291505056fea26469706673582212201e8bfe92dd8c774bf184c29feb661daba2985b13e3e47ea270d1b2c2de95d68964736f6c63430008150033" // DeployContract deploys a new Ethereum contract, binding an instance of Contract to it. func DeployContract(auth *bind.TransactOpts, backend bind.ContractBackend, usdtAddress common.Address) (common.Address, *types.Transaction, *Contract, error) { parsed, err := abi.JSON(strings.NewReader(ContractABI)) if err != nil { return common.Address{}, nil, nil, err } address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ContractBin), backend, usdtAddress) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &Contract{ContractCaller: ContractCaller{contract: contract}, ContractTransactor: ContractTransactor{contract: contract}, ContractFilterer: ContractFilterer{contract: contract}}, nil } // Contract is an auto generated Go binding around an Ethereum contract. type Contract struct { ContractCaller // Read-only binding to the contract ContractTransactor // Write-only binding to the contract ContractFilterer // Log filterer for contract events } // ContractCaller is an auto generated read-only Go binding around an Ethereum contract. type ContractCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ContractTransactor is an auto generated write-only Go binding around an Ethereum contract. type ContractTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ContractFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type ContractFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ContractSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type ContractSession struct { Contract *Contract // 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 } // ContractCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type ContractCallerSession struct { Contract *ContractCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // ContractTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type ContractTransactorSession struct { Contract *ContractTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // ContractRaw is an auto generated low-level Go binding around an Ethereum contract. type ContractRaw struct { Contract *Contract // Generic contract binding to access the raw methods on } // ContractCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type ContractCallerRaw struct { Contract *ContractCaller // Generic read-only contract binding to access the raw methods on } // ContractTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type ContractTransactorRaw struct { Contract *ContractTransactor // Generic write-only contract binding to access the raw methods on } // NewContract creates a new instance of Contract, bound to a specific deployed contract. func NewContract(address common.Address, backend bind.ContractBackend) (*Contract, error) { contract, err := bindContract(address, backend, backend, backend) if err != nil { return nil, err } return &Contract{ContractCaller: ContractCaller{contract: contract}, ContractTransactor: ContractTransactor{contract: contract}, ContractFilterer: ContractFilterer{contract: contract}}, nil } // NewContractCaller creates a new read-only instance of Contract, bound to a specific deployed contract. func NewContractCaller(address common.Address, caller bind.ContractCaller) (*ContractCaller, error) { contract, err := bindContract(address, caller, nil, nil) if err != nil { return nil, err } return &ContractCaller{contract: contract}, nil } // NewContractTransactor creates a new write-only instance of Contract, bound to a specific deployed contract. func NewContractTransactor(address common.Address, transactor bind.ContractTransactor) (*ContractTransactor, error) { contract, err := bindContract(address, nil, transactor, nil) if err != nil { return nil, err } return &ContractTransactor{contract: contract}, nil } // NewContractFilterer creates a new log filterer instance of Contract, bound to a specific deployed contract. func NewContractFilterer(address common.Address, filterer bind.ContractFilterer) (*ContractFilterer, error) { contract, err := bindContract(address, nil, nil, filterer) if err != nil { return nil, err } return &ContractFilterer{contract: contract}, nil } // bindContract binds a generic wrapper to an already deployed contract. func bindContract(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := abi.JSON(strings.NewReader(ContractABI)) 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 (_Contract *ContractRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Contract.Contract.ContractCaller.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 (_Contract *ContractRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Contract.Contract.ContractTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Contract *ContractRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Contract.Contract.ContractTransactor.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 (_Contract *ContractCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Contract.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 (_Contract *ContractTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _Contract.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_Contract *ContractTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _Contract.Contract.contract.Transact(opts, method, params...) } // GetBalance is a free data retrieval call binding the contract method 0xf8b2cb4f. // // Solidity: function getBalance(address account) view returns(uint256) func (_Contract *ContractCaller) GetBalance(opts *bind.CallOpts, account common.Address) (*big.Int, error) { var out []interface{} err := _Contract.contract.Call(opts, &out, "getBalance", account) if err != nil { return *new(*big.Int), err } out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } // GetBalance is a free data retrieval call binding the contract method 0xf8b2cb4f. // // Solidity: function getBalance(address account) view returns(uint256) func (_Contract *ContractSession) GetBalance(account common.Address) (*big.Int, error) { return _Contract.Contract.GetBalance(&_Contract.CallOpts, account) } // GetBalance is a free data retrieval call binding the contract method 0xf8b2cb4f. // // Solidity: function getBalance(address account) view returns(uint256) func (_Contract *ContractCallerSession) GetBalance(account common.Address) (*big.Int, error) { return _Contract.Contract.GetBalance(&_Contract.CallOpts, account) } // Authorize is a paid mutator transaction binding the contract method 0xc1dbd9b2. // // Solidity: function authorize(address spender, uint256 amount) returns() func (_Contract *ContractTransactor) Authorize(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { return _Contract.contract.Transact(opts, "authorize", spender, amount) } // Authorize is a paid mutator transaction binding the contract method 0xc1dbd9b2. // // Solidity: function authorize(address spender, uint256 amount) returns() func (_Contract *ContractSession) Authorize(spender common.Address, amount *big.Int) (*types.Transaction, error) { return _Contract.Contract.Authorize(&_Contract.TransactOpts, spender, amount) } // Authorize is a paid mutator transaction binding the contract method 0xc1dbd9b2. // // Solidity: function authorize(address spender, uint256 amount) returns() func (_Contract *ContractTransactorSession) Authorize(spender common.Address, amount *big.Int) (*types.Transaction, error) { return _Contract.Contract.Authorize(&_Contract.TransactOpts, spender, amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address recipient, uint256 amount) returns() func (_Contract *ContractTransactor) Transfer(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) { return _Contract.contract.Transact(opts, "transfer", recipient, amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address recipient, uint256 amount) returns() func (_Contract *ContractSession) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { return _Contract.Contract.Transfer(&_Contract.TransactOpts, recipient, amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address recipient, uint256 amount) returns() func (_Contract *ContractTransactorSession) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) { return _Contract.Contract.Transfer(&_Contract.TransactOpts, recipient, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns() func (_Contract *ContractTransactor) TransferFrom(opts *bind.TransactOpts, sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { return _Contract.contract.Transact(opts, "transferFrom", sender, recipient, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns() func (_Contract *ContractSession) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { return _Contract.Contract.TransferFrom(&_Contract.TransactOpts, sender, recipient, amount) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns() func (_Contract *ContractTransactorSession) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) { return _Contract.Contract.TransferFrom(&_Contract.TransactOpts, sender, recipient, amount) }