Created
August 25, 2018 04:18
-
-
Save huahuayu/5c2c3beb39739cf74333d947e29ea363 to your computer and use it in GitHub Desktop.
go bind code generated from contract https://ropsten.etherscan.io/address/0x466fb2e1979de417a30836a82c1739706938776a#code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code generated - DO NOT EDIT. | |
// This file is a generated binding and any manual changes will be lost. | |
package main | |
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" | |
) | |
// MTTTokenABI is the input ABI used to generate the binding from. | |
const MTTTokenABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"INITIAL_SUPPLY\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseApproval\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseApproval\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"}]" | |
// MTTToken is an auto generated Go binding around an Ethereum contract. | |
type MTTToken struct { | |
MTTTokenCaller // Read-only binding to the contract | |
MTTTokenTransactor // Write-only binding to the contract | |
MTTTokenFilterer // Log filterer for contract events | |
} | |
// MTTTokenCaller is an auto generated read-only Go binding around an Ethereum contract. | |
type MTTTokenCaller struct { | |
contract *bind.BoundContract // Generic contract wrapper for the low level calls | |
} | |
// MTTTokenTransactor is an auto generated write-only Go binding around an Ethereum contract. | |
type MTTTokenTransactor struct { | |
contract *bind.BoundContract // Generic contract wrapper for the low level calls | |
} | |
// MTTTokenFilterer is an auto generated log filtering Go binding around an Ethereum contract events. | |
type MTTTokenFilterer struct { | |
contract *bind.BoundContract // Generic contract wrapper for the low level calls | |
} | |
// MTTTokenSession is an auto generated Go binding around an Ethereum contract, | |
// with pre-set call and transact options. | |
type MTTTokenSession struct { | |
Contract *MTTToken // 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 | |
} | |
// MTTTokenCallerSession is an auto generated read-only Go binding around an Ethereum contract, | |
// with pre-set call options. | |
type MTTTokenCallerSession struct { | |
Contract *MTTTokenCaller // Generic contract caller binding to set the session for | |
CallOpts bind.CallOpts // Call options to use throughout this session | |
} | |
// MTTTokenTransactorSession is an auto generated write-only Go binding around an Ethereum contract, | |
// with pre-set transact options. | |
type MTTTokenTransactorSession struct { | |
Contract *MTTTokenTransactor // Generic contract transactor binding to set the session for | |
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session | |
} | |
// MTTTokenRaw is an auto generated low-level Go binding around an Ethereum contract. | |
type MTTTokenRaw struct { | |
Contract *MTTToken // Generic contract binding to access the raw methods on | |
} | |
// MTTTokenCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. | |
type MTTTokenCallerRaw struct { | |
Contract *MTTTokenCaller // Generic read-only contract binding to access the raw methods on | |
} | |
// MTTTokenTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. | |
type MTTTokenTransactorRaw struct { | |
Contract *MTTTokenTransactor // Generic write-only contract binding to access the raw methods on | |
} | |
// NewMTTToken creates a new instance of MTTToken, bound to a specific deployed contract. | |
func NewMTTToken(address common.Address, backend bind.ContractBackend) (*MTTToken, error) { | |
contract, err := bindMTTToken(address, backend, backend, backend) | |
if err != nil { | |
return nil, err | |
} | |
return &MTTToken{MTTTokenCaller: MTTTokenCaller{contract: contract}, MTTTokenTransactor: MTTTokenTransactor{contract: contract}, MTTTokenFilterer: MTTTokenFilterer{contract: contract}}, nil | |
} | |
// NewMTTTokenCaller creates a new read-only instance of MTTToken, bound to a specific deployed contract. | |
func NewMTTTokenCaller(address common.Address, caller bind.ContractCaller) (*MTTTokenCaller, error) { | |
contract, err := bindMTTToken(address, caller, nil, nil) | |
if err != nil { | |
return nil, err | |
} | |
return &MTTTokenCaller{contract: contract}, nil | |
} | |
// NewMTTTokenTransactor creates a new write-only instance of MTTToken, bound to a specific deployed contract. | |
func NewMTTTokenTransactor(address common.Address, transactor bind.ContractTransactor) (*MTTTokenTransactor, error) { | |
contract, err := bindMTTToken(address, nil, transactor, nil) | |
if err != nil { | |
return nil, err | |
} | |
return &MTTTokenTransactor{contract: contract}, nil | |
} | |
// NewMTTTokenFilterer creates a new log filterer instance of MTTToken, bound to a specific deployed contract. | |
func NewMTTTokenFilterer(address common.Address, filterer bind.ContractFilterer) (*MTTTokenFilterer, error) { | |
contract, err := bindMTTToken(address, nil, nil, filterer) | |
if err != nil { | |
return nil, err | |
} | |
return &MTTTokenFilterer{contract: contract}, nil | |
} | |
// bindMTTToken binds a generic wrapper to an already deployed contract. | |
func bindMTTToken(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { | |
parsed, err := abi.JSON(strings.NewReader(MTTTokenABI)) | |
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 (_MTTToken *MTTTokenRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { | |
return _MTTToken.Contract.MTTTokenCaller.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 (_MTTToken *MTTTokenRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { | |
return _MTTToken.Contract.MTTTokenTransactor.contract.Transfer(opts) | |
} | |
// Transact invokes the (paid) contract method with params as input values. | |
func (_MTTToken *MTTTokenRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { | |
return _MTTToken.Contract.MTTTokenTransactor.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 (_MTTToken *MTTTokenCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { | |
return _MTTToken.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 (_MTTToken *MTTTokenTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { | |
return _MTTToken.Contract.contract.Transfer(opts) | |
} | |
// Transact invokes the (paid) contract method with params as input values. | |
func (_MTTToken *MTTTokenTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { | |
return _MTTToken.Contract.contract.Transact(opts, method, params...) | |
} | |
// INITIALSUPPLY is a free data retrieval call binding the contract method 0x2ff2e9dc. | |
// | |
// Solidity: function INITIAL_SUPPLY() constant returns(uint256) | |
func (_MTTToken *MTTTokenCaller) INITIALSUPPLY(opts *bind.CallOpts) (*big.Int, error) { | |
var ( | |
ret0 = new(*big.Int) | |
) | |
out := ret0 | |
err := _MTTToken.contract.Call(opts, out, "INITIAL_SUPPLY") | |
return *ret0, err | |
} | |
// INITIALSUPPLY is a free data retrieval call binding the contract method 0x2ff2e9dc. | |
// | |
// Solidity: function INITIAL_SUPPLY() constant returns(uint256) | |
func (_MTTToken *MTTTokenSession) INITIALSUPPLY() (*big.Int, error) { | |
return _MTTToken.Contract.INITIALSUPPLY(&_MTTToken.CallOpts) | |
} | |
// INITIALSUPPLY is a free data retrieval call binding the contract method 0x2ff2e9dc. | |
// | |
// Solidity: function INITIAL_SUPPLY() constant returns(uint256) | |
func (_MTTToken *MTTTokenCallerSession) INITIALSUPPLY() (*big.Int, error) { | |
return _MTTToken.Contract.INITIALSUPPLY(&_MTTToken.CallOpts) | |
} | |
// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. | |
// | |
// Solidity: function allowance(_owner address, _spender address) constant returns(uint256) | |
func (_MTTToken *MTTTokenCaller) Allowance(opts *bind.CallOpts, _owner common.Address, _spender common.Address) (*big.Int, error) { | |
var ( | |
ret0 = new(*big.Int) | |
) | |
out := ret0 | |
err := _MTTToken.contract.Call(opts, out, "allowance", _owner, _spender) | |
return *ret0, err | |
} | |
// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. | |
// | |
// Solidity: function allowance(_owner address, _spender address) constant returns(uint256) | |
func (_MTTToken *MTTTokenSession) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) { | |
return _MTTToken.Contract.Allowance(&_MTTToken.CallOpts, _owner, _spender) | |
} | |
// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. | |
// | |
// Solidity: function allowance(_owner address, _spender address) constant returns(uint256) | |
func (_MTTToken *MTTTokenCallerSession) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) { | |
return _MTTToken.Contract.Allowance(&_MTTToken.CallOpts, _owner, _spender) | |
} | |
// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. | |
// | |
// Solidity: function balanceOf(_owner address) constant returns(uint256) | |
func (_MTTToken *MTTTokenCaller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) { | |
var ( | |
ret0 = new(*big.Int) | |
) | |
out := ret0 | |
err := _MTTToken.contract.Call(opts, out, "balanceOf", _owner) | |
return *ret0, err | |
} | |
// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. | |
// | |
// Solidity: function balanceOf(_owner address) constant returns(uint256) | |
func (_MTTToken *MTTTokenSession) BalanceOf(_owner common.Address) (*big.Int, error) { | |
return _MTTToken.Contract.BalanceOf(&_MTTToken.CallOpts, _owner) | |
} | |
// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. | |
// | |
// Solidity: function balanceOf(_owner address) constant returns(uint256) | |
func (_MTTToken *MTTTokenCallerSession) BalanceOf(_owner common.Address) (*big.Int, error) { | |
return _MTTToken.Contract.BalanceOf(&_MTTToken.CallOpts, _owner) | |
} | |
// Decimals is a free data retrieval call binding the contract method 0x313ce567. | |
// | |
// Solidity: function decimals() constant returns(uint8) | |
func (_MTTToken *MTTTokenCaller) Decimals(opts *bind.CallOpts) (uint8, error) { | |
var ( | |
ret0 = new(uint8) | |
) | |
out := ret0 | |
err := _MTTToken.contract.Call(opts, out, "decimals") | |
return *ret0, err | |
} | |
// Decimals is a free data retrieval call binding the contract method 0x313ce567. | |
// | |
// Solidity: function decimals() constant returns(uint8) | |
func (_MTTToken *MTTTokenSession) Decimals() (uint8, error) { | |
return _MTTToken.Contract.Decimals(&_MTTToken.CallOpts) | |
} | |
// Decimals is a free data retrieval call binding the contract method 0x313ce567. | |
// | |
// Solidity: function decimals() constant returns(uint8) | |
func (_MTTToken *MTTTokenCallerSession) Decimals() (uint8, error) { | |
return _MTTToken.Contract.Decimals(&_MTTToken.CallOpts) | |
} | |
// Name is a free data retrieval call binding the contract method 0x06fdde03. | |
// | |
// Solidity: function name() constant returns(string) | |
func (_MTTToken *MTTTokenCaller) Name(opts *bind.CallOpts) (string, error) { | |
var ( | |
ret0 = new(string) | |
) | |
out := ret0 | |
err := _MTTToken.contract.Call(opts, out, "name") | |
return *ret0, err | |
} | |
// Name is a free data retrieval call binding the contract method 0x06fdde03. | |
// | |
// Solidity: function name() constant returns(string) | |
func (_MTTToken *MTTTokenSession) Name() (string, error) { | |
return _MTTToken.Contract.Name(&_MTTToken.CallOpts) | |
} | |
// Name is a free data retrieval call binding the contract method 0x06fdde03. | |
// | |
// Solidity: function name() constant returns(string) | |
func (_MTTToken *MTTTokenCallerSession) Name() (string, error) { | |
return _MTTToken.Contract.Name(&_MTTToken.CallOpts) | |
} | |
// Symbol is a free data retrieval call binding the contract method 0x95d89b41. | |
// | |
// Solidity: function symbol() constant returns(string) | |
func (_MTTToken *MTTTokenCaller) Symbol(opts *bind.CallOpts) (string, error) { | |
var ( | |
ret0 = new(string) | |
) | |
out := ret0 | |
err := _MTTToken.contract.Call(opts, out, "symbol") | |
return *ret0, err | |
} | |
// Symbol is a free data retrieval call binding the contract method 0x95d89b41. | |
// | |
// Solidity: function symbol() constant returns(string) | |
func (_MTTToken *MTTTokenSession) Symbol() (string, error) { | |
return _MTTToken.Contract.Symbol(&_MTTToken.CallOpts) | |
} | |
// Symbol is a free data retrieval call binding the contract method 0x95d89b41. | |
// | |
// Solidity: function symbol() constant returns(string) | |
func (_MTTToken *MTTTokenCallerSession) Symbol() (string, error) { | |
return _MTTToken.Contract.Symbol(&_MTTToken.CallOpts) | |
} | |
// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. | |
// | |
// Solidity: function totalSupply() constant returns(uint256) | |
func (_MTTToken *MTTTokenCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { | |
var ( | |
ret0 = new(*big.Int) | |
) | |
out := ret0 | |
err := _MTTToken.contract.Call(opts, out, "totalSupply") | |
return *ret0, err | |
} | |
// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. | |
// | |
// Solidity: function totalSupply() constant returns(uint256) | |
func (_MTTToken *MTTTokenSession) TotalSupply() (*big.Int, error) { | |
return _MTTToken.Contract.TotalSupply(&_MTTToken.CallOpts) | |
} | |
// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. | |
// | |
// Solidity: function totalSupply() constant returns(uint256) | |
func (_MTTToken *MTTTokenCallerSession) TotalSupply() (*big.Int, error) { | |
return _MTTToken.Contract.TotalSupply(&_MTTToken.CallOpts) | |
} | |
// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. | |
// | |
// Solidity: function approve(_spender address, _value uint256) returns(bool) | |
func (_MTTToken *MTTTokenTransactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) { | |
return _MTTToken.contract.Transact(opts, "approve", _spender, _value) | |
} | |
// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. | |
// | |
// Solidity: function approve(_spender address, _value uint256) returns(bool) | |
func (_MTTToken *MTTTokenSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) { | |
return _MTTToken.Contract.Approve(&_MTTToken.TransactOpts, _spender, _value) | |
} | |
// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. | |
// | |
// Solidity: function approve(_spender address, _value uint256) returns(bool) | |
func (_MTTToken *MTTTokenTransactorSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) { | |
return _MTTToken.Contract.Approve(&_MTTToken.TransactOpts, _spender, _value) | |
} | |
// DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463. | |
// | |
// Solidity: function decreaseApproval(_spender address, _subtractedValue uint256) returns(bool) | |
func (_MTTToken *MTTTokenTransactor) DecreaseApproval(opts *bind.TransactOpts, _spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) { | |
return _MTTToken.contract.Transact(opts, "decreaseApproval", _spender, _subtractedValue) | |
} | |
// DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463. | |
// | |
// Solidity: function decreaseApproval(_spender address, _subtractedValue uint256) returns(bool) | |
func (_MTTToken *MTTTokenSession) DecreaseApproval(_spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) { | |
return _MTTToken.Contract.DecreaseApproval(&_MTTToken.TransactOpts, _spender, _subtractedValue) | |
} | |
// DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463. | |
// | |
// Solidity: function decreaseApproval(_spender address, _subtractedValue uint256) returns(bool) | |
func (_MTTToken *MTTTokenTransactorSession) DecreaseApproval(_spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) { | |
return _MTTToken.Contract.DecreaseApproval(&_MTTToken.TransactOpts, _spender, _subtractedValue) | |
} | |
// IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623. | |
// | |
// Solidity: function increaseApproval(_spender address, _addedValue uint256) returns(bool) | |
func (_MTTToken *MTTTokenTransactor) IncreaseApproval(opts *bind.TransactOpts, _spender common.Address, _addedValue *big.Int) (*types.Transaction, error) { | |
return _MTTToken.contract.Transact(opts, "increaseApproval", _spender, _addedValue) | |
} | |
// IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623. | |
// | |
// Solidity: function increaseApproval(_spender address, _addedValue uint256) returns(bool) | |
func (_MTTToken *MTTTokenSession) IncreaseApproval(_spender common.Address, _addedValue *big.Int) (*types.Transaction, error) { | |
return _MTTToken.Contract.IncreaseApproval(&_MTTToken.TransactOpts, _spender, _addedValue) | |
} | |
// IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623. | |
// | |
// Solidity: function increaseApproval(_spender address, _addedValue uint256) returns(bool) | |
func (_MTTToken *MTTTokenTransactorSession) IncreaseApproval(_spender common.Address, _addedValue *big.Int) (*types.Transaction, error) { | |
return _MTTToken.Contract.IncreaseApproval(&_MTTToken.TransactOpts, _spender, _addedValue) | |
} | |
// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. | |
// | |
// Solidity: function transfer(_to address, _value uint256) returns(bool) | |
func (_MTTToken *MTTTokenTransactor) Transfer(opts *bind.TransactOpts, _to common.Address, _value *big.Int) (*types.Transaction, error) { | |
return _MTTToken.contract.Transact(opts, "transfer", _to, _value) | |
} | |
// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. | |
// | |
// Solidity: function transfer(_to address, _value uint256) returns(bool) | |
func (_MTTToken *MTTTokenSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { | |
return _MTTToken.Contract.Transfer(&_MTTToken.TransactOpts, _to, _value) | |
} | |
// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. | |
// | |
// Solidity: function transfer(_to address, _value uint256) returns(bool) | |
func (_MTTToken *MTTTokenTransactorSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { | |
return _MTTToken.Contract.Transfer(&_MTTToken.TransactOpts, _to, _value) | |
} | |
// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. | |
// | |
// Solidity: function transferFrom(_from address, _to address, _value uint256) returns(bool) | |
func (_MTTToken *MTTTokenTransactor) TransferFrom(opts *bind.TransactOpts, _from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { | |
return _MTTToken.contract.Transact(opts, "transferFrom", _from, _to, _value) | |
} | |
// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. | |
// | |
// Solidity: function transferFrom(_from address, _to address, _value uint256) returns(bool) | |
func (_MTTToken *MTTTokenSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { | |
return _MTTToken.Contract.TransferFrom(&_MTTToken.TransactOpts, _from, _to, _value) | |
} | |
// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. | |
// | |
// Solidity: function transferFrom(_from address, _to address, _value uint256) returns(bool) | |
func (_MTTToken *MTTTokenTransactorSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { | |
return _MTTToken.Contract.TransferFrom(&_MTTToken.TransactOpts, _from, _to, _value) | |
} | |
// MTTTokenApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the MTTToken contract. | |
type MTTTokenApprovalIterator struct { | |
Event *MTTTokenApproval // 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 *MTTTokenApprovalIterator) 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(MTTTokenApproval) | |
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(MTTTokenApproval) | |
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 *MTTTokenApprovalIterator) Error() error { | |
return it.fail | |
} | |
// Close terminates the iteration process, releasing any pending underlying | |
// resources. | |
func (it *MTTTokenApprovalIterator) Close() error { | |
it.sub.Unsubscribe() | |
return nil | |
} | |
// MTTTokenApproval represents a Approval event raised by the MTTToken contract. | |
type MTTTokenApproval 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: e Approval(owner indexed address, spender indexed address, value uint256) | |
func (_MTTToken *MTTTokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*MTTTokenApprovalIterator, 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 := _MTTToken.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) | |
if err != nil { | |
return nil, err | |
} | |
return &MTTTokenApprovalIterator{contract: _MTTToken.contract, event: "Approval", logs: logs, sub: sub}, nil | |
} | |
// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. | |
// | |
// Solidity: e Approval(owner indexed address, spender indexed address, value uint256) | |
func (_MTTToken *MTTTokenFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *MTTTokenApproval, 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 := _MTTToken.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(MTTTokenApproval) | |
if err := _MTTToken.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 | |
} | |
// MTTTokenTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the MTTToken contract. | |
type MTTTokenTransferIterator struct { | |
Event *MTTTokenTransfer // 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 *MTTTokenTransferIterator) 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(MTTTokenTransfer) | |
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(MTTTokenTransfer) | |
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 *MTTTokenTransferIterator) Error() error { | |
return it.fail | |
} | |
// Close terminates the iteration process, releasing any pending underlying | |
// resources. | |
func (it *MTTTokenTransferIterator) Close() error { | |
it.sub.Unsubscribe() | |
return nil | |
} | |
// MTTTokenTransfer represents a Transfer event raised by the MTTToken contract. | |
type MTTTokenTransfer 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: e Transfer(from indexed address, to indexed address, value uint256) | |
func (_MTTToken *MTTTokenFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MTTTokenTransferIterator, 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 := _MTTToken.contract.FilterLogs(opts, "Transfer", fromRule, toRule) | |
if err != nil { | |
return nil, err | |
} | |
return &MTTTokenTransferIterator{contract: _MTTToken.contract, event: "Transfer", logs: logs, sub: sub}, nil | |
} | |
// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. | |
// | |
// Solidity: e Transfer(from indexed address, to indexed address, value uint256) | |
func (_MTTToken *MTTTokenFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *MTTTokenTransfer, 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 := _MTTToken.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(MTTTokenTransfer) | |
if err := _MTTToken.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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment