-
-
Save karalabe/c22aab73194ba7da834ab5b379621031 to your computer and use it in GitHub Desktop.
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
// This file is an automatically generated Go binding. Do not modify as any | |
// change will likely be lost upon the next re-generation! | |
package main | |
import ( | |
"math/big" | |
"strings" | |
"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" | |
) | |
// MyTokenABI is the input ABI used to generate the binding from. | |
const MyTokenABI = `[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"},{"name":"_extraData","type":"bytes"}],"name":"approveAndCall","outputs":[{"name":"success","type":"bool"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"spentAllowance","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"inputs":[{"name":"initialSupply","type":"uint256"},{"name":"tokenName","type":"string"},{"name":"decimalUnits","type":"uint8"},{"name":"tokenSymbol","type":"string"}],"type":"constructor"},{"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"}]` | |
// MyTokenBin is the compiled bytecode used for deploying new contracts. | |
const MyTokenBin = `0x60606040526040516107fd3803806107fd83398101604052805160805160a05160c051929391820192909101600160a060020a0333166000908152600360209081526040822086905581548551838052601f6002600019610100600186161502019093169290920482018390047f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56390810193919290918801908390106100e857805160ff19168380011785555b506101189291505b8082111561017157600081556001016100b4565b50506002805460ff19168317905550505050610658806101a56000396000f35b828001600101855582156100ac579182015b828111156100ac5782518260005055916020019190600101906100fa565b50508060016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061017557805160ff19168380011785555b506100c89291506100b4565b5090565b82800160010185558215610165579182015b8281111561016557825182600050559160200191906001019061018756606060405236156100775760e060020a600035046306fdde03811461007f57806323b872dd146100dc578063313ce5671461010e57806370a082311461011a57806395d89b4114610132578063a9059cbb1461018e578063cae9ca51146101bd578063dc3080f21461031c578063dd62ed3e14610341575b610365610002565b61036760008054602060026001831615610100026000190190921691909104601f8101829004909102608090810160405260608281529291908282801561041c5780601f106103f15761010080835404028352916020019161041c565b6103d5600435602435604435600160a060020a038316600090815260036020526040812054829010156104f357610002565b6103e760025460ff1681565b6103d560043560036020526000908152604090205481565b610367600180546020600282841615610100026000190190921691909104601f8101829004909102608090810160405260608281529291908282801561041c5780601f106103f15761010080835404028352916020019161041c565b610365600435602435600160a060020a0333166000908152600360205260409020548190101561042457610002565b60806020604435600481810135601f8101849004909302840160405260608381526103d5948235946024803595606494939101919081908382808284375094965050505050505060006000836004600050600033600160a060020a03168152602001908152602001600020600050600087600160a060020a031681526020019081526020016000206000508190555084905080600160a060020a0316638f4ffcb1338630876040518560e060020a0281526004018085600160a060020a0316815260200184815260200183600160a060020a03168152602001806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156102f25780820380516001836020036101000a031916815260200191505b50955050505050506000604051808303816000876161da5a03f11561000257505050509392505050565b6005602090815260043560009081526040808220909252602435815220546103d59081565b60046020818152903560009081526040808220909252602435815220546103d59081565b005b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600f02600301f150905090810190601f1680156103c75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60408051918252519081900360200190f35b6060908152602090f35b820191906000526020600020905b8154815290600101906020018083116103ff57829003601f168201915b505050505081565b600160a060020a03821660009081526040902054808201101561044657610002565b806003600050600033600160a060020a03168152602001908152602001600020600082828250540392505081905550806003600050600084600160a060020a0316815260200190815260200160002060008282825054019250508190555081600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600160a060020a03831681526040812054808301101561051257610002565b600160a060020a0380851680835260046020908152604080852033949094168086529382528085205492855260058252808520938552929052908220548301111561055c57610002565b816003600050600086600160a060020a03168152602001908152602001600020600082828250540392505081905550816003600050600085600160a060020a03168152602001908152602001600020600082828250540192505081905550816005600050600086600160a060020a03168152602001908152602001600020600050600033600160a060020a0316815260200190815260200160002060008282825054019250508190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3939250505056` | |
// DeployMyToken deploys a new Ethereum contract, binding an instance of MyToken to it. | |
func DeployMyToken(auth *bind.TransactOpts, backend bind.ContractBackend, initialSupply *big.Int, tokenName string, decimalUnits uint8, tokenSymbol string) (common.Address, *types.Transaction, *MyToken, error) { | |
parsed, err := abi.JSON(strings.NewReader(MyTokenABI)) | |
if err != nil { | |
return common.Address{}, nil, nil, err | |
} | |
address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(MyTokenBin), backend, initialSupply, tokenName, decimalUnits, tokenSymbol) | |
if err != nil { | |
return common.Address{}, nil, nil, err | |
} | |
return address, tx, &MyToken{MyTokenCaller: MyTokenCaller{contract: contract}, MyTokenTransactor: MyTokenTransactor{contract: contract}}, nil | |
} | |
// MyToken is an auto generated Go binding around an Ethereum contract. | |
type MyToken struct { | |
MyTokenCaller // Read-only binding to the contract | |
MyTokenTransactor // Write-only binding to the contract | |
} | |
// MyTokenCaller is an auto generated read-only Go binding around an Ethereum contract. | |
type MyTokenCaller struct { | |
contract *bind.BoundContract // Generic contract wrapper for the low level calls | |
} | |
// MyTokenTransactor is an auto generated write-only Go binding around an Ethereum contract. | |
type MyTokenTransactor struct { | |
contract *bind.BoundContract // Generic contract wrapper for the low level calls | |
} | |
// MyTokenSession is an auto generated Go binding around an Ethereum contract, | |
// with pre-set call and transact options. | |
type MyTokenSession struct { | |
Contract *MyToken // 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 | |
} | |
// MyTokenCallerSession is an auto generated read-only Go binding around an Ethereum contract, | |
// with pre-set call options. | |
type MyTokenCallerSession struct { | |
Contract *MyTokenCaller // Generic contract caller binding to set the session for | |
CallOpts bind.CallOpts // Call options to use throughout this session | |
} | |
// MyTokenTransactorSession is an auto generated write-only Go binding around an Ethereum contract, | |
// with pre-set transact options. | |
type MyTokenTransactorSession struct { | |
Contract *MyTokenTransactor // Generic contract transactor binding to set the session for | |
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session | |
} | |
// MyTokenRaw is an auto generated low-level Go binding around an Ethereum contract. | |
type MyTokenRaw struct { | |
Contract *MyToken // Generic contract binding to access the raw methods on | |
} | |
// MyTokenCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. | |
type MyTokenCallerRaw struct { | |
Contract *MyTokenCaller // Generic read-only contract binding to access the raw methods on | |
} | |
// MyTokenTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. | |
type MyTokenTransactorRaw struct { | |
Contract *MyTokenTransactor // Generic write-only contract binding to access the raw methods on | |
} | |
// NewMyToken creates a new instance of MyToken, bound to a specific deployed contract. | |
func NewMyToken(address common.Address, backend bind.ContractBackend) (*MyToken, error) { | |
contract, err := bindMyToken(address, backend.(bind.ContractCaller), backend.(bind.ContractTransactor)) | |
if err != nil { | |
return nil, err | |
} | |
return &MyToken{MyTokenCaller: MyTokenCaller{contract: contract}, MyTokenTransactor: MyTokenTransactor{contract: contract}}, nil | |
} | |
// NewMyTokenCaller creates a new read-only instance of MyToken, bound to a specific deployed contract. | |
func NewMyTokenCaller(address common.Address, caller bind.ContractCaller) (*MyTokenCaller, error) { | |
contract, err := bindMyToken(address, caller, nil) | |
if err != nil { | |
return nil, err | |
} | |
return &MyTokenCaller{contract: contract}, nil | |
} | |
// NewMyTokenTransactor creates a new write-only instance of MyToken, bound to a specific deployed contract. | |
func NewMyTokenTransactor(address common.Address, transactor bind.ContractTransactor) (*MyTokenTransactor, error) { | |
contract, err := bindMyToken(address, nil, transactor) | |
if err != nil { | |
return nil, err | |
} | |
return &MyTokenTransactor{contract: contract}, nil | |
} | |
// bindMyToken binds a generic wrapper to an already deployed contract. | |
func bindMyToken(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor) (*bind.BoundContract, error) { | |
parsed, err := abi.JSON(strings.NewReader(MyTokenABI)) | |
if err != nil { | |
return nil, err | |
} | |
return bind.NewBoundContract(address, parsed, caller, transactor), 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 (_MyToken *MyTokenRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { | |
return _MyToken.Contract.MyTokenCaller.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 (_MyToken *MyTokenRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { | |
return _MyToken.Contract.MyTokenTransactor.contract.Transfer(opts) | |
} | |
// Transact invokes the (paid) contract method with params as input values. | |
func (_MyToken *MyTokenRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { | |
return _MyToken.Contract.MyTokenTransactor.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 (_MyToken *MyTokenCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { | |
return _MyToken.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 (_MyToken *MyTokenTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { | |
return _MyToken.Contract.contract.Transfer(opts) | |
} | |
// Transact invokes the (paid) contract method with params as input values. | |
func (_MyToken *MyTokenTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { | |
return _MyToken.Contract.contract.Transact(opts, method, params...) | |
} | |
// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. | |
// | |
// Solidity: function allowance( address, address) constant returns(uint256) | |
func (_MyToken *MyTokenCaller) Allowance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { | |
var ( | |
ret0 = new(*big.Int) | |
) | |
out := ret0 | |
err := _MyToken.contract.Call(opts, out, "allowance", arg0, arg1) | |
return *ret0, err | |
} | |
// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. | |
// | |
// Solidity: function allowance( address, address) constant returns(uint256) | |
func (_MyToken *MyTokenSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { | |
return _MyToken.Contract.Allowance(&_MyToken.CallOpts, arg0, arg1) | |
} | |
// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. | |
// | |
// Solidity: function allowance( address, address) constant returns(uint256) | |
func (_MyToken *MyTokenCallerSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { | |
return _MyToken.Contract.Allowance(&_MyToken.CallOpts, arg0, arg1) | |
} | |
// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. | |
// | |
// Solidity: function balanceOf( address) constant returns(uint256) | |
func (_MyToken *MyTokenCaller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { | |
var ( | |
ret0 = new(*big.Int) | |
) | |
out := ret0 | |
err := _MyToken.contract.Call(opts, out, "balanceOf", arg0) | |
return *ret0, err | |
} | |
// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. | |
// | |
// Solidity: function balanceOf( address) constant returns(uint256) | |
func (_MyToken *MyTokenSession) BalanceOf(arg0 common.Address) (*big.Int, error) { | |
return _MyToken.Contract.BalanceOf(&_MyToken.CallOpts, arg0) | |
} | |
// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. | |
// | |
// Solidity: function balanceOf( address) constant returns(uint256) | |
func (_MyToken *MyTokenCallerSession) BalanceOf(arg0 common.Address) (*big.Int, error) { | |
return _MyToken.Contract.BalanceOf(&_MyToken.CallOpts, arg0) | |
} | |
// Decimals is a free data retrieval call binding the contract method 0x313ce567. | |
// | |
// Solidity: function decimals() constant returns(uint8) | |
func (_MyToken *MyTokenCaller) Decimals(opts *bind.CallOpts) (uint8, error) { | |
var ( | |
ret0 = new(uint8) | |
) | |
out := ret0 | |
err := _MyToken.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 (_MyToken *MyTokenSession) Decimals() (uint8, error) { | |
return _MyToken.Contract.Decimals(&_MyToken.CallOpts) | |
} | |
// Decimals is a free data retrieval call binding the contract method 0x313ce567. | |
// | |
// Solidity: function decimals() constant returns(uint8) | |
func (_MyToken *MyTokenCallerSession) Decimals() (uint8, error) { | |
return _MyToken.Contract.Decimals(&_MyToken.CallOpts) | |
} | |
// Name is a free data retrieval call binding the contract method 0x06fdde03. | |
// | |
// Solidity: function name() constant returns(string) | |
func (_MyToken *MyTokenCaller) Name(opts *bind.CallOpts) (string, error) { | |
var ( | |
ret0 = new(string) | |
) | |
out := ret0 | |
err := _MyToken.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 (_MyToken *MyTokenSession) Name() (string, error) { | |
return _MyToken.Contract.Name(&_MyToken.CallOpts) | |
} | |
// Name is a free data retrieval call binding the contract method 0x06fdde03. | |
// | |
// Solidity: function name() constant returns(string) | |
func (_MyToken *MyTokenCallerSession) Name() (string, error) { | |
return _MyToken.Contract.Name(&_MyToken.CallOpts) | |
} | |
// SpentAllowance is a free data retrieval call binding the contract method 0xdc3080f2. | |
// | |
// Solidity: function spentAllowance( address, address) constant returns(uint256) | |
func (_MyToken *MyTokenCaller) SpentAllowance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { | |
var ( | |
ret0 = new(*big.Int) | |
) | |
out := ret0 | |
err := _MyToken.contract.Call(opts, out, "spentAllowance", arg0, arg1) | |
return *ret0, err | |
} | |
// SpentAllowance is a free data retrieval call binding the contract method 0xdc3080f2. | |
// | |
// Solidity: function spentAllowance( address, address) constant returns(uint256) | |
func (_MyToken *MyTokenSession) SpentAllowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { | |
return _MyToken.Contract.SpentAllowance(&_MyToken.CallOpts, arg0, arg1) | |
} | |
// SpentAllowance is a free data retrieval call binding the contract method 0xdc3080f2. | |
// | |
// Solidity: function spentAllowance( address, address) constant returns(uint256) | |
func (_MyToken *MyTokenCallerSession) SpentAllowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { | |
return _MyToken.Contract.SpentAllowance(&_MyToken.CallOpts, arg0, arg1) | |
} | |
// Symbol is a free data retrieval call binding the contract method 0x95d89b41. | |
// | |
// Solidity: function symbol() constant returns(string) | |
func (_MyToken *MyTokenCaller) Symbol(opts *bind.CallOpts) (string, error) { | |
var ( | |
ret0 = new(string) | |
) | |
out := ret0 | |
err := _MyToken.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 (_MyToken *MyTokenSession) Symbol() (string, error) { | |
return _MyToken.Contract.Symbol(&_MyToken.CallOpts) | |
} | |
// Symbol is a free data retrieval call binding the contract method 0x95d89b41. | |
// | |
// Solidity: function symbol() constant returns(string) | |
func (_MyToken *MyTokenCallerSession) Symbol() (string, error) { | |
return _MyToken.Contract.Symbol(&_MyToken.CallOpts) | |
} | |
// ApproveAndCall is a paid mutator transaction binding the contract method 0xcae9ca51. | |
// | |
// Solidity: function approveAndCall(_spender address, _value uint256, _extraData bytes) returns(success bool) | |
func (_MyToken *MyTokenTransactor) ApproveAndCall(opts *bind.TransactOpts, _spender common.Address, _value *big.Int, _extraData []byte) (*types.Transaction, error) { | |
return _MyToken.contract.Transact(opts, "approveAndCall", _spender, _value, _extraData) | |
} | |
// ApproveAndCall is a paid mutator transaction binding the contract method 0xcae9ca51. | |
// | |
// Solidity: function approveAndCall(_spender address, _value uint256, _extraData bytes) returns(success bool) | |
func (_MyToken *MyTokenSession) ApproveAndCall(_spender common.Address, _value *big.Int, _extraData []byte) (*types.Transaction, error) { | |
return _MyToken.Contract.ApproveAndCall(&_MyToken.TransactOpts, _spender, _value, _extraData) | |
} | |
// ApproveAndCall is a paid mutator transaction binding the contract method 0xcae9ca51. | |
// | |
// Solidity: function approveAndCall(_spender address, _value uint256, _extraData bytes) returns(success bool) | |
func (_MyToken *MyTokenTransactorSession) ApproveAndCall(_spender common.Address, _value *big.Int, _extraData []byte) (*types.Transaction, error) { | |
return _MyToken.Contract.ApproveAndCall(&_MyToken.TransactOpts, _spender, _value, _extraData) | |
} | |
// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. | |
// | |
// Solidity: function transfer(_to address, _value uint256) returns() | |
func (_MyToken *MyTokenTransactor) Transfer(opts *bind.TransactOpts, _to common.Address, _value *big.Int) (*types.Transaction, error) { | |
return _MyToken.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() | |
func (_MyToken *MyTokenSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { | |
return _MyToken.Contract.Transfer(&_MyToken.TransactOpts, _to, _value) | |
} | |
// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. | |
// | |
// Solidity: function transfer(_to address, _value uint256) returns() | |
func (_MyToken *MyTokenTransactorSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { | |
return _MyToken.Contract.Transfer(&_MyToken.TransactOpts, _to, _value) | |
} | |
// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. | |
// | |
// Solidity: function transferFrom(_from address, _to address, _value uint256) returns(success bool) | |
func (_MyToken *MyTokenTransactor) TransferFrom(opts *bind.TransactOpts, _from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { | |
return _MyToken.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(success bool) | |
func (_MyToken *MyTokenSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { | |
return _MyToken.Contract.TransferFrom(&_MyToken.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(success bool) | |
func (_MyToken *MyTokenTransactorSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { | |
return _MyToken.Contract.TransferFrom(&_MyToken.TransactOpts, _from, _to, _value) | |
} | |
// TokenRecipientABI is the input ABI used to generate the binding from. | |
const TokenRecipientABI = `[{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_value","type":"uint256"},{"name":"_token","type":"address"},{"name":"_extraData","type":"bytes"}],"name":"receiveApproval","outputs":[],"type":"function"}]` | |
// TokenRecipientBin is the compiled bytecode used for deploying new contracts. | |
const TokenRecipientBin = `0x` | |
// DeployTokenRecipient deploys a new Ethereum contract, binding an instance of TokenRecipient to it. | |
func DeployTokenRecipient(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *TokenRecipient, error) { | |
parsed, err := abi.JSON(strings.NewReader(TokenRecipientABI)) | |
if err != nil { | |
return common.Address{}, nil, nil, err | |
} | |
address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(TokenRecipientBin), backend) | |
if err != nil { | |
return common.Address{}, nil, nil, err | |
} | |
return address, tx, &TokenRecipient{TokenRecipientCaller: TokenRecipientCaller{contract: contract}, TokenRecipientTransactor: TokenRecipientTransactor{contract: contract}}, nil | |
} | |
// TokenRecipient is an auto generated Go binding around an Ethereum contract. | |
type TokenRecipient struct { | |
TokenRecipientCaller // Read-only binding to the contract | |
TokenRecipientTransactor // Write-only binding to the contract | |
} | |
// TokenRecipientCaller is an auto generated read-only Go binding around an Ethereum contract. | |
type TokenRecipientCaller struct { | |
contract *bind.BoundContract // Generic contract wrapper for the low level calls | |
} | |
// TokenRecipientTransactor is an auto generated write-only Go binding around an Ethereum contract. | |
type TokenRecipientTransactor struct { | |
contract *bind.BoundContract // Generic contract wrapper for the low level calls | |
} | |
// TokenRecipientSession is an auto generated Go binding around an Ethereum contract, | |
// with pre-set call and transact options. | |
type TokenRecipientSession struct { | |
Contract *TokenRecipient // 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 | |
} | |
// TokenRecipientCallerSession is an auto generated read-only Go binding around an Ethereum contract, | |
// with pre-set call options. | |
type TokenRecipientCallerSession struct { | |
Contract *TokenRecipientCaller // Generic contract caller binding to set the session for | |
CallOpts bind.CallOpts // Call options to use throughout this session | |
} | |
// TokenRecipientTransactorSession is an auto generated write-only Go binding around an Ethereum contract, | |
// with pre-set transact options. | |
type TokenRecipientTransactorSession struct { | |
Contract *TokenRecipientTransactor // Generic contract transactor binding to set the session for | |
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session | |
} | |
// TokenRecipientRaw is an auto generated low-level Go binding around an Ethereum contract. | |
type TokenRecipientRaw struct { | |
Contract *TokenRecipient // Generic contract binding to access the raw methods on | |
} | |
// TokenRecipientCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. | |
type TokenRecipientCallerRaw struct { | |
Contract *TokenRecipientCaller // Generic read-only contract binding to access the raw methods on | |
} | |
// TokenRecipientTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. | |
type TokenRecipientTransactorRaw struct { | |
Contract *TokenRecipientTransactor // Generic write-only contract binding to access the raw methods on | |
} | |
// NewTokenRecipient creates a new instance of TokenRecipient, bound to a specific deployed contract. | |
func NewTokenRecipient(address common.Address, backend bind.ContractBackend) (*TokenRecipient, error) { | |
contract, err := bindTokenRecipient(address, backend.(bind.ContractCaller), backend.(bind.ContractTransactor)) | |
if err != nil { | |
return nil, err | |
} | |
return &TokenRecipient{TokenRecipientCaller: TokenRecipientCaller{contract: contract}, TokenRecipientTransactor: TokenRecipientTransactor{contract: contract}}, nil | |
} | |
// NewTokenRecipientCaller creates a new read-only instance of TokenRecipient, bound to a specific deployed contract. | |
func NewTokenRecipientCaller(address common.Address, caller bind.ContractCaller) (*TokenRecipientCaller, error) { | |
contract, err := bindTokenRecipient(address, caller, nil) | |
if err != nil { | |
return nil, err | |
} | |
return &TokenRecipientCaller{contract: contract}, nil | |
} | |
// NewTokenRecipientTransactor creates a new write-only instance of TokenRecipient, bound to a specific deployed contract. | |
func NewTokenRecipientTransactor(address common.Address, transactor bind.ContractTransactor) (*TokenRecipientTransactor, error) { | |
contract, err := bindTokenRecipient(address, nil, transactor) | |
if err != nil { | |
return nil, err | |
} | |
return &TokenRecipientTransactor{contract: contract}, nil | |
} | |
// bindTokenRecipient binds a generic wrapper to an already deployed contract. | |
func bindTokenRecipient(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor) (*bind.BoundContract, error) { | |
parsed, err := abi.JSON(strings.NewReader(TokenRecipientABI)) | |
if err != nil { | |
return nil, err | |
} | |
return bind.NewBoundContract(address, parsed, caller, transactor), 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 (_TokenRecipient *TokenRecipientRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { | |
return _TokenRecipient.Contract.TokenRecipientCaller.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 (_TokenRecipient *TokenRecipientRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { | |
return _TokenRecipient.Contract.TokenRecipientTransactor.contract.Transfer(opts) | |
} | |
// Transact invokes the (paid) contract method with params as input values. | |
func (_TokenRecipient *TokenRecipientRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { | |
return _TokenRecipient.Contract.TokenRecipientTransactor.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 (_TokenRecipient *TokenRecipientCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { | |
return _TokenRecipient.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 (_TokenRecipient *TokenRecipientTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { | |
return _TokenRecipient.Contract.contract.Transfer(opts) | |
} | |
// Transact invokes the (paid) contract method with params as input values. | |
func (_TokenRecipient *TokenRecipientTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { | |
return _TokenRecipient.Contract.contract.Transact(opts, method, params...) | |
} | |
// ReceiveApproval is a paid mutator transaction binding the contract method 0x8f4ffcb1. | |
// | |
// Solidity: function receiveApproval(_from address, _value uint256, _token address, _extraData bytes) returns() | |
func (_TokenRecipient *TokenRecipientTransactor) ReceiveApproval(opts *bind.TransactOpts, _from common.Address, _value *big.Int, _token common.Address, _extraData []byte) (*types.Transaction, error) { | |
return _TokenRecipient.contract.Transact(opts, "receiveApproval", _from, _value, _token, _extraData) | |
} | |
// ReceiveApproval is a paid mutator transaction binding the contract method 0x8f4ffcb1. | |
// | |
// Solidity: function receiveApproval(_from address, _value uint256, _token address, _extraData bytes) returns() | |
func (_TokenRecipient *TokenRecipientSession) ReceiveApproval(_from common.Address, _value *big.Int, _token common.Address, _extraData []byte) (*types.Transaction, error) { | |
return _TokenRecipient.Contract.ReceiveApproval(&_TokenRecipient.TransactOpts, _from, _value, _token, _extraData) | |
} | |
// ReceiveApproval is a paid mutator transaction binding the contract method 0x8f4ffcb1. | |
// | |
// Solidity: function receiveApproval(_from address, _value uint256, _token address, _extraData bytes) returns() | |
func (_TokenRecipient *TokenRecipientTransactorSession) ReceiveApproval(_from common.Address, _value *big.Int, _token common.Address, _extraData []byte) (*types.Transaction, error) { | |
return _TokenRecipient.Contract.ReceiveApproval(&_TokenRecipient.TransactOpts, _from, _value, _token, _extraData) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment