// Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package ditToken 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 _ = abi.U256 _ = bind.Bind _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription ) // ERC20ABI is the input ABI used to generate the binding from. const ERC20ABI = "[{\"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\":\"_who\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"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\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Mint\",\"type\":\"event\"}]" // ERC20Bin is the compiled bytecode used for deploying new contracts. const ERC20Bin = `0x` // DeployERC20 deploys a new Ethereum contract, binding an instance of ERC20 to it. func DeployERC20(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ERC20, error) { parsed, err := abi.JSON(strings.NewReader(ERC20ABI)) if err != nil { return common.Address{}, nil, nil, err } address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ERC20Bin), backend) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &ERC20{ERC20Caller: ERC20Caller{contract: contract}, ERC20Transactor: ERC20Transactor{contract: contract}, ERC20Filterer: ERC20Filterer{contract: contract}}, nil } // ERC20 is an auto generated Go binding around an Ethereum contract. type ERC20 struct { ERC20Caller // Read-only binding to the contract ERC20Transactor // Write-only binding to the contract ERC20Filterer // Log filterer for contract events } // ERC20Caller is an auto generated read-only Go binding around an Ethereum contract. type ERC20Caller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ERC20Transactor is an auto generated write-only Go binding around an Ethereum contract. type ERC20Transactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ERC20Filterer is an auto generated log filtering Go binding around an Ethereum contract events. type ERC20Filterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // ERC20Session is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type ERC20Session struct { Contract *ERC20 // 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 } // ERC20CallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type ERC20CallerSession struct { Contract *ERC20Caller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // ERC20TransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type ERC20TransactorSession struct { Contract *ERC20Transactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // ERC20Raw is an auto generated low-level Go binding around an Ethereum contract. type ERC20Raw struct { Contract *ERC20 // Generic contract binding to access the raw methods on } // ERC20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type ERC20CallerRaw struct { Contract *ERC20Caller // Generic read-only contract binding to access the raw methods on } // ERC20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type ERC20TransactorRaw struct { Contract *ERC20Transactor // Generic write-only contract binding to access the raw methods on } // NewERC20 creates a new instance of ERC20, bound to a specific deployed contract. func NewERC20(address common.Address, backend bind.ContractBackend) (*ERC20, error) { contract, err := bindERC20(address, backend, backend, backend) if err != nil { return nil, err } return &ERC20{ERC20Caller: ERC20Caller{contract: contract}, ERC20Transactor: ERC20Transactor{contract: contract}, ERC20Filterer: ERC20Filterer{contract: contract}}, nil } // NewERC20Caller creates a new read-only instance of ERC20, bound to a specific deployed contract. func NewERC20Caller(address common.Address, caller bind.ContractCaller) (*ERC20Caller, error) { contract, err := bindERC20(address, caller, nil, nil) if err != nil { return nil, err } return &ERC20Caller{contract: contract}, nil } // NewERC20Transactor creates a new write-only instance of ERC20, bound to a specific deployed contract. func NewERC20Transactor(address common.Address, transactor bind.ContractTransactor) (*ERC20Transactor, error) { contract, err := bindERC20(address, nil, transactor, nil) if err != nil { return nil, err } return &ERC20Transactor{contract: contract}, nil } // NewERC20Filterer creates a new log filterer instance of ERC20, bound to a specific deployed contract. func NewERC20Filterer(address common.Address, filterer bind.ContractFilterer) (*ERC20Filterer, error) { contract, err := bindERC20(address, nil, nil, filterer) if err != nil { return nil, err } return &ERC20Filterer{contract: contract}, nil } // bindERC20 binds a generic wrapper to an already deployed contract. func bindERC20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := abi.JSON(strings.NewReader(ERC20ABI)) 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 (_ERC20 *ERC20Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { return _ERC20.Contract.ERC20Caller.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 (_ERC20 *ERC20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _ERC20.Contract.ERC20Transactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_ERC20 *ERC20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _ERC20.Contract.ERC20Transactor.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 (_ERC20 *ERC20CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { return _ERC20.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 (_ERC20 *ERC20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _ERC20.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_ERC20 *ERC20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _ERC20.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) constant returns(uint256) func (_ERC20 *ERC20Caller) Allowance(opts *bind.CallOpts, _owner common.Address, _spender common.Address) (*big.Int, error) { var ( ret0 = new(*big.Int) ) out := ret0 err := _ERC20.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(address _owner, address _spender) constant returns(uint256) func (_ERC20 *ERC20Session) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) { return _ERC20.Contract.Allowance(&_ERC20.CallOpts, _owner, _spender) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address _owner, address _spender) constant returns(uint256) func (_ERC20 *ERC20CallerSession) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) { return _ERC20.Contract.Allowance(&_ERC20.CallOpts, _owner, _spender) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address _who) constant returns(uint256) func (_ERC20 *ERC20Caller) BalanceOf(opts *bind.CallOpts, _who common.Address) (*big.Int, error) { var ( ret0 = new(*big.Int) ) out := ret0 err := _ERC20.contract.Call(opts, out, "balanceOf", _who) return *ret0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address _who) constant returns(uint256) func (_ERC20 *ERC20Session) BalanceOf(_who common.Address) (*big.Int, error) { return _ERC20.Contract.BalanceOf(&_ERC20.CallOpts, _who) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address _who) constant returns(uint256) func (_ERC20 *ERC20CallerSession) BalanceOf(_who common.Address) (*big.Int, error) { return _ERC20.Contract.BalanceOf(&_ERC20.CallOpts, _who) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() constant returns(uint256) func (_ERC20 *ERC20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var ( ret0 = new(*big.Int) ) out := ret0 err := _ERC20.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 (_ERC20 *ERC20Session) TotalSupply() (*big.Int, error) { return _ERC20.Contract.TotalSupply(&_ERC20.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() constant returns(uint256) func (_ERC20 *ERC20CallerSession) TotalSupply() (*big.Int, error) { return _ERC20.Contract.TotalSupply(&_ERC20.CallOpts) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address _spender, uint256 _value) returns(bool) func (_ERC20 *ERC20Transactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) { return _ERC20.contract.Transact(opts, "approve", _spender, _value) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address _spender, uint256 _value) returns(bool) func (_ERC20 *ERC20Session) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) { return _ERC20.Contract.Approve(&_ERC20.TransactOpts, _spender, _value) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address _spender, uint256 _value) returns(bool) func (_ERC20 *ERC20TransactorSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) { return _ERC20.Contract.Approve(&_ERC20.TransactOpts, _spender, _value) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address _to, uint256 _value) returns(bool) func (_ERC20 *ERC20Transactor) Transfer(opts *bind.TransactOpts, _to common.Address, _value *big.Int) (*types.Transaction, error) { return _ERC20.contract.Transact(opts, "transfer", _to, _value) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address _to, uint256 _value) returns(bool) func (_ERC20 *ERC20Session) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { return _ERC20.Contract.Transfer(&_ERC20.TransactOpts, _to, _value) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address _to, uint256 _value) returns(bool) func (_ERC20 *ERC20TransactorSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { return _ERC20.Contract.Transfer(&_ERC20.TransactOpts, _to, _value) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) func (_ERC20 *ERC20Transactor) TransferFrom(opts *bind.TransactOpts, _from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { return _ERC20.contract.Transact(opts, "transferFrom", _from, _to, _value) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) func (_ERC20 *ERC20Session) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { return _ERC20.Contract.TransferFrom(&_ERC20.TransactOpts, _from, _to, _value) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) func (_ERC20 *ERC20TransactorSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { return _ERC20.Contract.TransferFrom(&_ERC20.TransactOpts, _from, _to, _value) } // ERC20ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the ERC20 contract. type ERC20ApprovalIterator struct { Event *ERC20Approval // 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 *ERC20ApprovalIterator) 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(ERC20Approval) 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(ERC20Approval) 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 *ERC20ApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20ApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20Approval represents a Approval event raised by the ERC20 contract. type ERC20Approval 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 (_ERC20 *ERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20ApprovalIterator, 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 := _ERC20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) if err != nil { return nil, err } return &ERC20ApprovalIterator{contract: _ERC20.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 (_ERC20 *ERC20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC20Approval, 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 := _ERC20.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(ERC20Approval) if err := _ERC20.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 } // ERC20MintIterator is returned from FilterMint and is used to iterate over the raw logs and unpacked data for Mint events raised by the ERC20 contract. type ERC20MintIterator struct { Event *ERC20Mint // 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 *ERC20MintIterator) 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(ERC20Mint) 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(ERC20Mint) 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 *ERC20MintIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20MintIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20Mint represents a Mint event raised by the ERC20 contract. type ERC20Mint struct { To common.Address Amount *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMint is a free log retrieval operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885. // // Solidity: event Mint(address indexed to, uint256 amount) func (_ERC20 *ERC20Filterer) FilterMint(opts *bind.FilterOpts, to []common.Address) (*ERC20MintIterator, error) { var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _ERC20.contract.FilterLogs(opts, "Mint", toRule) if err != nil { return nil, err } return &ERC20MintIterator{contract: _ERC20.contract, event: "Mint", logs: logs, sub: sub}, nil } // WatchMint is a free log subscription operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885. // // Solidity: event Mint(address indexed to, uint256 amount) func (_ERC20 *ERC20Filterer) WatchMint(opts *bind.WatchOpts, sink chan<- *ERC20Mint, to []common.Address) (event.Subscription, error) { var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _ERC20.contract.WatchLogs(opts, "Mint", 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(ERC20Mint) if err := _ERC20.contract.UnpackLog(event, "Mint", 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 } // ERC20TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ERC20 contract. type ERC20TransferIterator struct { Event *ERC20Transfer // 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 *ERC20TransferIterator) 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(ERC20Transfer) 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(ERC20Transfer) 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 *ERC20TransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *ERC20TransferIterator) Close() error { it.sub.Unsubscribe() return nil } // ERC20Transfer represents a Transfer event raised by the ERC20 contract. type ERC20Transfer 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 (_ERC20 *ERC20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC20TransferIterator, 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 := _ERC20.contract.FilterLogs(opts, "Transfer", fromRule, toRule) if err != nil { return nil, err } return &ERC20TransferIterator{contract: _ERC20.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 (_ERC20 *ERC20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC20Transfer, 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 := _ERC20.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(ERC20Transfer) if err := _ERC20.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 } // MintableERC20ABI is the input ABI used to generate the binding from. const MintableERC20ABI = "[{\"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\":\"_permissionedAddress\",\"type\":\"address\"}],\"name\":\"addMintPermission\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"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\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"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\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Mint\",\"type\":\"event\"}]" // MintableERC20Bin is the compiled bytecode used for deploying new contracts. const MintableERC20Bin = `0x608060405234801561001057600080fd5b506040805180820190915260048082527f5844495400000000000000000000000000000000000000000000000000000000602090920191825261005391816100c7565b506040805180820190915260048082527f78446974000000000000000000000000000000000000000000000000000000006020909201918252610098916005916100c7565b506006805460ff1990811660121790915533600090815260026020526040902080549091166001179055610162565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061010857805160ff1916838001178555610135565b82800160010185558215610135579182015b8281111561013557825182559160200191906001019061011a565b50610141929150610145565b5090565b61015f91905b80821115610141576000815560010161014b565b90565b610b3f806101716000396000f3006080604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100c9578063095ea7b31461015357806318160ddd1461018b5780631e61ecd3146101b257806323b872dd146101d3578063313ce567146101fd57806340c10f1914610228578063661884631461024c57806370a082311461027057806395d89b4114610291578063a9059cbb146102a6578063d73dd623146102ca578063dd62ed3e146102ee575b600080fd5b3480156100d557600080fd5b506100de610315565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610118578181015183820152602001610100565b50505050905090810190601f1680156101455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015f57600080fd5b50610177600160a060020a03600435166024356103a3565b604080519115158252519081900360200190f35b34801561019757600080fd5b506101a0610409565b60408051918252519081900360200190f35b3480156101be57600080fd5b50610177600160a060020a036004351661040f565b3480156101df57600080fd5b50610177600160a060020a0360043581169060243516604435610456565b34801561020957600080fd5b506102126105cb565b6040805160ff9092168252519081900360200190f35b34801561023457600080fd5b50610177600160a060020a03600435166024356105d4565b34801561025857600080fd5b50610177600160a060020a03600435166024356106cb565b34801561027c57600080fd5b506101a0600160a060020a03600435166107ba565b34801561029d57600080fd5b506100de6107d5565b3480156102b257600080fd5b50610177600160a060020a0360043516602435610830565b3480156102d657600080fd5b50610177600160a060020a036004351660243561090f565b3480156102fa57600080fd5b506101a0600160a060020a03600435811690602435166109a8565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561039b5780601f106103705761010080835404028352916020019161039b565b820191906000526020600020905b81548152906001019060200180831161037e57829003601f168201915b505050505081565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60035490565b3360009081526002602052604081205460ff16151561042d57600080fd5b50600160a060020a03166000908152600260205260409020805460ff1916600190811790915590565b600160a060020a03831660009081526020819052604081205482111561047b57600080fd5b600160a060020a03841660009081526001602090815260408083203384529091529020548211156104ab57600080fd5b600160a060020a03831615156104c057600080fd5b600160a060020a0384166000908152602081905260409020546104e9908363ffffffff6109d316565b600160a060020a03808616600090815260208190526040808220939093559085168152205461051e908363ffffffff610a7216565b600160a060020a03808516600090815260208181526040808320949094559187168152600182528281203382529091522054610560908363ffffffff6109d316565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60065460ff1681565b3360009081526002602052604081205460ff1615156105f257600080fd5b600354610605908363ffffffff610a7216565b600355600160a060020a038316600090815260208190526040902054610631908363ffffffff610a7216565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b336000908152600160209081526040808320600160a060020a038616845290915281205480831061071f57336000908152600160209081526040808320600160a060020a0388168452909152812055610754565b61072f818463ffffffff6109d316565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561039b5780601f106103705761010080835404028352916020019161039b565b3360009081526020819052604081205482111561084c57600080fd5b600160a060020a038316151561086157600080fd5b33600090815260208190526040902054610881908363ffffffff6109d316565b3360009081526020819052604080822092909255600160a060020a038516815220546108b3908363ffffffff610a7216565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600160209081526040808320600160a060020a0386168452909152812054610943908363ffffffff610a7216565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b60008083831115610a6b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f43616e27742073756274726163742061206e756d6265722066726f6d2061207360448201527f6d616c6c6572206f6e6520776974682075696e74730000000000000000000000606482015290519081900360840190fd5b5050900390565b600082820183811015610b0c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f526573756c742068617320746f20626520626967676572207468616e20626f7460448201527f682073756d6d616e647300000000000000000000000000000000000000000000606482015290519081900360840190fd5b93925050505600a165627a7a723058201b400aaef6daaab49caaa69f3f121cc70529e4276a28527a0d51ef81ee3618cf0029` // DeployMintableERC20 deploys a new Ethereum contract, binding an instance of MintableERC20 to it. func DeployMintableERC20(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *MintableERC20, error) { parsed, err := abi.JSON(strings.NewReader(MintableERC20ABI)) if err != nil { return common.Address{}, nil, nil, err } address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(MintableERC20Bin), backend) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &MintableERC20{MintableERC20Caller: MintableERC20Caller{contract: contract}, MintableERC20Transactor: MintableERC20Transactor{contract: contract}, MintableERC20Filterer: MintableERC20Filterer{contract: contract}}, nil } // MintableERC20 is an auto generated Go binding around an Ethereum contract. type MintableERC20 struct { MintableERC20Caller // Read-only binding to the contract MintableERC20Transactor // Write-only binding to the contract MintableERC20Filterer // Log filterer for contract events } // MintableERC20Caller is an auto generated read-only Go binding around an Ethereum contract. type MintableERC20Caller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // MintableERC20Transactor is an auto generated write-only Go binding around an Ethereum contract. type MintableERC20Transactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // MintableERC20Filterer is an auto generated log filtering Go binding around an Ethereum contract events. type MintableERC20Filterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // MintableERC20Session is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type MintableERC20Session struct { Contract *MintableERC20 // 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 } // MintableERC20CallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type MintableERC20CallerSession struct { Contract *MintableERC20Caller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // MintableERC20TransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type MintableERC20TransactorSession struct { Contract *MintableERC20Transactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // MintableERC20Raw is an auto generated low-level Go binding around an Ethereum contract. type MintableERC20Raw struct { Contract *MintableERC20 // Generic contract binding to access the raw methods on } // MintableERC20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type MintableERC20CallerRaw struct { Contract *MintableERC20Caller // Generic read-only contract binding to access the raw methods on } // MintableERC20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type MintableERC20TransactorRaw struct { Contract *MintableERC20Transactor // Generic write-only contract binding to access the raw methods on } // NewMintableERC20 creates a new instance of MintableERC20, bound to a specific deployed contract. func NewMintableERC20(address common.Address, backend bind.ContractBackend) (*MintableERC20, error) { contract, err := bindMintableERC20(address, backend, backend, backend) if err != nil { return nil, err } return &MintableERC20{MintableERC20Caller: MintableERC20Caller{contract: contract}, MintableERC20Transactor: MintableERC20Transactor{contract: contract}, MintableERC20Filterer: MintableERC20Filterer{contract: contract}}, nil } // NewMintableERC20Caller creates a new read-only instance of MintableERC20, bound to a specific deployed contract. func NewMintableERC20Caller(address common.Address, caller bind.ContractCaller) (*MintableERC20Caller, error) { contract, err := bindMintableERC20(address, caller, nil, nil) if err != nil { return nil, err } return &MintableERC20Caller{contract: contract}, nil } // NewMintableERC20Transactor creates a new write-only instance of MintableERC20, bound to a specific deployed contract. func NewMintableERC20Transactor(address common.Address, transactor bind.ContractTransactor) (*MintableERC20Transactor, error) { contract, err := bindMintableERC20(address, nil, transactor, nil) if err != nil { return nil, err } return &MintableERC20Transactor{contract: contract}, nil } // NewMintableERC20Filterer creates a new log filterer instance of MintableERC20, bound to a specific deployed contract. func NewMintableERC20Filterer(address common.Address, filterer bind.ContractFilterer) (*MintableERC20Filterer, error) { contract, err := bindMintableERC20(address, nil, nil, filterer) if err != nil { return nil, err } return &MintableERC20Filterer{contract: contract}, nil } // bindMintableERC20 binds a generic wrapper to an already deployed contract. func bindMintableERC20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := abi.JSON(strings.NewReader(MintableERC20ABI)) 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 (_MintableERC20 *MintableERC20Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { return _MintableERC20.Contract.MintableERC20Caller.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 (_MintableERC20 *MintableERC20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _MintableERC20.Contract.MintableERC20Transactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_MintableERC20 *MintableERC20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _MintableERC20.Contract.MintableERC20Transactor.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 (_MintableERC20 *MintableERC20CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { return _MintableERC20.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 (_MintableERC20 *MintableERC20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _MintableERC20.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_MintableERC20 *MintableERC20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _MintableERC20.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) constant returns(uint256) func (_MintableERC20 *MintableERC20Caller) Allowance(opts *bind.CallOpts, _owner common.Address, _spender common.Address) (*big.Int, error) { var ( ret0 = new(*big.Int) ) out := ret0 err := _MintableERC20.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(address _owner, address _spender) constant returns(uint256) func (_MintableERC20 *MintableERC20Session) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) { return _MintableERC20.Contract.Allowance(&_MintableERC20.CallOpts, _owner, _spender) } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // // Solidity: function allowance(address _owner, address _spender) constant returns(uint256) func (_MintableERC20 *MintableERC20CallerSession) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) { return _MintableERC20.Contract.Allowance(&_MintableERC20.CallOpts, _owner, _spender) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address _owner) constant returns(uint256) func (_MintableERC20 *MintableERC20Caller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) { var ( ret0 = new(*big.Int) ) out := ret0 err := _MintableERC20.contract.Call(opts, out, "balanceOf", _owner) return *ret0, err } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address _owner) constant returns(uint256) func (_MintableERC20 *MintableERC20Session) BalanceOf(_owner common.Address) (*big.Int, error) { return _MintableERC20.Contract.BalanceOf(&_MintableERC20.CallOpts, _owner) } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // // Solidity: function balanceOf(address _owner) constant returns(uint256) func (_MintableERC20 *MintableERC20CallerSession) BalanceOf(_owner common.Address) (*big.Int, error) { return _MintableERC20.Contract.BalanceOf(&_MintableERC20.CallOpts, _owner) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() constant returns(uint8) func (_MintableERC20 *MintableERC20Caller) Decimals(opts *bind.CallOpts) (uint8, error) { var ( ret0 = new(uint8) ) out := ret0 err := _MintableERC20.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 (_MintableERC20 *MintableERC20Session) Decimals() (uint8, error) { return _MintableERC20.Contract.Decimals(&_MintableERC20.CallOpts) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // // Solidity: function decimals() constant returns(uint8) func (_MintableERC20 *MintableERC20CallerSession) Decimals() (uint8, error) { return _MintableERC20.Contract.Decimals(&_MintableERC20.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() constant returns(string) func (_MintableERC20 *MintableERC20Caller) Name(opts *bind.CallOpts) (string, error) { var ( ret0 = new(string) ) out := ret0 err := _MintableERC20.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 (_MintableERC20 *MintableERC20Session) Name() (string, error) { return _MintableERC20.Contract.Name(&_MintableERC20.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // // Solidity: function name() constant returns(string) func (_MintableERC20 *MintableERC20CallerSession) Name() (string, error) { return _MintableERC20.Contract.Name(&_MintableERC20.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() constant returns(string) func (_MintableERC20 *MintableERC20Caller) Symbol(opts *bind.CallOpts) (string, error) { var ( ret0 = new(string) ) out := ret0 err := _MintableERC20.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 (_MintableERC20 *MintableERC20Session) Symbol() (string, error) { return _MintableERC20.Contract.Symbol(&_MintableERC20.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // // Solidity: function symbol() constant returns(string) func (_MintableERC20 *MintableERC20CallerSession) Symbol() (string, error) { return _MintableERC20.Contract.Symbol(&_MintableERC20.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() constant returns(uint256) func (_MintableERC20 *MintableERC20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { var ( ret0 = new(*big.Int) ) out := ret0 err := _MintableERC20.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 (_MintableERC20 *MintableERC20Session) TotalSupply() (*big.Int, error) { return _MintableERC20.Contract.TotalSupply(&_MintableERC20.CallOpts) } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // // Solidity: function totalSupply() constant returns(uint256) func (_MintableERC20 *MintableERC20CallerSession) TotalSupply() (*big.Int, error) { return _MintableERC20.Contract.TotalSupply(&_MintableERC20.CallOpts) } // AddMintPermission is a paid mutator transaction binding the contract method 0x1e61ecd3. // // Solidity: function addMintPermission(address _permissionedAddress) returns(bool) func (_MintableERC20 *MintableERC20Transactor) AddMintPermission(opts *bind.TransactOpts, _permissionedAddress common.Address) (*types.Transaction, error) { return _MintableERC20.contract.Transact(opts, "addMintPermission", _permissionedAddress) } // AddMintPermission is a paid mutator transaction binding the contract method 0x1e61ecd3. // // Solidity: function addMintPermission(address _permissionedAddress) returns(bool) func (_MintableERC20 *MintableERC20Session) AddMintPermission(_permissionedAddress common.Address) (*types.Transaction, error) { return _MintableERC20.Contract.AddMintPermission(&_MintableERC20.TransactOpts, _permissionedAddress) } // AddMintPermission is a paid mutator transaction binding the contract method 0x1e61ecd3. // // Solidity: function addMintPermission(address _permissionedAddress) returns(bool) func (_MintableERC20 *MintableERC20TransactorSession) AddMintPermission(_permissionedAddress common.Address) (*types.Transaction, error) { return _MintableERC20.Contract.AddMintPermission(&_MintableERC20.TransactOpts, _permissionedAddress) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address _spender, uint256 _value) returns(bool) func (_MintableERC20 *MintableERC20Transactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) { return _MintableERC20.contract.Transact(opts, "approve", _spender, _value) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address _spender, uint256 _value) returns(bool) func (_MintableERC20 *MintableERC20Session) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) { return _MintableERC20.Contract.Approve(&_MintableERC20.TransactOpts, _spender, _value) } // Approve is a paid mutator transaction binding the contract method 0x095ea7b3. // // Solidity: function approve(address _spender, uint256 _value) returns(bool) func (_MintableERC20 *MintableERC20TransactorSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) { return _MintableERC20.Contract.Approve(&_MintableERC20.TransactOpts, _spender, _value) } // DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463. // // Solidity: function decreaseApproval(address _spender, uint256 _subtractedValue) returns(bool) func (_MintableERC20 *MintableERC20Transactor) DecreaseApproval(opts *bind.TransactOpts, _spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) { return _MintableERC20.contract.Transact(opts, "decreaseApproval", _spender, _subtractedValue) } // DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463. // // Solidity: function decreaseApproval(address _spender, uint256 _subtractedValue) returns(bool) func (_MintableERC20 *MintableERC20Session) DecreaseApproval(_spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) { return _MintableERC20.Contract.DecreaseApproval(&_MintableERC20.TransactOpts, _spender, _subtractedValue) } // DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463. // // Solidity: function decreaseApproval(address _spender, uint256 _subtractedValue) returns(bool) func (_MintableERC20 *MintableERC20TransactorSession) DecreaseApproval(_spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) { return _MintableERC20.Contract.DecreaseApproval(&_MintableERC20.TransactOpts, _spender, _subtractedValue) } // IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623. // // Solidity: function increaseApproval(address _spender, uint256 _addedValue) returns(bool) func (_MintableERC20 *MintableERC20Transactor) IncreaseApproval(opts *bind.TransactOpts, _spender common.Address, _addedValue *big.Int) (*types.Transaction, error) { return _MintableERC20.contract.Transact(opts, "increaseApproval", _spender, _addedValue) } // IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623. // // Solidity: function increaseApproval(address _spender, uint256 _addedValue) returns(bool) func (_MintableERC20 *MintableERC20Session) IncreaseApproval(_spender common.Address, _addedValue *big.Int) (*types.Transaction, error) { return _MintableERC20.Contract.IncreaseApproval(&_MintableERC20.TransactOpts, _spender, _addedValue) } // IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623. // // Solidity: function increaseApproval(address _spender, uint256 _addedValue) returns(bool) func (_MintableERC20 *MintableERC20TransactorSession) IncreaseApproval(_spender common.Address, _addedValue *big.Int) (*types.Transaction, error) { return _MintableERC20.Contract.IncreaseApproval(&_MintableERC20.TransactOpts, _spender, _addedValue) } // Mint is a paid mutator transaction binding the contract method 0x40c10f19. // // Solidity: function mint(address _to, uint256 _amount) returns(bool) func (_MintableERC20 *MintableERC20Transactor) Mint(opts *bind.TransactOpts, _to common.Address, _amount *big.Int) (*types.Transaction, error) { return _MintableERC20.contract.Transact(opts, "mint", _to, _amount) } // Mint is a paid mutator transaction binding the contract method 0x40c10f19. // // Solidity: function mint(address _to, uint256 _amount) returns(bool) func (_MintableERC20 *MintableERC20Session) Mint(_to common.Address, _amount *big.Int) (*types.Transaction, error) { return _MintableERC20.Contract.Mint(&_MintableERC20.TransactOpts, _to, _amount) } // Mint is a paid mutator transaction binding the contract method 0x40c10f19. // // Solidity: function mint(address _to, uint256 _amount) returns(bool) func (_MintableERC20 *MintableERC20TransactorSession) Mint(_to common.Address, _amount *big.Int) (*types.Transaction, error) { return _MintableERC20.Contract.Mint(&_MintableERC20.TransactOpts, _to, _amount) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address _to, uint256 _value) returns(bool) func (_MintableERC20 *MintableERC20Transactor) Transfer(opts *bind.TransactOpts, _to common.Address, _value *big.Int) (*types.Transaction, error) { return _MintableERC20.contract.Transact(opts, "transfer", _to, _value) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address _to, uint256 _value) returns(bool) func (_MintableERC20 *MintableERC20Session) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { return _MintableERC20.Contract.Transfer(&_MintableERC20.TransactOpts, _to, _value) } // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. // // Solidity: function transfer(address _to, uint256 _value) returns(bool) func (_MintableERC20 *MintableERC20TransactorSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { return _MintableERC20.Contract.Transfer(&_MintableERC20.TransactOpts, _to, _value) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) func (_MintableERC20 *MintableERC20Transactor) TransferFrom(opts *bind.TransactOpts, _from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { return _MintableERC20.contract.Transact(opts, "transferFrom", _from, _to, _value) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) func (_MintableERC20 *MintableERC20Session) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { return _MintableERC20.Contract.TransferFrom(&_MintableERC20.TransactOpts, _from, _to, _value) } // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. // // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) func (_MintableERC20 *MintableERC20TransactorSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { return _MintableERC20.Contract.TransferFrom(&_MintableERC20.TransactOpts, _from, _to, _value) } // MintableERC20ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the MintableERC20 contract. type MintableERC20ApprovalIterator struct { Event *MintableERC20Approval // 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 *MintableERC20ApprovalIterator) 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(MintableERC20Approval) 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(MintableERC20Approval) 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 *MintableERC20ApprovalIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *MintableERC20ApprovalIterator) Close() error { it.sub.Unsubscribe() return nil } // MintableERC20Approval represents a Approval event raised by the MintableERC20 contract. type MintableERC20Approval 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 (_MintableERC20 *MintableERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*MintableERC20ApprovalIterator, 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 := _MintableERC20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) if err != nil { return nil, err } return &MintableERC20ApprovalIterator{contract: _MintableERC20.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 (_MintableERC20 *MintableERC20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *MintableERC20Approval, 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 := _MintableERC20.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(MintableERC20Approval) if err := _MintableERC20.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 } // MintableERC20MintIterator is returned from FilterMint and is used to iterate over the raw logs and unpacked data for Mint events raised by the MintableERC20 contract. type MintableERC20MintIterator struct { Event *MintableERC20Mint // 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 *MintableERC20MintIterator) 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(MintableERC20Mint) 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(MintableERC20Mint) 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 *MintableERC20MintIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *MintableERC20MintIterator) Close() error { it.sub.Unsubscribe() return nil } // MintableERC20Mint represents a Mint event raised by the MintableERC20 contract. type MintableERC20Mint struct { To common.Address Amount *big.Int Raw types.Log // Blockchain specific contextual infos } // FilterMint is a free log retrieval operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885. // // Solidity: event Mint(address indexed to, uint256 amount) func (_MintableERC20 *MintableERC20Filterer) FilterMint(opts *bind.FilterOpts, to []common.Address) (*MintableERC20MintIterator, error) { var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _MintableERC20.contract.FilterLogs(opts, "Mint", toRule) if err != nil { return nil, err } return &MintableERC20MintIterator{contract: _MintableERC20.contract, event: "Mint", logs: logs, sub: sub}, nil } // WatchMint is a free log subscription operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885. // // Solidity: event Mint(address indexed to, uint256 amount) func (_MintableERC20 *MintableERC20Filterer) WatchMint(opts *bind.WatchOpts, sink chan<- *MintableERC20Mint, to []common.Address) (event.Subscription, error) { var toRule []interface{} for _, toItem := range to { toRule = append(toRule, toItem) } logs, sub, err := _MintableERC20.contract.WatchLogs(opts, "Mint", 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(MintableERC20Mint) if err := _MintableERC20.contract.UnpackLog(event, "Mint", 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 } // MintableERC20TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the MintableERC20 contract. type MintableERC20TransferIterator struct { Event *MintableERC20Transfer // 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 *MintableERC20TransferIterator) 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(MintableERC20Transfer) 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(MintableERC20Transfer) 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 *MintableERC20TransferIterator) Error() error { return it.fail } // Close terminates the iteration process, releasing any pending underlying // resources. func (it *MintableERC20TransferIterator) Close() error { it.sub.Unsubscribe() return nil } // MintableERC20Transfer represents a Transfer event raised by the MintableERC20 contract. type MintableERC20Transfer 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 (_MintableERC20 *MintableERC20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MintableERC20TransferIterator, 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 := _MintableERC20.contract.FilterLogs(opts, "Transfer", fromRule, toRule) if err != nil { return nil, err } return &MintableERC20TransferIterator{contract: _MintableERC20.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 (_MintableERC20 *MintableERC20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *MintableERC20Transfer, 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 := _MintableERC20.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(MintableERC20Transfer) if err := _MintableERC20.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 } // SafeMathABI is the input ABI used to generate the binding from. const SafeMathABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"a\",\"type\":\"uint256\"}],\"name\":\"sqrt\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"}]" // SafeMathBin is the compiled bytecode used for deploying new contracts. const SafeMathBin = `0x61016b610030600b82828239805160001a6073146000811461002057610022565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600436106100575763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663677342ce811461005c575b600080fd5b610067600435610079565b60408051918252519081900360200190f35b6000808083151561008d5760009250610138565b6001840184106100fe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f466c6177656420696e70757420666f7220737172740000000000000000000000604482015290519081900360640190fd5b505060026001830104825b80821015610134575080600281808681151561012157fe5b040181151561012c57fe5b049150610109565b8192505b50509190505600a165627a7a723058209973030427b153e03b78d7e03b4edc80d78b5dc021f0b5fc92844e037d38d8330029` // DeploySafeMath deploys a new Ethereum contract, binding an instance of SafeMath to it. func DeploySafeMath(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SafeMath, error) { parsed, err := abi.JSON(strings.NewReader(SafeMathABI)) if err != nil { return common.Address{}, nil, nil, err } address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(SafeMathBin), backend) if err != nil { return common.Address{}, nil, nil, err } return address, tx, &SafeMath{SafeMathCaller: SafeMathCaller{contract: contract}, SafeMathTransactor: SafeMathTransactor{contract: contract}, SafeMathFilterer: SafeMathFilterer{contract: contract}}, nil } // SafeMath is an auto generated Go binding around an Ethereum contract. type SafeMath struct { SafeMathCaller // Read-only binding to the contract SafeMathTransactor // Write-only binding to the contract SafeMathFilterer // Log filterer for contract events } // SafeMathCaller is an auto generated read-only Go binding around an Ethereum contract. type SafeMathCaller struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SafeMathTransactor is an auto generated write-only Go binding around an Ethereum contract. type SafeMathTransactor struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SafeMathFilterer is an auto generated log filtering Go binding around an Ethereum contract events. type SafeMathFilterer struct { contract *bind.BoundContract // Generic contract wrapper for the low level calls } // SafeMathSession is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type SafeMathSession struct { Contract *SafeMath // 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 } // SafeMathCallerSession is an auto generated read-only Go binding around an Ethereum contract, // with pre-set call options. type SafeMathCallerSession struct { Contract *SafeMathCaller // Generic contract caller binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session } // SafeMathTransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type SafeMathTransactorSession struct { Contract *SafeMathTransactor // Generic contract transactor binding to set the session for TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // SafeMathRaw is an auto generated low-level Go binding around an Ethereum contract. type SafeMathRaw struct { Contract *SafeMath // Generic contract binding to access the raw methods on } // SafeMathCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. type SafeMathCallerRaw struct { Contract *SafeMathCaller // Generic read-only contract binding to access the raw methods on } // SafeMathTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. type SafeMathTransactorRaw struct { Contract *SafeMathTransactor // Generic write-only contract binding to access the raw methods on } // NewSafeMath creates a new instance of SafeMath, bound to a specific deployed contract. func NewSafeMath(address common.Address, backend bind.ContractBackend) (*SafeMath, error) { contract, err := bindSafeMath(address, backend, backend, backend) if err != nil { return nil, err } return &SafeMath{SafeMathCaller: SafeMathCaller{contract: contract}, SafeMathTransactor: SafeMathTransactor{contract: contract}, SafeMathFilterer: SafeMathFilterer{contract: contract}}, nil } // NewSafeMathCaller creates a new read-only instance of SafeMath, bound to a specific deployed contract. func NewSafeMathCaller(address common.Address, caller bind.ContractCaller) (*SafeMathCaller, error) { contract, err := bindSafeMath(address, caller, nil, nil) if err != nil { return nil, err } return &SafeMathCaller{contract: contract}, nil } // NewSafeMathTransactor creates a new write-only instance of SafeMath, bound to a specific deployed contract. func NewSafeMathTransactor(address common.Address, transactor bind.ContractTransactor) (*SafeMathTransactor, error) { contract, err := bindSafeMath(address, nil, transactor, nil) if err != nil { return nil, err } return &SafeMathTransactor{contract: contract}, nil } // NewSafeMathFilterer creates a new log filterer instance of SafeMath, bound to a specific deployed contract. func NewSafeMathFilterer(address common.Address, filterer bind.ContractFilterer) (*SafeMathFilterer, error) { contract, err := bindSafeMath(address, nil, nil, filterer) if err != nil { return nil, err } return &SafeMathFilterer{contract: contract}, nil } // bindSafeMath binds a generic wrapper to an already deployed contract. func bindSafeMath(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { parsed, err := abi.JSON(strings.NewReader(SafeMathABI)) 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 (_SafeMath *SafeMathRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { return _SafeMath.Contract.SafeMathCaller.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 (_SafeMath *SafeMathRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _SafeMath.Contract.SafeMathTransactor.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_SafeMath *SafeMathRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _SafeMath.Contract.SafeMathTransactor.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 (_SafeMath *SafeMathCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { return _SafeMath.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 (_SafeMath *SafeMathTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { return _SafeMath.Contract.contract.Transfer(opts) } // Transact invokes the (paid) contract method with params as input values. func (_SafeMath *SafeMathTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { return _SafeMath.Contract.contract.Transact(opts, method, params...) } // Sqrt is a free data retrieval call binding the contract method 0x677342ce. // // Solidity: function sqrt(uint256 a) constant returns(uint256) func (_SafeMath *SafeMathCaller) Sqrt(opts *bind.CallOpts, a *big.Int) (*big.Int, error) { var ( ret0 = new(*big.Int) ) out := ret0 err := _SafeMath.contract.Call(opts, out, "sqrt", a) return *ret0, err } // Sqrt is a free data retrieval call binding the contract method 0x677342ce. // // Solidity: function sqrt(uint256 a) constant returns(uint256) func (_SafeMath *SafeMathSession) Sqrt(a *big.Int) (*big.Int, error) { return _SafeMath.Contract.Sqrt(&_SafeMath.CallOpts, a) } // Sqrt is a free data retrieval call binding the contract method 0x677342ce. // // Solidity: function sqrt(uint256 a) constant returns(uint256) func (_SafeMath *SafeMathCallerSession) Sqrt(a *big.Int) (*big.Int, error) { return _SafeMath.Contract.Sqrt(&_SafeMath.CallOpts, a) }