1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816 |
- // 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)
- }
|