ditToken.go 84 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816
  1. // Code generated - DO NOT EDIT.
  2. // This file is a generated binding and any manual changes will be lost.
  3. package ditToken
  4. import (
  5. "math/big"
  6. "strings"
  7. ethereum "github.com/ethereum/go-ethereum"
  8. "github.com/ethereum/go-ethereum/accounts/abi"
  9. "github.com/ethereum/go-ethereum/accounts/abi/bind"
  10. "github.com/ethereum/go-ethereum/common"
  11. "github.com/ethereum/go-ethereum/core/types"
  12. "github.com/ethereum/go-ethereum/event"
  13. )
  14. // Reference imports to suppress errors if they are not otherwise used.
  15. var (
  16. _ = big.NewInt
  17. _ = strings.NewReader
  18. _ = ethereum.NotFound
  19. _ = abi.U256
  20. _ = bind.Bind
  21. _ = common.Big1
  22. _ = types.BloomLookup
  23. _ = event.NewSubscription
  24. )
  25. // ERC20ABI is the input ABI used to generate the binding from.
  26. 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\"}]"
  27. // ERC20Bin is the compiled bytecode used for deploying new contracts.
  28. const ERC20Bin = `0x`
  29. // DeployERC20 deploys a new Ethereum contract, binding an instance of ERC20 to it.
  30. func DeployERC20(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ERC20, error) {
  31. parsed, err := abi.JSON(strings.NewReader(ERC20ABI))
  32. if err != nil {
  33. return common.Address{}, nil, nil, err
  34. }
  35. address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ERC20Bin), backend)
  36. if err != nil {
  37. return common.Address{}, nil, nil, err
  38. }
  39. return address, tx, &ERC20{ERC20Caller: ERC20Caller{contract: contract}, ERC20Transactor: ERC20Transactor{contract: contract}, ERC20Filterer: ERC20Filterer{contract: contract}}, nil
  40. }
  41. // ERC20 is an auto generated Go binding around an Ethereum contract.
  42. type ERC20 struct {
  43. ERC20Caller // Read-only binding to the contract
  44. ERC20Transactor // Write-only binding to the contract
  45. ERC20Filterer // Log filterer for contract events
  46. }
  47. // ERC20Caller is an auto generated read-only Go binding around an Ethereum contract.
  48. type ERC20Caller struct {
  49. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  50. }
  51. // ERC20Transactor is an auto generated write-only Go binding around an Ethereum contract.
  52. type ERC20Transactor struct {
  53. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  54. }
  55. // ERC20Filterer is an auto generated log filtering Go binding around an Ethereum contract events.
  56. type ERC20Filterer struct {
  57. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  58. }
  59. // ERC20Session is an auto generated Go binding around an Ethereum contract,
  60. // with pre-set call and transact options.
  61. type ERC20Session struct {
  62. Contract *ERC20 // Generic contract binding to set the session for
  63. CallOpts bind.CallOpts // Call options to use throughout this session
  64. TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
  65. }
  66. // ERC20CallerSession is an auto generated read-only Go binding around an Ethereum contract,
  67. // with pre-set call options.
  68. type ERC20CallerSession struct {
  69. Contract *ERC20Caller // Generic contract caller binding to set the session for
  70. CallOpts bind.CallOpts // Call options to use throughout this session
  71. }
  72. // ERC20TransactorSession is an auto generated write-only Go binding around an Ethereum contract,
  73. // with pre-set transact options.
  74. type ERC20TransactorSession struct {
  75. Contract *ERC20Transactor // Generic contract transactor binding to set the session for
  76. TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
  77. }
  78. // ERC20Raw is an auto generated low-level Go binding around an Ethereum contract.
  79. type ERC20Raw struct {
  80. Contract *ERC20 // Generic contract binding to access the raw methods on
  81. }
  82. // ERC20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
  83. type ERC20CallerRaw struct {
  84. Contract *ERC20Caller // Generic read-only contract binding to access the raw methods on
  85. }
  86. // ERC20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
  87. type ERC20TransactorRaw struct {
  88. Contract *ERC20Transactor // Generic write-only contract binding to access the raw methods on
  89. }
  90. // NewERC20 creates a new instance of ERC20, bound to a specific deployed contract.
  91. func NewERC20(address common.Address, backend bind.ContractBackend) (*ERC20, error) {
  92. contract, err := bindERC20(address, backend, backend, backend)
  93. if err != nil {
  94. return nil, err
  95. }
  96. return &ERC20{ERC20Caller: ERC20Caller{contract: contract}, ERC20Transactor: ERC20Transactor{contract: contract}, ERC20Filterer: ERC20Filterer{contract: contract}}, nil
  97. }
  98. // NewERC20Caller creates a new read-only instance of ERC20, bound to a specific deployed contract.
  99. func NewERC20Caller(address common.Address, caller bind.ContractCaller) (*ERC20Caller, error) {
  100. contract, err := bindERC20(address, caller, nil, nil)
  101. if err != nil {
  102. return nil, err
  103. }
  104. return &ERC20Caller{contract: contract}, nil
  105. }
  106. // NewERC20Transactor creates a new write-only instance of ERC20, bound to a specific deployed contract.
  107. func NewERC20Transactor(address common.Address, transactor bind.ContractTransactor) (*ERC20Transactor, error) {
  108. contract, err := bindERC20(address, nil, transactor, nil)
  109. if err != nil {
  110. return nil, err
  111. }
  112. return &ERC20Transactor{contract: contract}, nil
  113. }
  114. // NewERC20Filterer creates a new log filterer instance of ERC20, bound to a specific deployed contract.
  115. func NewERC20Filterer(address common.Address, filterer bind.ContractFilterer) (*ERC20Filterer, error) {
  116. contract, err := bindERC20(address, nil, nil, filterer)
  117. if err != nil {
  118. return nil, err
  119. }
  120. return &ERC20Filterer{contract: contract}, nil
  121. }
  122. // bindERC20 binds a generic wrapper to an already deployed contract.
  123. func bindERC20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
  124. parsed, err := abi.JSON(strings.NewReader(ERC20ABI))
  125. if err != nil {
  126. return nil, err
  127. }
  128. return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
  129. }
  130. // Call invokes the (constant) contract method with params as input values and
  131. // sets the output to result. The result type might be a single field for simple
  132. // returns, a slice of interfaces for anonymous returns and a struct for named
  133. // returns.
  134. func (_ERC20 *ERC20Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
  135. return _ERC20.Contract.ERC20Caller.contract.Call(opts, result, method, params...)
  136. }
  137. // Transfer initiates a plain transaction to move funds to the contract, calling
  138. // its default method if one is available.
  139. func (_ERC20 *ERC20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
  140. return _ERC20.Contract.ERC20Transactor.contract.Transfer(opts)
  141. }
  142. // Transact invokes the (paid) contract method with params as input values.
  143. func (_ERC20 *ERC20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
  144. return _ERC20.Contract.ERC20Transactor.contract.Transact(opts, method, params...)
  145. }
  146. // Call invokes the (constant) contract method with params as input values and
  147. // sets the output to result. The result type might be a single field for simple
  148. // returns, a slice of interfaces for anonymous returns and a struct for named
  149. // returns.
  150. func (_ERC20 *ERC20CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
  151. return _ERC20.Contract.contract.Call(opts, result, method, params...)
  152. }
  153. // Transfer initiates a plain transaction to move funds to the contract, calling
  154. // its default method if one is available.
  155. func (_ERC20 *ERC20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
  156. return _ERC20.Contract.contract.Transfer(opts)
  157. }
  158. // Transact invokes the (paid) contract method with params as input values.
  159. func (_ERC20 *ERC20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
  160. return _ERC20.Contract.contract.Transact(opts, method, params...)
  161. }
  162. // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e.
  163. //
  164. // Solidity: function allowance(address _owner, address _spender) constant returns(uint256)
  165. func (_ERC20 *ERC20Caller) Allowance(opts *bind.CallOpts, _owner common.Address, _spender common.Address) (*big.Int, error) {
  166. var (
  167. ret0 = new(*big.Int)
  168. )
  169. out := ret0
  170. err := _ERC20.contract.Call(opts, out, "allowance", _owner, _spender)
  171. return *ret0, err
  172. }
  173. // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e.
  174. //
  175. // Solidity: function allowance(address _owner, address _spender) constant returns(uint256)
  176. func (_ERC20 *ERC20Session) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) {
  177. return _ERC20.Contract.Allowance(&_ERC20.CallOpts, _owner, _spender)
  178. }
  179. // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e.
  180. //
  181. // Solidity: function allowance(address _owner, address _spender) constant returns(uint256)
  182. func (_ERC20 *ERC20CallerSession) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) {
  183. return _ERC20.Contract.Allowance(&_ERC20.CallOpts, _owner, _spender)
  184. }
  185. // BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
  186. //
  187. // Solidity: function balanceOf(address _who) constant returns(uint256)
  188. func (_ERC20 *ERC20Caller) BalanceOf(opts *bind.CallOpts, _who common.Address) (*big.Int, error) {
  189. var (
  190. ret0 = new(*big.Int)
  191. )
  192. out := ret0
  193. err := _ERC20.contract.Call(opts, out, "balanceOf", _who)
  194. return *ret0, err
  195. }
  196. // BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
  197. //
  198. // Solidity: function balanceOf(address _who) constant returns(uint256)
  199. func (_ERC20 *ERC20Session) BalanceOf(_who common.Address) (*big.Int, error) {
  200. return _ERC20.Contract.BalanceOf(&_ERC20.CallOpts, _who)
  201. }
  202. // BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
  203. //
  204. // Solidity: function balanceOf(address _who) constant returns(uint256)
  205. func (_ERC20 *ERC20CallerSession) BalanceOf(_who common.Address) (*big.Int, error) {
  206. return _ERC20.Contract.BalanceOf(&_ERC20.CallOpts, _who)
  207. }
  208. // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
  209. //
  210. // Solidity: function totalSupply() constant returns(uint256)
  211. func (_ERC20 *ERC20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) {
  212. var (
  213. ret0 = new(*big.Int)
  214. )
  215. out := ret0
  216. err := _ERC20.contract.Call(opts, out, "totalSupply")
  217. return *ret0, err
  218. }
  219. // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
  220. //
  221. // Solidity: function totalSupply() constant returns(uint256)
  222. func (_ERC20 *ERC20Session) TotalSupply() (*big.Int, error) {
  223. return _ERC20.Contract.TotalSupply(&_ERC20.CallOpts)
  224. }
  225. // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
  226. //
  227. // Solidity: function totalSupply() constant returns(uint256)
  228. func (_ERC20 *ERC20CallerSession) TotalSupply() (*big.Int, error) {
  229. return _ERC20.Contract.TotalSupply(&_ERC20.CallOpts)
  230. }
  231. // Approve is a paid mutator transaction binding the contract method 0x095ea7b3.
  232. //
  233. // Solidity: function approve(address _spender, uint256 _value) returns(bool)
  234. func (_ERC20 *ERC20Transactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) {
  235. return _ERC20.contract.Transact(opts, "approve", _spender, _value)
  236. }
  237. // Approve is a paid mutator transaction binding the contract method 0x095ea7b3.
  238. //
  239. // Solidity: function approve(address _spender, uint256 _value) returns(bool)
  240. func (_ERC20 *ERC20Session) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) {
  241. return _ERC20.Contract.Approve(&_ERC20.TransactOpts, _spender, _value)
  242. }
  243. // Approve is a paid mutator transaction binding the contract method 0x095ea7b3.
  244. //
  245. // Solidity: function approve(address _spender, uint256 _value) returns(bool)
  246. func (_ERC20 *ERC20TransactorSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) {
  247. return _ERC20.Contract.Approve(&_ERC20.TransactOpts, _spender, _value)
  248. }
  249. // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb.
  250. //
  251. // Solidity: function transfer(address _to, uint256 _value) returns(bool)
  252. func (_ERC20 *ERC20Transactor) Transfer(opts *bind.TransactOpts, _to common.Address, _value *big.Int) (*types.Transaction, error) {
  253. return _ERC20.contract.Transact(opts, "transfer", _to, _value)
  254. }
  255. // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb.
  256. //
  257. // Solidity: function transfer(address _to, uint256 _value) returns(bool)
  258. func (_ERC20 *ERC20Session) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) {
  259. return _ERC20.Contract.Transfer(&_ERC20.TransactOpts, _to, _value)
  260. }
  261. // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb.
  262. //
  263. // Solidity: function transfer(address _to, uint256 _value) returns(bool)
  264. func (_ERC20 *ERC20TransactorSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) {
  265. return _ERC20.Contract.Transfer(&_ERC20.TransactOpts, _to, _value)
  266. }
  267. // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd.
  268. //
  269. // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool)
  270. func (_ERC20 *ERC20Transactor) TransferFrom(opts *bind.TransactOpts, _from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) {
  271. return _ERC20.contract.Transact(opts, "transferFrom", _from, _to, _value)
  272. }
  273. // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd.
  274. //
  275. // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool)
  276. func (_ERC20 *ERC20Session) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) {
  277. return _ERC20.Contract.TransferFrom(&_ERC20.TransactOpts, _from, _to, _value)
  278. }
  279. // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd.
  280. //
  281. // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool)
  282. func (_ERC20 *ERC20TransactorSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) {
  283. return _ERC20.Contract.TransferFrom(&_ERC20.TransactOpts, _from, _to, _value)
  284. }
  285. // 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.
  286. type ERC20ApprovalIterator struct {
  287. Event *ERC20Approval // Event containing the contract specifics and raw log
  288. contract *bind.BoundContract // Generic contract to use for unpacking event data
  289. event string // Event name to use for unpacking event data
  290. logs chan types.Log // Log channel receiving the found contract events
  291. sub ethereum.Subscription // Subscription for errors, completion and termination
  292. done bool // Whether the subscription completed delivering logs
  293. fail error // Occurred error to stop iteration
  294. }
  295. // Next advances the iterator to the subsequent event, returning whether there
  296. // are any more events found. In case of a retrieval or parsing error, false is
  297. // returned and Error() can be queried for the exact failure.
  298. func (it *ERC20ApprovalIterator) Next() bool {
  299. // If the iterator failed, stop iterating
  300. if it.fail != nil {
  301. return false
  302. }
  303. // If the iterator completed, deliver directly whatever's available
  304. if it.done {
  305. select {
  306. case log := <-it.logs:
  307. it.Event = new(ERC20Approval)
  308. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  309. it.fail = err
  310. return false
  311. }
  312. it.Event.Raw = log
  313. return true
  314. default:
  315. return false
  316. }
  317. }
  318. // Iterator still in progress, wait for either a data or an error event
  319. select {
  320. case log := <-it.logs:
  321. it.Event = new(ERC20Approval)
  322. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  323. it.fail = err
  324. return false
  325. }
  326. it.Event.Raw = log
  327. return true
  328. case err := <-it.sub.Err():
  329. it.done = true
  330. it.fail = err
  331. return it.Next()
  332. }
  333. }
  334. // Error returns any retrieval or parsing error occurred during filtering.
  335. func (it *ERC20ApprovalIterator) Error() error {
  336. return it.fail
  337. }
  338. // Close terminates the iteration process, releasing any pending underlying
  339. // resources.
  340. func (it *ERC20ApprovalIterator) Close() error {
  341. it.sub.Unsubscribe()
  342. return nil
  343. }
  344. // ERC20Approval represents a Approval event raised by the ERC20 contract.
  345. type ERC20Approval struct {
  346. Owner common.Address
  347. Spender common.Address
  348. Value *big.Int
  349. Raw types.Log // Blockchain specific contextual infos
  350. }
  351. // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925.
  352. //
  353. // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value)
  354. func (_ERC20 *ERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC20ApprovalIterator, error) {
  355. var ownerRule []interface{}
  356. for _, ownerItem := range owner {
  357. ownerRule = append(ownerRule, ownerItem)
  358. }
  359. var spenderRule []interface{}
  360. for _, spenderItem := range spender {
  361. spenderRule = append(spenderRule, spenderItem)
  362. }
  363. logs, sub, err := _ERC20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule)
  364. if err != nil {
  365. return nil, err
  366. }
  367. return &ERC20ApprovalIterator{contract: _ERC20.contract, event: "Approval", logs: logs, sub: sub}, nil
  368. }
  369. // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925.
  370. //
  371. // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value)
  372. func (_ERC20 *ERC20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC20Approval, owner []common.Address, spender []common.Address) (event.Subscription, error) {
  373. var ownerRule []interface{}
  374. for _, ownerItem := range owner {
  375. ownerRule = append(ownerRule, ownerItem)
  376. }
  377. var spenderRule []interface{}
  378. for _, spenderItem := range spender {
  379. spenderRule = append(spenderRule, spenderItem)
  380. }
  381. logs, sub, err := _ERC20.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule)
  382. if err != nil {
  383. return nil, err
  384. }
  385. return event.NewSubscription(func(quit <-chan struct{}) error {
  386. defer sub.Unsubscribe()
  387. for {
  388. select {
  389. case log := <-logs:
  390. // New log arrived, parse the event and forward to the user
  391. event := new(ERC20Approval)
  392. if err := _ERC20.contract.UnpackLog(event, "Approval", log); err != nil {
  393. return err
  394. }
  395. event.Raw = log
  396. select {
  397. case sink <- event:
  398. case err := <-sub.Err():
  399. return err
  400. case <-quit:
  401. return nil
  402. }
  403. case err := <-sub.Err():
  404. return err
  405. case <-quit:
  406. return nil
  407. }
  408. }
  409. }), nil
  410. }
  411. // 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.
  412. type ERC20MintIterator struct {
  413. Event *ERC20Mint // Event containing the contract specifics and raw log
  414. contract *bind.BoundContract // Generic contract to use for unpacking event data
  415. event string // Event name to use for unpacking event data
  416. logs chan types.Log // Log channel receiving the found contract events
  417. sub ethereum.Subscription // Subscription for errors, completion and termination
  418. done bool // Whether the subscription completed delivering logs
  419. fail error // Occurred error to stop iteration
  420. }
  421. // Next advances the iterator to the subsequent event, returning whether there
  422. // are any more events found. In case of a retrieval or parsing error, false is
  423. // returned and Error() can be queried for the exact failure.
  424. func (it *ERC20MintIterator) Next() bool {
  425. // If the iterator failed, stop iterating
  426. if it.fail != nil {
  427. return false
  428. }
  429. // If the iterator completed, deliver directly whatever's available
  430. if it.done {
  431. select {
  432. case log := <-it.logs:
  433. it.Event = new(ERC20Mint)
  434. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  435. it.fail = err
  436. return false
  437. }
  438. it.Event.Raw = log
  439. return true
  440. default:
  441. return false
  442. }
  443. }
  444. // Iterator still in progress, wait for either a data or an error event
  445. select {
  446. case log := <-it.logs:
  447. it.Event = new(ERC20Mint)
  448. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  449. it.fail = err
  450. return false
  451. }
  452. it.Event.Raw = log
  453. return true
  454. case err := <-it.sub.Err():
  455. it.done = true
  456. it.fail = err
  457. return it.Next()
  458. }
  459. }
  460. // Error returns any retrieval or parsing error occurred during filtering.
  461. func (it *ERC20MintIterator) Error() error {
  462. return it.fail
  463. }
  464. // Close terminates the iteration process, releasing any pending underlying
  465. // resources.
  466. func (it *ERC20MintIterator) Close() error {
  467. it.sub.Unsubscribe()
  468. return nil
  469. }
  470. // ERC20Mint represents a Mint event raised by the ERC20 contract.
  471. type ERC20Mint struct {
  472. To common.Address
  473. Amount *big.Int
  474. Raw types.Log // Blockchain specific contextual infos
  475. }
  476. // FilterMint is a free log retrieval operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885.
  477. //
  478. // Solidity: event Mint(address indexed to, uint256 amount)
  479. func (_ERC20 *ERC20Filterer) FilterMint(opts *bind.FilterOpts, to []common.Address) (*ERC20MintIterator, error) {
  480. var toRule []interface{}
  481. for _, toItem := range to {
  482. toRule = append(toRule, toItem)
  483. }
  484. logs, sub, err := _ERC20.contract.FilterLogs(opts, "Mint", toRule)
  485. if err != nil {
  486. return nil, err
  487. }
  488. return &ERC20MintIterator{contract: _ERC20.contract, event: "Mint", logs: logs, sub: sub}, nil
  489. }
  490. // WatchMint is a free log subscription operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885.
  491. //
  492. // Solidity: event Mint(address indexed to, uint256 amount)
  493. func (_ERC20 *ERC20Filterer) WatchMint(opts *bind.WatchOpts, sink chan<- *ERC20Mint, to []common.Address) (event.Subscription, error) {
  494. var toRule []interface{}
  495. for _, toItem := range to {
  496. toRule = append(toRule, toItem)
  497. }
  498. logs, sub, err := _ERC20.contract.WatchLogs(opts, "Mint", toRule)
  499. if err != nil {
  500. return nil, err
  501. }
  502. return event.NewSubscription(func(quit <-chan struct{}) error {
  503. defer sub.Unsubscribe()
  504. for {
  505. select {
  506. case log := <-logs:
  507. // New log arrived, parse the event and forward to the user
  508. event := new(ERC20Mint)
  509. if err := _ERC20.contract.UnpackLog(event, "Mint", log); err != nil {
  510. return err
  511. }
  512. event.Raw = log
  513. select {
  514. case sink <- event:
  515. case err := <-sub.Err():
  516. return err
  517. case <-quit:
  518. return nil
  519. }
  520. case err := <-sub.Err():
  521. return err
  522. case <-quit:
  523. return nil
  524. }
  525. }
  526. }), nil
  527. }
  528. // 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.
  529. type ERC20TransferIterator struct {
  530. Event *ERC20Transfer // Event containing the contract specifics and raw log
  531. contract *bind.BoundContract // Generic contract to use for unpacking event data
  532. event string // Event name to use for unpacking event data
  533. logs chan types.Log // Log channel receiving the found contract events
  534. sub ethereum.Subscription // Subscription for errors, completion and termination
  535. done bool // Whether the subscription completed delivering logs
  536. fail error // Occurred error to stop iteration
  537. }
  538. // Next advances the iterator to the subsequent event, returning whether there
  539. // are any more events found. In case of a retrieval or parsing error, false is
  540. // returned and Error() can be queried for the exact failure.
  541. func (it *ERC20TransferIterator) Next() bool {
  542. // If the iterator failed, stop iterating
  543. if it.fail != nil {
  544. return false
  545. }
  546. // If the iterator completed, deliver directly whatever's available
  547. if it.done {
  548. select {
  549. case log := <-it.logs:
  550. it.Event = new(ERC20Transfer)
  551. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  552. it.fail = err
  553. return false
  554. }
  555. it.Event.Raw = log
  556. return true
  557. default:
  558. return false
  559. }
  560. }
  561. // Iterator still in progress, wait for either a data or an error event
  562. select {
  563. case log := <-it.logs:
  564. it.Event = new(ERC20Transfer)
  565. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  566. it.fail = err
  567. return false
  568. }
  569. it.Event.Raw = log
  570. return true
  571. case err := <-it.sub.Err():
  572. it.done = true
  573. it.fail = err
  574. return it.Next()
  575. }
  576. }
  577. // Error returns any retrieval or parsing error occurred during filtering.
  578. func (it *ERC20TransferIterator) Error() error {
  579. return it.fail
  580. }
  581. // Close terminates the iteration process, releasing any pending underlying
  582. // resources.
  583. func (it *ERC20TransferIterator) Close() error {
  584. it.sub.Unsubscribe()
  585. return nil
  586. }
  587. // ERC20Transfer represents a Transfer event raised by the ERC20 contract.
  588. type ERC20Transfer struct {
  589. From common.Address
  590. To common.Address
  591. Value *big.Int
  592. Raw types.Log // Blockchain specific contextual infos
  593. }
  594. // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
  595. //
  596. // Solidity: event Transfer(address indexed from, address indexed to, uint256 value)
  597. func (_ERC20 *ERC20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*ERC20TransferIterator, error) {
  598. var fromRule []interface{}
  599. for _, fromItem := range from {
  600. fromRule = append(fromRule, fromItem)
  601. }
  602. var toRule []interface{}
  603. for _, toItem := range to {
  604. toRule = append(toRule, toItem)
  605. }
  606. logs, sub, err := _ERC20.contract.FilterLogs(opts, "Transfer", fromRule, toRule)
  607. if err != nil {
  608. return nil, err
  609. }
  610. return &ERC20TransferIterator{contract: _ERC20.contract, event: "Transfer", logs: logs, sub: sub}, nil
  611. }
  612. // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
  613. //
  614. // Solidity: event Transfer(address indexed from, address indexed to, uint256 value)
  615. func (_ERC20 *ERC20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC20Transfer, from []common.Address, to []common.Address) (event.Subscription, error) {
  616. var fromRule []interface{}
  617. for _, fromItem := range from {
  618. fromRule = append(fromRule, fromItem)
  619. }
  620. var toRule []interface{}
  621. for _, toItem := range to {
  622. toRule = append(toRule, toItem)
  623. }
  624. logs, sub, err := _ERC20.contract.WatchLogs(opts, "Transfer", fromRule, toRule)
  625. if err != nil {
  626. return nil, err
  627. }
  628. return event.NewSubscription(func(quit <-chan struct{}) error {
  629. defer sub.Unsubscribe()
  630. for {
  631. select {
  632. case log := <-logs:
  633. // New log arrived, parse the event and forward to the user
  634. event := new(ERC20Transfer)
  635. if err := _ERC20.contract.UnpackLog(event, "Transfer", log); err != nil {
  636. return err
  637. }
  638. event.Raw = log
  639. select {
  640. case sink <- event:
  641. case err := <-sub.Err():
  642. return err
  643. case <-quit:
  644. return nil
  645. }
  646. case err := <-sub.Err():
  647. return err
  648. case <-quit:
  649. return nil
  650. }
  651. }
  652. }), nil
  653. }
  654. // MintableERC20ABI is the input ABI used to generate the binding from.
  655. 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\"}]"
  656. // MintableERC20Bin is the compiled bytecode used for deploying new contracts.
  657. const MintableERC20Bin = `0x608060405234801561001057600080fd5b506040805180820190915260048082527f5844495400000000000000000000000000000000000000000000000000000000602090920191825261005391816100c7565b506040805180820190915260048082527f78446974000000000000000000000000000000000000000000000000000000006020909201918252610098916005916100c7565b506006805460ff1990811660121790915533600090815260026020526040902080549091166001179055610162565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061010857805160ff1916838001178555610135565b82800160010185558215610135579182015b8281111561013557825182559160200191906001019061011a565b50610141929150610145565b5090565b61015f91905b80821115610141576000815560010161014b565b90565b610b3f806101716000396000f3006080604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100c9578063095ea7b31461015357806318160ddd1461018b5780631e61ecd3146101b257806323b872dd146101d3578063313ce567146101fd57806340c10f1914610228578063661884631461024c57806370a082311461027057806395d89b4114610291578063a9059cbb146102a6578063d73dd623146102ca578063dd62ed3e146102ee575b600080fd5b3480156100d557600080fd5b506100de610315565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610118578181015183820152602001610100565b50505050905090810190601f1680156101455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015f57600080fd5b50610177600160a060020a03600435166024356103a3565b604080519115158252519081900360200190f35b34801561019757600080fd5b506101a0610409565b60408051918252519081900360200190f35b3480156101be57600080fd5b50610177600160a060020a036004351661040f565b3480156101df57600080fd5b50610177600160a060020a0360043581169060243516604435610456565b34801561020957600080fd5b506102126105cb565b6040805160ff9092168252519081900360200190f35b34801561023457600080fd5b50610177600160a060020a03600435166024356105d4565b34801561025857600080fd5b50610177600160a060020a03600435166024356106cb565b34801561027c57600080fd5b506101a0600160a060020a03600435166107ba565b34801561029d57600080fd5b506100de6107d5565b3480156102b257600080fd5b50610177600160a060020a0360043516602435610830565b3480156102d657600080fd5b50610177600160a060020a036004351660243561090f565b3480156102fa57600080fd5b506101a0600160a060020a03600435811690602435166109a8565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561039b5780601f106103705761010080835404028352916020019161039b565b820191906000526020600020905b81548152906001019060200180831161037e57829003601f168201915b505050505081565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60035490565b3360009081526002602052604081205460ff16151561042d57600080fd5b50600160a060020a03166000908152600260205260409020805460ff1916600190811790915590565b600160a060020a03831660009081526020819052604081205482111561047b57600080fd5b600160a060020a03841660009081526001602090815260408083203384529091529020548211156104ab57600080fd5b600160a060020a03831615156104c057600080fd5b600160a060020a0384166000908152602081905260409020546104e9908363ffffffff6109d316565b600160a060020a03808616600090815260208190526040808220939093559085168152205461051e908363ffffffff610a7216565b600160a060020a03808516600090815260208181526040808320949094559187168152600182528281203382529091522054610560908363ffffffff6109d316565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60065460ff1681565b3360009081526002602052604081205460ff1615156105f257600080fd5b600354610605908363ffffffff610a7216565b600355600160a060020a038316600090815260208190526040902054610631908363ffffffff610a7216565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b336000908152600160209081526040808320600160a060020a038616845290915281205480831061071f57336000908152600160209081526040808320600160a060020a0388168452909152812055610754565b61072f818463ffffffff6109d316565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561039b5780601f106103705761010080835404028352916020019161039b565b3360009081526020819052604081205482111561084c57600080fd5b600160a060020a038316151561086157600080fd5b33600090815260208190526040902054610881908363ffffffff6109d316565b3360009081526020819052604080822092909255600160a060020a038516815220546108b3908363ffffffff610a7216565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600160209081526040808320600160a060020a0386168452909152812054610943908363ffffffff610a7216565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b60008083831115610a6b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f43616e27742073756274726163742061206e756d6265722066726f6d2061207360448201527f6d616c6c6572206f6e6520776974682075696e74730000000000000000000000606482015290519081900360840190fd5b5050900390565b600082820183811015610b0c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f526573756c742068617320746f20626520626967676572207468616e20626f7460448201527f682073756d6d616e647300000000000000000000000000000000000000000000606482015290519081900360840190fd5b93925050505600a165627a7a723058201b400aaef6daaab49caaa69f3f121cc70529e4276a28527a0d51ef81ee3618cf0029`
  658. // DeployMintableERC20 deploys a new Ethereum contract, binding an instance of MintableERC20 to it.
  659. func DeployMintableERC20(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *MintableERC20, error) {
  660. parsed, err := abi.JSON(strings.NewReader(MintableERC20ABI))
  661. if err != nil {
  662. return common.Address{}, nil, nil, err
  663. }
  664. address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(MintableERC20Bin), backend)
  665. if err != nil {
  666. return common.Address{}, nil, nil, err
  667. }
  668. return address, tx, &MintableERC20{MintableERC20Caller: MintableERC20Caller{contract: contract}, MintableERC20Transactor: MintableERC20Transactor{contract: contract}, MintableERC20Filterer: MintableERC20Filterer{contract: contract}}, nil
  669. }
  670. // MintableERC20 is an auto generated Go binding around an Ethereum contract.
  671. type MintableERC20 struct {
  672. MintableERC20Caller // Read-only binding to the contract
  673. MintableERC20Transactor // Write-only binding to the contract
  674. MintableERC20Filterer // Log filterer for contract events
  675. }
  676. // MintableERC20Caller is an auto generated read-only Go binding around an Ethereum contract.
  677. type MintableERC20Caller struct {
  678. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  679. }
  680. // MintableERC20Transactor is an auto generated write-only Go binding around an Ethereum contract.
  681. type MintableERC20Transactor struct {
  682. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  683. }
  684. // MintableERC20Filterer is an auto generated log filtering Go binding around an Ethereum contract events.
  685. type MintableERC20Filterer struct {
  686. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  687. }
  688. // MintableERC20Session is an auto generated Go binding around an Ethereum contract,
  689. // with pre-set call and transact options.
  690. type MintableERC20Session struct {
  691. Contract *MintableERC20 // Generic contract binding to set the session for
  692. CallOpts bind.CallOpts // Call options to use throughout this session
  693. TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
  694. }
  695. // MintableERC20CallerSession is an auto generated read-only Go binding around an Ethereum contract,
  696. // with pre-set call options.
  697. type MintableERC20CallerSession struct {
  698. Contract *MintableERC20Caller // Generic contract caller binding to set the session for
  699. CallOpts bind.CallOpts // Call options to use throughout this session
  700. }
  701. // MintableERC20TransactorSession is an auto generated write-only Go binding around an Ethereum contract,
  702. // with pre-set transact options.
  703. type MintableERC20TransactorSession struct {
  704. Contract *MintableERC20Transactor // Generic contract transactor binding to set the session for
  705. TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
  706. }
  707. // MintableERC20Raw is an auto generated low-level Go binding around an Ethereum contract.
  708. type MintableERC20Raw struct {
  709. Contract *MintableERC20 // Generic contract binding to access the raw methods on
  710. }
  711. // MintableERC20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
  712. type MintableERC20CallerRaw struct {
  713. Contract *MintableERC20Caller // Generic read-only contract binding to access the raw methods on
  714. }
  715. // MintableERC20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
  716. type MintableERC20TransactorRaw struct {
  717. Contract *MintableERC20Transactor // Generic write-only contract binding to access the raw methods on
  718. }
  719. // NewMintableERC20 creates a new instance of MintableERC20, bound to a specific deployed contract.
  720. func NewMintableERC20(address common.Address, backend bind.ContractBackend) (*MintableERC20, error) {
  721. contract, err := bindMintableERC20(address, backend, backend, backend)
  722. if err != nil {
  723. return nil, err
  724. }
  725. return &MintableERC20{MintableERC20Caller: MintableERC20Caller{contract: contract}, MintableERC20Transactor: MintableERC20Transactor{contract: contract}, MintableERC20Filterer: MintableERC20Filterer{contract: contract}}, nil
  726. }
  727. // NewMintableERC20Caller creates a new read-only instance of MintableERC20, bound to a specific deployed contract.
  728. func NewMintableERC20Caller(address common.Address, caller bind.ContractCaller) (*MintableERC20Caller, error) {
  729. contract, err := bindMintableERC20(address, caller, nil, nil)
  730. if err != nil {
  731. return nil, err
  732. }
  733. return &MintableERC20Caller{contract: contract}, nil
  734. }
  735. // NewMintableERC20Transactor creates a new write-only instance of MintableERC20, bound to a specific deployed contract.
  736. func NewMintableERC20Transactor(address common.Address, transactor bind.ContractTransactor) (*MintableERC20Transactor, error) {
  737. contract, err := bindMintableERC20(address, nil, transactor, nil)
  738. if err != nil {
  739. return nil, err
  740. }
  741. return &MintableERC20Transactor{contract: contract}, nil
  742. }
  743. // NewMintableERC20Filterer creates a new log filterer instance of MintableERC20, bound to a specific deployed contract.
  744. func NewMintableERC20Filterer(address common.Address, filterer bind.ContractFilterer) (*MintableERC20Filterer, error) {
  745. contract, err := bindMintableERC20(address, nil, nil, filterer)
  746. if err != nil {
  747. return nil, err
  748. }
  749. return &MintableERC20Filterer{contract: contract}, nil
  750. }
  751. // bindMintableERC20 binds a generic wrapper to an already deployed contract.
  752. func bindMintableERC20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
  753. parsed, err := abi.JSON(strings.NewReader(MintableERC20ABI))
  754. if err != nil {
  755. return nil, err
  756. }
  757. return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
  758. }
  759. // Call invokes the (constant) contract method with params as input values and
  760. // sets the output to result. The result type might be a single field for simple
  761. // returns, a slice of interfaces for anonymous returns and a struct for named
  762. // returns.
  763. func (_MintableERC20 *MintableERC20Raw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
  764. return _MintableERC20.Contract.MintableERC20Caller.contract.Call(opts, result, method, params...)
  765. }
  766. // Transfer initiates a plain transaction to move funds to the contract, calling
  767. // its default method if one is available.
  768. func (_MintableERC20 *MintableERC20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
  769. return _MintableERC20.Contract.MintableERC20Transactor.contract.Transfer(opts)
  770. }
  771. // Transact invokes the (paid) contract method with params as input values.
  772. func (_MintableERC20 *MintableERC20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
  773. return _MintableERC20.Contract.MintableERC20Transactor.contract.Transact(opts, method, params...)
  774. }
  775. // Call invokes the (constant) contract method with params as input values and
  776. // sets the output to result. The result type might be a single field for simple
  777. // returns, a slice of interfaces for anonymous returns and a struct for named
  778. // returns.
  779. func (_MintableERC20 *MintableERC20CallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
  780. return _MintableERC20.Contract.contract.Call(opts, result, method, params...)
  781. }
  782. // Transfer initiates a plain transaction to move funds to the contract, calling
  783. // its default method if one is available.
  784. func (_MintableERC20 *MintableERC20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
  785. return _MintableERC20.Contract.contract.Transfer(opts)
  786. }
  787. // Transact invokes the (paid) contract method with params as input values.
  788. func (_MintableERC20 *MintableERC20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
  789. return _MintableERC20.Contract.contract.Transact(opts, method, params...)
  790. }
  791. // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e.
  792. //
  793. // Solidity: function allowance(address _owner, address _spender) constant returns(uint256)
  794. func (_MintableERC20 *MintableERC20Caller) Allowance(opts *bind.CallOpts, _owner common.Address, _spender common.Address) (*big.Int, error) {
  795. var (
  796. ret0 = new(*big.Int)
  797. )
  798. out := ret0
  799. err := _MintableERC20.contract.Call(opts, out, "allowance", _owner, _spender)
  800. return *ret0, err
  801. }
  802. // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e.
  803. //
  804. // Solidity: function allowance(address _owner, address _spender) constant returns(uint256)
  805. func (_MintableERC20 *MintableERC20Session) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) {
  806. return _MintableERC20.Contract.Allowance(&_MintableERC20.CallOpts, _owner, _spender)
  807. }
  808. // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e.
  809. //
  810. // Solidity: function allowance(address _owner, address _spender) constant returns(uint256)
  811. func (_MintableERC20 *MintableERC20CallerSession) Allowance(_owner common.Address, _spender common.Address) (*big.Int, error) {
  812. return _MintableERC20.Contract.Allowance(&_MintableERC20.CallOpts, _owner, _spender)
  813. }
  814. // BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
  815. //
  816. // Solidity: function balanceOf(address _owner) constant returns(uint256)
  817. func (_MintableERC20 *MintableERC20Caller) BalanceOf(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) {
  818. var (
  819. ret0 = new(*big.Int)
  820. )
  821. out := ret0
  822. err := _MintableERC20.contract.Call(opts, out, "balanceOf", _owner)
  823. return *ret0, err
  824. }
  825. // BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
  826. //
  827. // Solidity: function balanceOf(address _owner) constant returns(uint256)
  828. func (_MintableERC20 *MintableERC20Session) BalanceOf(_owner common.Address) (*big.Int, error) {
  829. return _MintableERC20.Contract.BalanceOf(&_MintableERC20.CallOpts, _owner)
  830. }
  831. // BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
  832. //
  833. // Solidity: function balanceOf(address _owner) constant returns(uint256)
  834. func (_MintableERC20 *MintableERC20CallerSession) BalanceOf(_owner common.Address) (*big.Int, error) {
  835. return _MintableERC20.Contract.BalanceOf(&_MintableERC20.CallOpts, _owner)
  836. }
  837. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
  838. //
  839. // Solidity: function decimals() constant returns(uint8)
  840. func (_MintableERC20 *MintableERC20Caller) Decimals(opts *bind.CallOpts) (uint8, error) {
  841. var (
  842. ret0 = new(uint8)
  843. )
  844. out := ret0
  845. err := _MintableERC20.contract.Call(opts, out, "decimals")
  846. return *ret0, err
  847. }
  848. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
  849. //
  850. // Solidity: function decimals() constant returns(uint8)
  851. func (_MintableERC20 *MintableERC20Session) Decimals() (uint8, error) {
  852. return _MintableERC20.Contract.Decimals(&_MintableERC20.CallOpts)
  853. }
  854. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
  855. //
  856. // Solidity: function decimals() constant returns(uint8)
  857. func (_MintableERC20 *MintableERC20CallerSession) Decimals() (uint8, error) {
  858. return _MintableERC20.Contract.Decimals(&_MintableERC20.CallOpts)
  859. }
  860. // Name is a free data retrieval call binding the contract method 0x06fdde03.
  861. //
  862. // Solidity: function name() constant returns(string)
  863. func (_MintableERC20 *MintableERC20Caller) Name(opts *bind.CallOpts) (string, error) {
  864. var (
  865. ret0 = new(string)
  866. )
  867. out := ret0
  868. err := _MintableERC20.contract.Call(opts, out, "name")
  869. return *ret0, err
  870. }
  871. // Name is a free data retrieval call binding the contract method 0x06fdde03.
  872. //
  873. // Solidity: function name() constant returns(string)
  874. func (_MintableERC20 *MintableERC20Session) Name() (string, error) {
  875. return _MintableERC20.Contract.Name(&_MintableERC20.CallOpts)
  876. }
  877. // Name is a free data retrieval call binding the contract method 0x06fdde03.
  878. //
  879. // Solidity: function name() constant returns(string)
  880. func (_MintableERC20 *MintableERC20CallerSession) Name() (string, error) {
  881. return _MintableERC20.Contract.Name(&_MintableERC20.CallOpts)
  882. }
  883. // Symbol is a free data retrieval call binding the contract method 0x95d89b41.
  884. //
  885. // Solidity: function symbol() constant returns(string)
  886. func (_MintableERC20 *MintableERC20Caller) Symbol(opts *bind.CallOpts) (string, error) {
  887. var (
  888. ret0 = new(string)
  889. )
  890. out := ret0
  891. err := _MintableERC20.contract.Call(opts, out, "symbol")
  892. return *ret0, err
  893. }
  894. // Symbol is a free data retrieval call binding the contract method 0x95d89b41.
  895. //
  896. // Solidity: function symbol() constant returns(string)
  897. func (_MintableERC20 *MintableERC20Session) Symbol() (string, error) {
  898. return _MintableERC20.Contract.Symbol(&_MintableERC20.CallOpts)
  899. }
  900. // Symbol is a free data retrieval call binding the contract method 0x95d89b41.
  901. //
  902. // Solidity: function symbol() constant returns(string)
  903. func (_MintableERC20 *MintableERC20CallerSession) Symbol() (string, error) {
  904. return _MintableERC20.Contract.Symbol(&_MintableERC20.CallOpts)
  905. }
  906. // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
  907. //
  908. // Solidity: function totalSupply() constant returns(uint256)
  909. func (_MintableERC20 *MintableERC20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) {
  910. var (
  911. ret0 = new(*big.Int)
  912. )
  913. out := ret0
  914. err := _MintableERC20.contract.Call(opts, out, "totalSupply")
  915. return *ret0, err
  916. }
  917. // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
  918. //
  919. // Solidity: function totalSupply() constant returns(uint256)
  920. func (_MintableERC20 *MintableERC20Session) TotalSupply() (*big.Int, error) {
  921. return _MintableERC20.Contract.TotalSupply(&_MintableERC20.CallOpts)
  922. }
  923. // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
  924. //
  925. // Solidity: function totalSupply() constant returns(uint256)
  926. func (_MintableERC20 *MintableERC20CallerSession) TotalSupply() (*big.Int, error) {
  927. return _MintableERC20.Contract.TotalSupply(&_MintableERC20.CallOpts)
  928. }
  929. // AddMintPermission is a paid mutator transaction binding the contract method 0x1e61ecd3.
  930. //
  931. // Solidity: function addMintPermission(address _permissionedAddress) returns(bool)
  932. func (_MintableERC20 *MintableERC20Transactor) AddMintPermission(opts *bind.TransactOpts, _permissionedAddress common.Address) (*types.Transaction, error) {
  933. return _MintableERC20.contract.Transact(opts, "addMintPermission", _permissionedAddress)
  934. }
  935. // AddMintPermission is a paid mutator transaction binding the contract method 0x1e61ecd3.
  936. //
  937. // Solidity: function addMintPermission(address _permissionedAddress) returns(bool)
  938. func (_MintableERC20 *MintableERC20Session) AddMintPermission(_permissionedAddress common.Address) (*types.Transaction, error) {
  939. return _MintableERC20.Contract.AddMintPermission(&_MintableERC20.TransactOpts, _permissionedAddress)
  940. }
  941. // AddMintPermission is a paid mutator transaction binding the contract method 0x1e61ecd3.
  942. //
  943. // Solidity: function addMintPermission(address _permissionedAddress) returns(bool)
  944. func (_MintableERC20 *MintableERC20TransactorSession) AddMintPermission(_permissionedAddress common.Address) (*types.Transaction, error) {
  945. return _MintableERC20.Contract.AddMintPermission(&_MintableERC20.TransactOpts, _permissionedAddress)
  946. }
  947. // Approve is a paid mutator transaction binding the contract method 0x095ea7b3.
  948. //
  949. // Solidity: function approve(address _spender, uint256 _value) returns(bool)
  950. func (_MintableERC20 *MintableERC20Transactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) {
  951. return _MintableERC20.contract.Transact(opts, "approve", _spender, _value)
  952. }
  953. // Approve is a paid mutator transaction binding the contract method 0x095ea7b3.
  954. //
  955. // Solidity: function approve(address _spender, uint256 _value) returns(bool)
  956. func (_MintableERC20 *MintableERC20Session) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) {
  957. return _MintableERC20.Contract.Approve(&_MintableERC20.TransactOpts, _spender, _value)
  958. }
  959. // Approve is a paid mutator transaction binding the contract method 0x095ea7b3.
  960. //
  961. // Solidity: function approve(address _spender, uint256 _value) returns(bool)
  962. func (_MintableERC20 *MintableERC20TransactorSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) {
  963. return _MintableERC20.Contract.Approve(&_MintableERC20.TransactOpts, _spender, _value)
  964. }
  965. // DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463.
  966. //
  967. // Solidity: function decreaseApproval(address _spender, uint256 _subtractedValue) returns(bool)
  968. func (_MintableERC20 *MintableERC20Transactor) DecreaseApproval(opts *bind.TransactOpts, _spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) {
  969. return _MintableERC20.contract.Transact(opts, "decreaseApproval", _spender, _subtractedValue)
  970. }
  971. // DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463.
  972. //
  973. // Solidity: function decreaseApproval(address _spender, uint256 _subtractedValue) returns(bool)
  974. func (_MintableERC20 *MintableERC20Session) DecreaseApproval(_spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) {
  975. return _MintableERC20.Contract.DecreaseApproval(&_MintableERC20.TransactOpts, _spender, _subtractedValue)
  976. }
  977. // DecreaseApproval is a paid mutator transaction binding the contract method 0x66188463.
  978. //
  979. // Solidity: function decreaseApproval(address _spender, uint256 _subtractedValue) returns(bool)
  980. func (_MintableERC20 *MintableERC20TransactorSession) DecreaseApproval(_spender common.Address, _subtractedValue *big.Int) (*types.Transaction, error) {
  981. return _MintableERC20.Contract.DecreaseApproval(&_MintableERC20.TransactOpts, _spender, _subtractedValue)
  982. }
  983. // IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623.
  984. //
  985. // Solidity: function increaseApproval(address _spender, uint256 _addedValue) returns(bool)
  986. func (_MintableERC20 *MintableERC20Transactor) IncreaseApproval(opts *bind.TransactOpts, _spender common.Address, _addedValue *big.Int) (*types.Transaction, error) {
  987. return _MintableERC20.contract.Transact(opts, "increaseApproval", _spender, _addedValue)
  988. }
  989. // IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623.
  990. //
  991. // Solidity: function increaseApproval(address _spender, uint256 _addedValue) returns(bool)
  992. func (_MintableERC20 *MintableERC20Session) IncreaseApproval(_spender common.Address, _addedValue *big.Int) (*types.Transaction, error) {
  993. return _MintableERC20.Contract.IncreaseApproval(&_MintableERC20.TransactOpts, _spender, _addedValue)
  994. }
  995. // IncreaseApproval is a paid mutator transaction binding the contract method 0xd73dd623.
  996. //
  997. // Solidity: function increaseApproval(address _spender, uint256 _addedValue) returns(bool)
  998. func (_MintableERC20 *MintableERC20TransactorSession) IncreaseApproval(_spender common.Address, _addedValue *big.Int) (*types.Transaction, error) {
  999. return _MintableERC20.Contract.IncreaseApproval(&_MintableERC20.TransactOpts, _spender, _addedValue)
  1000. }
  1001. // Mint is a paid mutator transaction binding the contract method 0x40c10f19.
  1002. //
  1003. // Solidity: function mint(address _to, uint256 _amount) returns(bool)
  1004. func (_MintableERC20 *MintableERC20Transactor) Mint(opts *bind.TransactOpts, _to common.Address, _amount *big.Int) (*types.Transaction, error) {
  1005. return _MintableERC20.contract.Transact(opts, "mint", _to, _amount)
  1006. }
  1007. // Mint is a paid mutator transaction binding the contract method 0x40c10f19.
  1008. //
  1009. // Solidity: function mint(address _to, uint256 _amount) returns(bool)
  1010. func (_MintableERC20 *MintableERC20Session) Mint(_to common.Address, _amount *big.Int) (*types.Transaction, error) {
  1011. return _MintableERC20.Contract.Mint(&_MintableERC20.TransactOpts, _to, _amount)
  1012. }
  1013. // Mint is a paid mutator transaction binding the contract method 0x40c10f19.
  1014. //
  1015. // Solidity: function mint(address _to, uint256 _amount) returns(bool)
  1016. func (_MintableERC20 *MintableERC20TransactorSession) Mint(_to common.Address, _amount *big.Int) (*types.Transaction, error) {
  1017. return _MintableERC20.Contract.Mint(&_MintableERC20.TransactOpts, _to, _amount)
  1018. }
  1019. // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb.
  1020. //
  1021. // Solidity: function transfer(address _to, uint256 _value) returns(bool)
  1022. func (_MintableERC20 *MintableERC20Transactor) Transfer(opts *bind.TransactOpts, _to common.Address, _value *big.Int) (*types.Transaction, error) {
  1023. return _MintableERC20.contract.Transact(opts, "transfer", _to, _value)
  1024. }
  1025. // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb.
  1026. //
  1027. // Solidity: function transfer(address _to, uint256 _value) returns(bool)
  1028. func (_MintableERC20 *MintableERC20Session) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) {
  1029. return _MintableERC20.Contract.Transfer(&_MintableERC20.TransactOpts, _to, _value)
  1030. }
  1031. // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb.
  1032. //
  1033. // Solidity: function transfer(address _to, uint256 _value) returns(bool)
  1034. func (_MintableERC20 *MintableERC20TransactorSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) {
  1035. return _MintableERC20.Contract.Transfer(&_MintableERC20.TransactOpts, _to, _value)
  1036. }
  1037. // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd.
  1038. //
  1039. // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool)
  1040. func (_MintableERC20 *MintableERC20Transactor) TransferFrom(opts *bind.TransactOpts, _from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) {
  1041. return _MintableERC20.contract.Transact(opts, "transferFrom", _from, _to, _value)
  1042. }
  1043. // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd.
  1044. //
  1045. // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool)
  1046. func (_MintableERC20 *MintableERC20Session) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) {
  1047. return _MintableERC20.Contract.TransferFrom(&_MintableERC20.TransactOpts, _from, _to, _value)
  1048. }
  1049. // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd.
  1050. //
  1051. // Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool)
  1052. func (_MintableERC20 *MintableERC20TransactorSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) {
  1053. return _MintableERC20.Contract.TransferFrom(&_MintableERC20.TransactOpts, _from, _to, _value)
  1054. }
  1055. // 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.
  1056. type MintableERC20ApprovalIterator struct {
  1057. Event *MintableERC20Approval // Event containing the contract specifics and raw log
  1058. contract *bind.BoundContract // Generic contract to use for unpacking event data
  1059. event string // Event name to use for unpacking event data
  1060. logs chan types.Log // Log channel receiving the found contract events
  1061. sub ethereum.Subscription // Subscription for errors, completion and termination
  1062. done bool // Whether the subscription completed delivering logs
  1063. fail error // Occurred error to stop iteration
  1064. }
  1065. // Next advances the iterator to the subsequent event, returning whether there
  1066. // are any more events found. In case of a retrieval or parsing error, false is
  1067. // returned and Error() can be queried for the exact failure.
  1068. func (it *MintableERC20ApprovalIterator) Next() bool {
  1069. // If the iterator failed, stop iterating
  1070. if it.fail != nil {
  1071. return false
  1072. }
  1073. // If the iterator completed, deliver directly whatever's available
  1074. if it.done {
  1075. select {
  1076. case log := <-it.logs:
  1077. it.Event = new(MintableERC20Approval)
  1078. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  1079. it.fail = err
  1080. return false
  1081. }
  1082. it.Event.Raw = log
  1083. return true
  1084. default:
  1085. return false
  1086. }
  1087. }
  1088. // Iterator still in progress, wait for either a data or an error event
  1089. select {
  1090. case log := <-it.logs:
  1091. it.Event = new(MintableERC20Approval)
  1092. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  1093. it.fail = err
  1094. return false
  1095. }
  1096. it.Event.Raw = log
  1097. return true
  1098. case err := <-it.sub.Err():
  1099. it.done = true
  1100. it.fail = err
  1101. return it.Next()
  1102. }
  1103. }
  1104. // Error returns any retrieval or parsing error occurred during filtering.
  1105. func (it *MintableERC20ApprovalIterator) Error() error {
  1106. return it.fail
  1107. }
  1108. // Close terminates the iteration process, releasing any pending underlying
  1109. // resources.
  1110. func (it *MintableERC20ApprovalIterator) Close() error {
  1111. it.sub.Unsubscribe()
  1112. return nil
  1113. }
  1114. // MintableERC20Approval represents a Approval event raised by the MintableERC20 contract.
  1115. type MintableERC20Approval struct {
  1116. Owner common.Address
  1117. Spender common.Address
  1118. Value *big.Int
  1119. Raw types.Log // Blockchain specific contextual infos
  1120. }
  1121. // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925.
  1122. //
  1123. // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value)
  1124. func (_MintableERC20 *MintableERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*MintableERC20ApprovalIterator, error) {
  1125. var ownerRule []interface{}
  1126. for _, ownerItem := range owner {
  1127. ownerRule = append(ownerRule, ownerItem)
  1128. }
  1129. var spenderRule []interface{}
  1130. for _, spenderItem := range spender {
  1131. spenderRule = append(spenderRule, spenderItem)
  1132. }
  1133. logs, sub, err := _MintableERC20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule)
  1134. if err != nil {
  1135. return nil, err
  1136. }
  1137. return &MintableERC20ApprovalIterator{contract: _MintableERC20.contract, event: "Approval", logs: logs, sub: sub}, nil
  1138. }
  1139. // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925.
  1140. //
  1141. // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value)
  1142. func (_MintableERC20 *MintableERC20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *MintableERC20Approval, owner []common.Address, spender []common.Address) (event.Subscription, error) {
  1143. var ownerRule []interface{}
  1144. for _, ownerItem := range owner {
  1145. ownerRule = append(ownerRule, ownerItem)
  1146. }
  1147. var spenderRule []interface{}
  1148. for _, spenderItem := range spender {
  1149. spenderRule = append(spenderRule, spenderItem)
  1150. }
  1151. logs, sub, err := _MintableERC20.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule)
  1152. if err != nil {
  1153. return nil, err
  1154. }
  1155. return event.NewSubscription(func(quit <-chan struct{}) error {
  1156. defer sub.Unsubscribe()
  1157. for {
  1158. select {
  1159. case log := <-logs:
  1160. // New log arrived, parse the event and forward to the user
  1161. event := new(MintableERC20Approval)
  1162. if err := _MintableERC20.contract.UnpackLog(event, "Approval", log); err != nil {
  1163. return err
  1164. }
  1165. event.Raw = log
  1166. select {
  1167. case sink <- event:
  1168. case err := <-sub.Err():
  1169. return err
  1170. case <-quit:
  1171. return nil
  1172. }
  1173. case err := <-sub.Err():
  1174. return err
  1175. case <-quit:
  1176. return nil
  1177. }
  1178. }
  1179. }), nil
  1180. }
  1181. // 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.
  1182. type MintableERC20MintIterator struct {
  1183. Event *MintableERC20Mint // Event containing the contract specifics and raw log
  1184. contract *bind.BoundContract // Generic contract to use for unpacking event data
  1185. event string // Event name to use for unpacking event data
  1186. logs chan types.Log // Log channel receiving the found contract events
  1187. sub ethereum.Subscription // Subscription for errors, completion and termination
  1188. done bool // Whether the subscription completed delivering logs
  1189. fail error // Occurred error to stop iteration
  1190. }
  1191. // Next advances the iterator to the subsequent event, returning whether there
  1192. // are any more events found. In case of a retrieval or parsing error, false is
  1193. // returned and Error() can be queried for the exact failure.
  1194. func (it *MintableERC20MintIterator) Next() bool {
  1195. // If the iterator failed, stop iterating
  1196. if it.fail != nil {
  1197. return false
  1198. }
  1199. // If the iterator completed, deliver directly whatever's available
  1200. if it.done {
  1201. select {
  1202. case log := <-it.logs:
  1203. it.Event = new(MintableERC20Mint)
  1204. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  1205. it.fail = err
  1206. return false
  1207. }
  1208. it.Event.Raw = log
  1209. return true
  1210. default:
  1211. return false
  1212. }
  1213. }
  1214. // Iterator still in progress, wait for either a data or an error event
  1215. select {
  1216. case log := <-it.logs:
  1217. it.Event = new(MintableERC20Mint)
  1218. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  1219. it.fail = err
  1220. return false
  1221. }
  1222. it.Event.Raw = log
  1223. return true
  1224. case err := <-it.sub.Err():
  1225. it.done = true
  1226. it.fail = err
  1227. return it.Next()
  1228. }
  1229. }
  1230. // Error returns any retrieval or parsing error occurred during filtering.
  1231. func (it *MintableERC20MintIterator) Error() error {
  1232. return it.fail
  1233. }
  1234. // Close terminates the iteration process, releasing any pending underlying
  1235. // resources.
  1236. func (it *MintableERC20MintIterator) Close() error {
  1237. it.sub.Unsubscribe()
  1238. return nil
  1239. }
  1240. // MintableERC20Mint represents a Mint event raised by the MintableERC20 contract.
  1241. type MintableERC20Mint struct {
  1242. To common.Address
  1243. Amount *big.Int
  1244. Raw types.Log // Blockchain specific contextual infos
  1245. }
  1246. // FilterMint is a free log retrieval operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885.
  1247. //
  1248. // Solidity: event Mint(address indexed to, uint256 amount)
  1249. func (_MintableERC20 *MintableERC20Filterer) FilterMint(opts *bind.FilterOpts, to []common.Address) (*MintableERC20MintIterator, error) {
  1250. var toRule []interface{}
  1251. for _, toItem := range to {
  1252. toRule = append(toRule, toItem)
  1253. }
  1254. logs, sub, err := _MintableERC20.contract.FilterLogs(opts, "Mint", toRule)
  1255. if err != nil {
  1256. return nil, err
  1257. }
  1258. return &MintableERC20MintIterator{contract: _MintableERC20.contract, event: "Mint", logs: logs, sub: sub}, nil
  1259. }
  1260. // WatchMint is a free log subscription operation binding the contract event 0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885.
  1261. //
  1262. // Solidity: event Mint(address indexed to, uint256 amount)
  1263. func (_MintableERC20 *MintableERC20Filterer) WatchMint(opts *bind.WatchOpts, sink chan<- *MintableERC20Mint, to []common.Address) (event.Subscription, error) {
  1264. var toRule []interface{}
  1265. for _, toItem := range to {
  1266. toRule = append(toRule, toItem)
  1267. }
  1268. logs, sub, err := _MintableERC20.contract.WatchLogs(opts, "Mint", toRule)
  1269. if err != nil {
  1270. return nil, err
  1271. }
  1272. return event.NewSubscription(func(quit <-chan struct{}) error {
  1273. defer sub.Unsubscribe()
  1274. for {
  1275. select {
  1276. case log := <-logs:
  1277. // New log arrived, parse the event and forward to the user
  1278. event := new(MintableERC20Mint)
  1279. if err := _MintableERC20.contract.UnpackLog(event, "Mint", log); err != nil {
  1280. return err
  1281. }
  1282. event.Raw = log
  1283. select {
  1284. case sink <- event:
  1285. case err := <-sub.Err():
  1286. return err
  1287. case <-quit:
  1288. return nil
  1289. }
  1290. case err := <-sub.Err():
  1291. return err
  1292. case <-quit:
  1293. return nil
  1294. }
  1295. }
  1296. }), nil
  1297. }
  1298. // 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.
  1299. type MintableERC20TransferIterator struct {
  1300. Event *MintableERC20Transfer // Event containing the contract specifics and raw log
  1301. contract *bind.BoundContract // Generic contract to use for unpacking event data
  1302. event string // Event name to use for unpacking event data
  1303. logs chan types.Log // Log channel receiving the found contract events
  1304. sub ethereum.Subscription // Subscription for errors, completion and termination
  1305. done bool // Whether the subscription completed delivering logs
  1306. fail error // Occurred error to stop iteration
  1307. }
  1308. // Next advances the iterator to the subsequent event, returning whether there
  1309. // are any more events found. In case of a retrieval or parsing error, false is
  1310. // returned and Error() can be queried for the exact failure.
  1311. func (it *MintableERC20TransferIterator) Next() bool {
  1312. // If the iterator failed, stop iterating
  1313. if it.fail != nil {
  1314. return false
  1315. }
  1316. // If the iterator completed, deliver directly whatever's available
  1317. if it.done {
  1318. select {
  1319. case log := <-it.logs:
  1320. it.Event = new(MintableERC20Transfer)
  1321. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  1322. it.fail = err
  1323. return false
  1324. }
  1325. it.Event.Raw = log
  1326. return true
  1327. default:
  1328. return false
  1329. }
  1330. }
  1331. // Iterator still in progress, wait for either a data or an error event
  1332. select {
  1333. case log := <-it.logs:
  1334. it.Event = new(MintableERC20Transfer)
  1335. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  1336. it.fail = err
  1337. return false
  1338. }
  1339. it.Event.Raw = log
  1340. return true
  1341. case err := <-it.sub.Err():
  1342. it.done = true
  1343. it.fail = err
  1344. return it.Next()
  1345. }
  1346. }
  1347. // Error returns any retrieval or parsing error occurred during filtering.
  1348. func (it *MintableERC20TransferIterator) Error() error {
  1349. return it.fail
  1350. }
  1351. // Close terminates the iteration process, releasing any pending underlying
  1352. // resources.
  1353. func (it *MintableERC20TransferIterator) Close() error {
  1354. it.sub.Unsubscribe()
  1355. return nil
  1356. }
  1357. // MintableERC20Transfer represents a Transfer event raised by the MintableERC20 contract.
  1358. type MintableERC20Transfer struct {
  1359. From common.Address
  1360. To common.Address
  1361. Value *big.Int
  1362. Raw types.Log // Blockchain specific contextual infos
  1363. }
  1364. // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
  1365. //
  1366. // Solidity: event Transfer(address indexed from, address indexed to, uint256 value)
  1367. func (_MintableERC20 *MintableERC20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*MintableERC20TransferIterator, error) {
  1368. var fromRule []interface{}
  1369. for _, fromItem := range from {
  1370. fromRule = append(fromRule, fromItem)
  1371. }
  1372. var toRule []interface{}
  1373. for _, toItem := range to {
  1374. toRule = append(toRule, toItem)
  1375. }
  1376. logs, sub, err := _MintableERC20.contract.FilterLogs(opts, "Transfer", fromRule, toRule)
  1377. if err != nil {
  1378. return nil, err
  1379. }
  1380. return &MintableERC20TransferIterator{contract: _MintableERC20.contract, event: "Transfer", logs: logs, sub: sub}, nil
  1381. }
  1382. // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
  1383. //
  1384. // Solidity: event Transfer(address indexed from, address indexed to, uint256 value)
  1385. func (_MintableERC20 *MintableERC20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *MintableERC20Transfer, from []common.Address, to []common.Address) (event.Subscription, error) {
  1386. var fromRule []interface{}
  1387. for _, fromItem := range from {
  1388. fromRule = append(fromRule, fromItem)
  1389. }
  1390. var toRule []interface{}
  1391. for _, toItem := range to {
  1392. toRule = append(toRule, toItem)
  1393. }
  1394. logs, sub, err := _MintableERC20.contract.WatchLogs(opts, "Transfer", fromRule, toRule)
  1395. if err != nil {
  1396. return nil, err
  1397. }
  1398. return event.NewSubscription(func(quit <-chan struct{}) error {
  1399. defer sub.Unsubscribe()
  1400. for {
  1401. select {
  1402. case log := <-logs:
  1403. // New log arrived, parse the event and forward to the user
  1404. event := new(MintableERC20Transfer)
  1405. if err := _MintableERC20.contract.UnpackLog(event, "Transfer", log); err != nil {
  1406. return err
  1407. }
  1408. event.Raw = log
  1409. select {
  1410. case sink <- event:
  1411. case err := <-sub.Err():
  1412. return err
  1413. case <-quit:
  1414. return nil
  1415. }
  1416. case err := <-sub.Err():
  1417. return err
  1418. case <-quit:
  1419. return nil
  1420. }
  1421. }
  1422. }), nil
  1423. }
  1424. // SafeMathABI is the input ABI used to generate the binding from.
  1425. const SafeMathABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"a\",\"type\":\"uint256\"}],\"name\":\"sqrt\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"}]"
  1426. // SafeMathBin is the compiled bytecode used for deploying new contracts.
  1427. const SafeMathBin = `0x61016b610030600b82828239805160001a6073146000811461002057610022565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600436106100575763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663677342ce811461005c575b600080fd5b610067600435610079565b60408051918252519081900360200190f35b6000808083151561008d5760009250610138565b6001840184106100fe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f466c6177656420696e70757420666f7220737172740000000000000000000000604482015290519081900360640190fd5b505060026001830104825b80821015610134575080600281808681151561012157fe5b040181151561012c57fe5b049150610109565b8192505b50509190505600a165627a7a723058209973030427b153e03b78d7e03b4edc80d78b5dc021f0b5fc92844e037d38d8330029`
  1428. // DeploySafeMath deploys a new Ethereum contract, binding an instance of SafeMath to it.
  1429. func DeploySafeMath(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SafeMath, error) {
  1430. parsed, err := abi.JSON(strings.NewReader(SafeMathABI))
  1431. if err != nil {
  1432. return common.Address{}, nil, nil, err
  1433. }
  1434. address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(SafeMathBin), backend)
  1435. if err != nil {
  1436. return common.Address{}, nil, nil, err
  1437. }
  1438. return address, tx, &SafeMath{SafeMathCaller: SafeMathCaller{contract: contract}, SafeMathTransactor: SafeMathTransactor{contract: contract}, SafeMathFilterer: SafeMathFilterer{contract: contract}}, nil
  1439. }
  1440. // SafeMath is an auto generated Go binding around an Ethereum contract.
  1441. type SafeMath struct {
  1442. SafeMathCaller // Read-only binding to the contract
  1443. SafeMathTransactor // Write-only binding to the contract
  1444. SafeMathFilterer // Log filterer for contract events
  1445. }
  1446. // SafeMathCaller is an auto generated read-only Go binding around an Ethereum contract.
  1447. type SafeMathCaller struct {
  1448. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  1449. }
  1450. // SafeMathTransactor is an auto generated write-only Go binding around an Ethereum contract.
  1451. type SafeMathTransactor struct {
  1452. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  1453. }
  1454. // SafeMathFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
  1455. type SafeMathFilterer struct {
  1456. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  1457. }
  1458. // SafeMathSession is an auto generated Go binding around an Ethereum contract,
  1459. // with pre-set call and transact options.
  1460. type SafeMathSession struct {
  1461. Contract *SafeMath // Generic contract binding to set the session for
  1462. CallOpts bind.CallOpts // Call options to use throughout this session
  1463. TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
  1464. }
  1465. // SafeMathCallerSession is an auto generated read-only Go binding around an Ethereum contract,
  1466. // with pre-set call options.
  1467. type SafeMathCallerSession struct {
  1468. Contract *SafeMathCaller // Generic contract caller binding to set the session for
  1469. CallOpts bind.CallOpts // Call options to use throughout this session
  1470. }
  1471. // SafeMathTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
  1472. // with pre-set transact options.
  1473. type SafeMathTransactorSession struct {
  1474. Contract *SafeMathTransactor // Generic contract transactor binding to set the session for
  1475. TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
  1476. }
  1477. // SafeMathRaw is an auto generated low-level Go binding around an Ethereum contract.
  1478. type SafeMathRaw struct {
  1479. Contract *SafeMath // Generic contract binding to access the raw methods on
  1480. }
  1481. // SafeMathCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
  1482. type SafeMathCallerRaw struct {
  1483. Contract *SafeMathCaller // Generic read-only contract binding to access the raw methods on
  1484. }
  1485. // SafeMathTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
  1486. type SafeMathTransactorRaw struct {
  1487. Contract *SafeMathTransactor // Generic write-only contract binding to access the raw methods on
  1488. }
  1489. // NewSafeMath creates a new instance of SafeMath, bound to a specific deployed contract.
  1490. func NewSafeMath(address common.Address, backend bind.ContractBackend) (*SafeMath, error) {
  1491. contract, err := bindSafeMath(address, backend, backend, backend)
  1492. if err != nil {
  1493. return nil, err
  1494. }
  1495. return &SafeMath{SafeMathCaller: SafeMathCaller{contract: contract}, SafeMathTransactor: SafeMathTransactor{contract: contract}, SafeMathFilterer: SafeMathFilterer{contract: contract}}, nil
  1496. }
  1497. // NewSafeMathCaller creates a new read-only instance of SafeMath, bound to a specific deployed contract.
  1498. func NewSafeMathCaller(address common.Address, caller bind.ContractCaller) (*SafeMathCaller, error) {
  1499. contract, err := bindSafeMath(address, caller, nil, nil)
  1500. if err != nil {
  1501. return nil, err
  1502. }
  1503. return &SafeMathCaller{contract: contract}, nil
  1504. }
  1505. // NewSafeMathTransactor creates a new write-only instance of SafeMath, bound to a specific deployed contract.
  1506. func NewSafeMathTransactor(address common.Address, transactor bind.ContractTransactor) (*SafeMathTransactor, error) {
  1507. contract, err := bindSafeMath(address, nil, transactor, nil)
  1508. if err != nil {
  1509. return nil, err
  1510. }
  1511. return &SafeMathTransactor{contract: contract}, nil
  1512. }
  1513. // NewSafeMathFilterer creates a new log filterer instance of SafeMath, bound to a specific deployed contract.
  1514. func NewSafeMathFilterer(address common.Address, filterer bind.ContractFilterer) (*SafeMathFilterer, error) {
  1515. contract, err := bindSafeMath(address, nil, nil, filterer)
  1516. if err != nil {
  1517. return nil, err
  1518. }
  1519. return &SafeMathFilterer{contract: contract}, nil
  1520. }
  1521. // bindSafeMath binds a generic wrapper to an already deployed contract.
  1522. func bindSafeMath(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
  1523. parsed, err := abi.JSON(strings.NewReader(SafeMathABI))
  1524. if err != nil {
  1525. return nil, err
  1526. }
  1527. return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
  1528. }
  1529. // Call invokes the (constant) contract method with params as input values and
  1530. // sets the output to result. The result type might be a single field for simple
  1531. // returns, a slice of interfaces for anonymous returns and a struct for named
  1532. // returns.
  1533. func (_SafeMath *SafeMathRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
  1534. return _SafeMath.Contract.SafeMathCaller.contract.Call(opts, result, method, params...)
  1535. }
  1536. // Transfer initiates a plain transaction to move funds to the contract, calling
  1537. // its default method if one is available.
  1538. func (_SafeMath *SafeMathRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
  1539. return _SafeMath.Contract.SafeMathTransactor.contract.Transfer(opts)
  1540. }
  1541. // Transact invokes the (paid) contract method with params as input values.
  1542. func (_SafeMath *SafeMathRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
  1543. return _SafeMath.Contract.SafeMathTransactor.contract.Transact(opts, method, params...)
  1544. }
  1545. // Call invokes the (constant) contract method with params as input values and
  1546. // sets the output to result. The result type might be a single field for simple
  1547. // returns, a slice of interfaces for anonymous returns and a struct for named
  1548. // returns.
  1549. func (_SafeMath *SafeMathCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
  1550. return _SafeMath.Contract.contract.Call(opts, result, method, params...)
  1551. }
  1552. // Transfer initiates a plain transaction to move funds to the contract, calling
  1553. // its default method if one is available.
  1554. func (_SafeMath *SafeMathTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
  1555. return _SafeMath.Contract.contract.Transfer(opts)
  1556. }
  1557. // Transact invokes the (paid) contract method with params as input values.
  1558. func (_SafeMath *SafeMathTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
  1559. return _SafeMath.Contract.contract.Transact(opts, method, params...)
  1560. }
  1561. // Sqrt is a free data retrieval call binding the contract method 0x677342ce.
  1562. //
  1563. // Solidity: function sqrt(uint256 a) constant returns(uint256)
  1564. func (_SafeMath *SafeMathCaller) Sqrt(opts *bind.CallOpts, a *big.Int) (*big.Int, error) {
  1565. var (
  1566. ret0 = new(*big.Int)
  1567. )
  1568. out := ret0
  1569. err := _SafeMath.contract.Call(opts, out, "sqrt", a)
  1570. return *ret0, err
  1571. }
  1572. // Sqrt is a free data retrieval call binding the contract method 0x677342ce.
  1573. //
  1574. // Solidity: function sqrt(uint256 a) constant returns(uint256)
  1575. func (_SafeMath *SafeMathSession) Sqrt(a *big.Int) (*big.Int, error) {
  1576. return _SafeMath.Contract.Sqrt(&_SafeMath.CallOpts, a)
  1577. }
  1578. // Sqrt is a free data retrieval call binding the contract method 0x677342ce.
  1579. //
  1580. // Solidity: function sqrt(uint256 a) constant returns(uint256)
  1581. func (_SafeMath *SafeMathCallerSession) Sqrt(a *big.Int) (*big.Int, error) {
  1582. return _SafeMath.Contract.Sqrt(&_SafeMath.CallOpts, a)
  1583. }