abi.go 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  1. // Code generated - DO NOT EDIT.
  2. // This file is a generated binding and any manual changes will be lost.
  3. package erc20
  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. _ = bind.Bind
  20. _ = common.Big1
  21. _ = types.BloomLookup
  22. _ = event.NewSubscription
  23. )
  24. // Erc20ABI is the input ABI used to generate the binding from.
  25. const Erc20ABI = "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"
  26. // Erc20 is an auto generated Go binding around an Ethereum contract.
  27. type Erc20 struct {
  28. Erc20Caller // Read-only binding to the contract
  29. Erc20Transactor // Write-only binding to the contract
  30. Erc20Filterer // Log filterer for contract events
  31. }
  32. // Erc20Caller is an auto generated read-only Go binding around an Ethereum contract.
  33. type Erc20Caller struct {
  34. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  35. }
  36. // Erc20Transactor is an auto generated write-only Go binding around an Ethereum contract.
  37. type Erc20Transactor struct {
  38. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  39. }
  40. // Erc20Filterer is an auto generated log filtering Go binding around an Ethereum contract events.
  41. type Erc20Filterer struct {
  42. contract *bind.BoundContract // Generic contract wrapper for the low level calls
  43. }
  44. // Erc20Session is an auto generated Go binding around an Ethereum contract,
  45. // with pre-set call and transact options.
  46. type Erc20Session struct {
  47. Contract *Erc20 // Generic contract binding to set the session for
  48. CallOpts bind.CallOpts // Call options to use throughout this session
  49. TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
  50. }
  51. // Erc20CallerSession is an auto generated read-only Go binding around an Ethereum contract,
  52. // with pre-set call options.
  53. type Erc20CallerSession struct {
  54. Contract *Erc20Caller // Generic contract caller binding to set the session for
  55. CallOpts bind.CallOpts // Call options to use throughout this session
  56. }
  57. // Erc20TransactorSession is an auto generated write-only Go binding around an Ethereum contract,
  58. // with pre-set transact options.
  59. type Erc20TransactorSession struct {
  60. Contract *Erc20Transactor // Generic contract transactor binding to set the session for
  61. TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
  62. }
  63. // Erc20Raw is an auto generated low-level Go binding around an Ethereum contract.
  64. type Erc20Raw struct {
  65. Contract *Erc20 // Generic contract binding to access the raw methods on
  66. }
  67. // Erc20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
  68. type Erc20CallerRaw struct {
  69. Contract *Erc20Caller // Generic read-only contract binding to access the raw methods on
  70. }
  71. // Erc20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
  72. type Erc20TransactorRaw struct {
  73. Contract *Erc20Transactor // Generic write-only contract binding to access the raw methods on
  74. }
  75. // NewErc20 creates a new instance of Erc20, bound to a specific deployed contract.
  76. func NewErc20(address common.Address, backend bind.ContractBackend) (*Erc20, error) {
  77. contract, err := bindErc20(address, backend, backend, backend)
  78. if err != nil {
  79. return nil, err
  80. }
  81. return &Erc20{Erc20Caller: Erc20Caller{contract: contract}, Erc20Transactor: Erc20Transactor{contract: contract}, Erc20Filterer: Erc20Filterer{contract: contract}}, nil
  82. }
  83. // NewErc20Caller creates a new read-only instance of Erc20, bound to a specific deployed contract.
  84. func NewErc20Caller(address common.Address, caller bind.ContractCaller) (*Erc20Caller, error) {
  85. contract, err := bindErc20(address, caller, nil, nil)
  86. if err != nil {
  87. return nil, err
  88. }
  89. return &Erc20Caller{contract: contract}, nil
  90. }
  91. // NewErc20Transactor creates a new write-only instance of Erc20, bound to a specific deployed contract.
  92. func NewErc20Transactor(address common.Address, transactor bind.ContractTransactor) (*Erc20Transactor, error) {
  93. contract, err := bindErc20(address, nil, transactor, nil)
  94. if err != nil {
  95. return nil, err
  96. }
  97. return &Erc20Transactor{contract: contract}, nil
  98. }
  99. // NewErc20Filterer creates a new log filterer instance of Erc20, bound to a specific deployed contract.
  100. func NewErc20Filterer(address common.Address, filterer bind.ContractFilterer) (*Erc20Filterer, error) {
  101. contract, err := bindErc20(address, nil, nil, filterer)
  102. if err != nil {
  103. return nil, err
  104. }
  105. return &Erc20Filterer{contract: contract}, nil
  106. }
  107. // bindErc20 binds a generic wrapper to an already deployed contract.
  108. func bindErc20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
  109. parsed, err := abi.JSON(strings.NewReader(Erc20ABI))
  110. if err != nil {
  111. return nil, err
  112. }
  113. return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
  114. }
  115. // Call invokes the (constant) contract method with params as input values and
  116. // sets the output to result. The result type might be a single field for simple
  117. // returns, a slice of interfaces for anonymous returns and a struct for named
  118. // returns.
  119. func (_Erc20 *Erc20Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
  120. return _Erc20.Contract.Erc20Caller.contract.Call(opts, result, method, params...)
  121. }
  122. // Transfer initiates a plain transaction to move funds to the contract, calling
  123. // its default method if one is available.
  124. func (_Erc20 *Erc20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
  125. return _Erc20.Contract.Erc20Transactor.contract.Transfer(opts)
  126. }
  127. // Transact invokes the (paid) contract method with params as input values.
  128. func (_Erc20 *Erc20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
  129. return _Erc20.Contract.Erc20Transactor.contract.Transact(opts, method, params...)
  130. }
  131. // Call invokes the (constant) contract method with params as input values and
  132. // sets the output to result. The result type might be a single field for simple
  133. // returns, a slice of interfaces for anonymous returns and a struct for named
  134. // returns.
  135. func (_Erc20 *Erc20CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
  136. return _Erc20.Contract.contract.Call(opts, result, method, params...)
  137. }
  138. // Transfer initiates a plain transaction to move funds to the contract, calling
  139. // its default method if one is available.
  140. func (_Erc20 *Erc20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
  141. return _Erc20.Contract.contract.Transfer(opts)
  142. }
  143. // Transact invokes the (paid) contract method with params as input values.
  144. func (_Erc20 *Erc20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
  145. return _Erc20.Contract.contract.Transact(opts, method, params...)
  146. }
  147. // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e.
  148. //
  149. // Solidity: function allowance(address owner, address spender) view returns(uint256)
  150. func (_Erc20 *Erc20Caller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) {
  151. var out []interface{}
  152. err := _Erc20.contract.Call(opts, &out, "allowance", owner, spender)
  153. if err != nil {
  154. return *new(*big.Int), err
  155. }
  156. out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
  157. return out0, err
  158. }
  159. // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e.
  160. //
  161. // Solidity: function allowance(address owner, address spender) view returns(uint256)
  162. func (_Erc20 *Erc20Session) Allowance(owner common.Address, spender common.Address) (*big.Int, error) {
  163. return _Erc20.Contract.Allowance(&_Erc20.CallOpts, owner, spender)
  164. }
  165. // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e.
  166. //
  167. // Solidity: function allowance(address owner, address spender) view returns(uint256)
  168. func (_Erc20 *Erc20CallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) {
  169. return _Erc20.Contract.Allowance(&_Erc20.CallOpts, owner, spender)
  170. }
  171. // BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
  172. //
  173. // Solidity: function balanceOf(address account) view returns(uint256)
  174. func (_Erc20 *Erc20Caller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) {
  175. var out []interface{}
  176. err := _Erc20.contract.Call(opts, &out, "balanceOf", account)
  177. if err != nil {
  178. return *new(*big.Int), err
  179. }
  180. out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
  181. return out0, err
  182. }
  183. // BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
  184. //
  185. // Solidity: function balanceOf(address account) view returns(uint256)
  186. func (_Erc20 *Erc20Session) BalanceOf(account common.Address) (*big.Int, error) {
  187. return _Erc20.Contract.BalanceOf(&_Erc20.CallOpts, account)
  188. }
  189. // BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
  190. //
  191. // Solidity: function balanceOf(address account) view returns(uint256)
  192. func (_Erc20 *Erc20CallerSession) BalanceOf(account common.Address) (*big.Int, error) {
  193. return _Erc20.Contract.BalanceOf(&_Erc20.CallOpts, account)
  194. }
  195. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
  196. //
  197. // Solidity: function decimals() view returns(uint8)
  198. func (_Erc20 *Erc20Caller) Decimals(opts *bind.CallOpts) (uint8, error) {
  199. var out []interface{}
  200. err := _Erc20.contract.Call(opts, &out, "decimals")
  201. if err != nil {
  202. return *new(uint8), err
  203. }
  204. out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8)
  205. return out0, err
  206. }
  207. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
  208. //
  209. // Solidity: function decimals() view returns(uint8)
  210. func (_Erc20 *Erc20Session) Decimals() (uint8, error) {
  211. return _Erc20.Contract.Decimals(&_Erc20.CallOpts)
  212. }
  213. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
  214. //
  215. // Solidity: function decimals() view returns(uint8)
  216. func (_Erc20 *Erc20CallerSession) Decimals() (uint8, error) {
  217. return _Erc20.Contract.Decimals(&_Erc20.CallOpts)
  218. }
  219. // Name is a free data retrieval call binding the contract method 0x06fdde03.
  220. //
  221. // Solidity: function name() view returns(string)
  222. func (_Erc20 *Erc20Caller) Name(opts *bind.CallOpts) (string, error) {
  223. var out []interface{}
  224. err := _Erc20.contract.Call(opts, &out, "name")
  225. if err != nil {
  226. return *new(string), err
  227. }
  228. out0 := *abi.ConvertType(out[0], new(string)).(*string)
  229. return out0, err
  230. }
  231. // Name is a free data retrieval call binding the contract method 0x06fdde03.
  232. //
  233. // Solidity: function name() view returns(string)
  234. func (_Erc20 *Erc20Session) Name() (string, error) {
  235. return _Erc20.Contract.Name(&_Erc20.CallOpts)
  236. }
  237. // Name is a free data retrieval call binding the contract method 0x06fdde03.
  238. //
  239. // Solidity: function name() view returns(string)
  240. func (_Erc20 *Erc20CallerSession) Name() (string, error) {
  241. return _Erc20.Contract.Name(&_Erc20.CallOpts)
  242. }
  243. // Symbol is a free data retrieval call binding the contract method 0x95d89b41.
  244. //
  245. // Solidity: function symbol() view returns(string)
  246. func (_Erc20 *Erc20Caller) Symbol(opts *bind.CallOpts) (string, error) {
  247. var out []interface{}
  248. err := _Erc20.contract.Call(opts, &out, "symbol")
  249. if err != nil {
  250. return *new(string), err
  251. }
  252. out0 := *abi.ConvertType(out[0], new(string)).(*string)
  253. return out0, err
  254. }
  255. // Symbol is a free data retrieval call binding the contract method 0x95d89b41.
  256. //
  257. // Solidity: function symbol() view returns(string)
  258. func (_Erc20 *Erc20Session) Symbol() (string, error) {
  259. return _Erc20.Contract.Symbol(&_Erc20.CallOpts)
  260. }
  261. // Symbol is a free data retrieval call binding the contract method 0x95d89b41.
  262. //
  263. // Solidity: function symbol() view returns(string)
  264. func (_Erc20 *Erc20CallerSession) Symbol() (string, error) {
  265. return _Erc20.Contract.Symbol(&_Erc20.CallOpts)
  266. }
  267. // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
  268. //
  269. // Solidity: function totalSupply() view returns(uint256)
  270. func (_Erc20 *Erc20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) {
  271. var out []interface{}
  272. err := _Erc20.contract.Call(opts, &out, "totalSupply")
  273. if err != nil {
  274. return *new(*big.Int), err
  275. }
  276. out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
  277. return out0, err
  278. }
  279. // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
  280. //
  281. // Solidity: function totalSupply() view returns(uint256)
  282. func (_Erc20 *Erc20Session) TotalSupply() (*big.Int, error) {
  283. return _Erc20.Contract.TotalSupply(&_Erc20.CallOpts)
  284. }
  285. // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
  286. //
  287. // Solidity: function totalSupply() view returns(uint256)
  288. func (_Erc20 *Erc20CallerSession) TotalSupply() (*big.Int, error) {
  289. return _Erc20.Contract.TotalSupply(&_Erc20.CallOpts)
  290. }
  291. // Approve is a paid mutator transaction binding the contract method 0x095ea7b3.
  292. //
  293. // Solidity: function approve(address spender, uint256 amount) returns(bool)
  294. func (_Erc20 *Erc20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) {
  295. return _Erc20.contract.Transact(opts, "approve", spender, amount)
  296. }
  297. // Approve is a paid mutator transaction binding the contract method 0x095ea7b3.
  298. //
  299. // Solidity: function approve(address spender, uint256 amount) returns(bool)
  300. func (_Erc20 *Erc20Session) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {
  301. return _Erc20.Contract.Approve(&_Erc20.TransactOpts, spender, amount)
  302. }
  303. // Approve is a paid mutator transaction binding the contract method 0x095ea7b3.
  304. //
  305. // Solidity: function approve(address spender, uint256 amount) returns(bool)
  306. func (_Erc20 *Erc20TransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) {
  307. return _Erc20.Contract.Approve(&_Erc20.TransactOpts, spender, amount)
  308. }
  309. // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7.
  310. //
  311. // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool)
  312. func (_Erc20 *Erc20Transactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) {
  313. return _Erc20.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue)
  314. }
  315. // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7.
  316. //
  317. // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool)
  318. func (_Erc20 *Erc20Session) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) {
  319. return _Erc20.Contract.DecreaseAllowance(&_Erc20.TransactOpts, spender, subtractedValue)
  320. }
  321. // DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7.
  322. //
  323. // Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool)
  324. func (_Erc20 *Erc20TransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) {
  325. return _Erc20.Contract.DecreaseAllowance(&_Erc20.TransactOpts, spender, subtractedValue)
  326. }
  327. // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351.
  328. //
  329. // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool)
  330. func (_Erc20 *Erc20Transactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) {
  331. return _Erc20.contract.Transact(opts, "increaseAllowance", spender, addedValue)
  332. }
  333. // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351.
  334. //
  335. // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool)
  336. func (_Erc20 *Erc20Session) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) {
  337. return _Erc20.Contract.IncreaseAllowance(&_Erc20.TransactOpts, spender, addedValue)
  338. }
  339. // IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351.
  340. //
  341. // Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool)
  342. func (_Erc20 *Erc20TransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) {
  343. return _Erc20.Contract.IncreaseAllowance(&_Erc20.TransactOpts, spender, addedValue)
  344. }
  345. // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb.
  346. //
  347. // Solidity: function transfer(address recipient, uint256 amount) returns(bool)
  348. func (_Erc20 *Erc20Transactor) Transfer(opts *bind.TransactOpts, recipient common.Address, amount *big.Int) (*types.Transaction, error) {
  349. return _Erc20.contract.Transact(opts, "transfer", recipient, amount)
  350. }
  351. // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb.
  352. //
  353. // Solidity: function transfer(address recipient, uint256 amount) returns(bool)
  354. func (_Erc20 *Erc20Session) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) {
  355. return _Erc20.Contract.Transfer(&_Erc20.TransactOpts, recipient, amount)
  356. }
  357. // Transfer is a paid mutator transaction binding the contract method 0xa9059cbb.
  358. //
  359. // Solidity: function transfer(address recipient, uint256 amount) returns(bool)
  360. func (_Erc20 *Erc20TransactorSession) Transfer(recipient common.Address, amount *big.Int) (*types.Transaction, error) {
  361. return _Erc20.Contract.Transfer(&_Erc20.TransactOpts, recipient, amount)
  362. }
  363. // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd.
  364. //
  365. // Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool)
  366. func (_Erc20 *Erc20Transactor) TransferFrom(opts *bind.TransactOpts, sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) {
  367. return _Erc20.contract.Transact(opts, "transferFrom", sender, recipient, amount)
  368. }
  369. // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd.
  370. //
  371. // Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool)
  372. func (_Erc20 *Erc20Session) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) {
  373. return _Erc20.Contract.TransferFrom(&_Erc20.TransactOpts, sender, recipient, amount)
  374. }
  375. // TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd.
  376. //
  377. // Solidity: function transferFrom(address sender, address recipient, uint256 amount) returns(bool)
  378. func (_Erc20 *Erc20TransactorSession) TransferFrom(sender common.Address, recipient common.Address, amount *big.Int) (*types.Transaction, error) {
  379. return _Erc20.Contract.TransferFrom(&_Erc20.TransactOpts, sender, recipient, amount)
  380. }
  381. // 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.
  382. type Erc20ApprovalIterator struct {
  383. Event *Erc20Approval // Event containing the contract specifics and raw log
  384. contract *bind.BoundContract // Generic contract to use for unpacking event data
  385. event string // Event name to use for unpacking event data
  386. logs chan types.Log // Log channel receiving the found contract events
  387. sub ethereum.Subscription // Subscription for errors, completion and termination
  388. done bool // Whether the subscription completed delivering logs
  389. fail error // Occurred error to stop iteration
  390. }
  391. // Next advances the iterator to the subsequent event, returning whether there
  392. // are any more events found. In case of a retrieval or parsing error, false is
  393. // returned and Error() can be queried for the exact failure.
  394. func (it *Erc20ApprovalIterator) Next() bool {
  395. // If the iterator failed, stop iterating
  396. if it.fail != nil {
  397. return false
  398. }
  399. // If the iterator completed, deliver directly whatever's available
  400. if it.done {
  401. select {
  402. case log := <-it.logs:
  403. it.Event = new(Erc20Approval)
  404. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  405. it.fail = err
  406. return false
  407. }
  408. it.Event.Raw = log
  409. return true
  410. default:
  411. return false
  412. }
  413. }
  414. // Iterator still in progress, wait for either a data or an error event
  415. select {
  416. case log := <-it.logs:
  417. it.Event = new(Erc20Approval)
  418. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  419. it.fail = err
  420. return false
  421. }
  422. it.Event.Raw = log
  423. return true
  424. case err := <-it.sub.Err():
  425. it.done = true
  426. it.fail = err
  427. return it.Next()
  428. }
  429. }
  430. // Error returns any retrieval or parsing error occurred during filtering.
  431. func (it *Erc20ApprovalIterator) Error() error {
  432. return it.fail
  433. }
  434. // Close terminates the iteration process, releasing any pending underlying
  435. // resources.
  436. func (it *Erc20ApprovalIterator) Close() error {
  437. it.sub.Unsubscribe()
  438. return nil
  439. }
  440. // Erc20Approval represents a Approval event raised by the Erc20 contract.
  441. type Erc20Approval struct {
  442. Owner common.Address
  443. Spender common.Address
  444. Value *big.Int
  445. Raw types.Log // Blockchain specific contextual infos
  446. }
  447. // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925.
  448. //
  449. // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value)
  450. func (_Erc20 *Erc20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*Erc20ApprovalIterator, error) {
  451. var ownerRule []interface{}
  452. for _, ownerItem := range owner {
  453. ownerRule = append(ownerRule, ownerItem)
  454. }
  455. var spenderRule []interface{}
  456. for _, spenderItem := range spender {
  457. spenderRule = append(spenderRule, spenderItem)
  458. }
  459. logs, sub, err := _Erc20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule)
  460. if err != nil {
  461. return nil, err
  462. }
  463. return &Erc20ApprovalIterator{contract: _Erc20.contract, event: "Approval", logs: logs, sub: sub}, nil
  464. }
  465. // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925.
  466. //
  467. // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value)
  468. func (_Erc20 *Erc20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *Erc20Approval, owner []common.Address, spender []common.Address) (event.Subscription, error) {
  469. var ownerRule []interface{}
  470. for _, ownerItem := range owner {
  471. ownerRule = append(ownerRule, ownerItem)
  472. }
  473. var spenderRule []interface{}
  474. for _, spenderItem := range spender {
  475. spenderRule = append(spenderRule, spenderItem)
  476. }
  477. logs, sub, err := _Erc20.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule)
  478. if err != nil {
  479. return nil, err
  480. }
  481. return event.NewSubscription(func(quit <-chan struct{}) error {
  482. defer sub.Unsubscribe()
  483. for {
  484. select {
  485. case log := <-logs:
  486. // New log arrived, parse the event and forward to the user
  487. event := new(Erc20Approval)
  488. if err := _Erc20.contract.UnpackLog(event, "Approval", log); err != nil {
  489. return err
  490. }
  491. event.Raw = log
  492. select {
  493. case sink <- event:
  494. case err := <-sub.Err():
  495. return err
  496. case <-quit:
  497. return nil
  498. }
  499. case err := <-sub.Err():
  500. return err
  501. case <-quit:
  502. return nil
  503. }
  504. }
  505. }), nil
  506. }
  507. // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925.
  508. //
  509. // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value)
  510. func (_Erc20 *Erc20Filterer) ParseApproval(log types.Log) (*Erc20Approval, error) {
  511. event := new(Erc20Approval)
  512. if err := _Erc20.contract.UnpackLog(event, "Approval", log); err != nil {
  513. return nil, err
  514. }
  515. return event, nil
  516. }
  517. // 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.
  518. type Erc20TransferIterator struct {
  519. Event *Erc20Transfer // Event containing the contract specifics and raw log
  520. contract *bind.BoundContract // Generic contract to use for unpacking event data
  521. event string // Event name to use for unpacking event data
  522. logs chan types.Log // Log channel receiving the found contract events
  523. sub ethereum.Subscription // Subscription for errors, completion and termination
  524. done bool // Whether the subscription completed delivering logs
  525. fail error // Occurred error to stop iteration
  526. }
  527. // Next advances the iterator to the subsequent event, returning whether there
  528. // are any more events found. In case of a retrieval or parsing error, false is
  529. // returned and Error() can be queried for the exact failure.
  530. func (it *Erc20TransferIterator) Next() bool {
  531. // If the iterator failed, stop iterating
  532. if it.fail != nil {
  533. return false
  534. }
  535. // If the iterator completed, deliver directly whatever's available
  536. if it.done {
  537. select {
  538. case log := <-it.logs:
  539. it.Event = new(Erc20Transfer)
  540. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  541. it.fail = err
  542. return false
  543. }
  544. it.Event.Raw = log
  545. return true
  546. default:
  547. return false
  548. }
  549. }
  550. // Iterator still in progress, wait for either a data or an error event
  551. select {
  552. case log := <-it.logs:
  553. it.Event = new(Erc20Transfer)
  554. if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
  555. it.fail = err
  556. return false
  557. }
  558. it.Event.Raw = log
  559. return true
  560. case err := <-it.sub.Err():
  561. it.done = true
  562. it.fail = err
  563. return it.Next()
  564. }
  565. }
  566. // Error returns any retrieval or parsing error occurred during filtering.
  567. func (it *Erc20TransferIterator) Error() error {
  568. return it.fail
  569. }
  570. // Close terminates the iteration process, releasing any pending underlying
  571. // resources.
  572. func (it *Erc20TransferIterator) Close() error {
  573. it.sub.Unsubscribe()
  574. return nil
  575. }
  576. // Erc20Transfer represents a Transfer event raised by the Erc20 contract.
  577. type Erc20Transfer struct {
  578. From common.Address
  579. To common.Address
  580. Value *big.Int
  581. Raw types.Log // Blockchain specific contextual infos
  582. }
  583. // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
  584. //
  585. // Solidity: event Transfer(address indexed from, address indexed to, uint256 value)
  586. func (_Erc20 *Erc20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*Erc20TransferIterator, error) {
  587. var fromRule []interface{}
  588. for _, fromItem := range from {
  589. fromRule = append(fromRule, fromItem)
  590. }
  591. var toRule []interface{}
  592. for _, toItem := range to {
  593. toRule = append(toRule, toItem)
  594. }
  595. logs, sub, err := _Erc20.contract.FilterLogs(opts, "Transfer", fromRule, toRule)
  596. if err != nil {
  597. return nil, err
  598. }
  599. return &Erc20TransferIterator{contract: _Erc20.contract, event: "Transfer", logs: logs, sub: sub}, nil
  600. }
  601. // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
  602. //
  603. // Solidity: event Transfer(address indexed from, address indexed to, uint256 value)
  604. func (_Erc20 *Erc20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *Erc20Transfer, from []common.Address, to []common.Address) (event.Subscription, error) {
  605. var fromRule []interface{}
  606. for _, fromItem := range from {
  607. fromRule = append(fromRule, fromItem)
  608. }
  609. var toRule []interface{}
  610. for _, toItem := range to {
  611. toRule = append(toRule, toItem)
  612. }
  613. logs, sub, err := _Erc20.contract.WatchLogs(opts, "Transfer", fromRule, toRule)
  614. if err != nil {
  615. return nil, err
  616. }
  617. return event.NewSubscription(func(quit <-chan struct{}) error {
  618. defer sub.Unsubscribe()
  619. for {
  620. select {
  621. case log := <-logs:
  622. // New log arrived, parse the event and forward to the user
  623. event := new(Erc20Transfer)
  624. if err := _Erc20.contract.UnpackLog(event, "Transfer", log); err != nil {
  625. return err
  626. }
  627. event.Raw = log
  628. select {
  629. case sink <- event:
  630. case err := <-sub.Err():
  631. return err
  632. case <-quit:
  633. return nil
  634. }
  635. case err := <-sub.Err():
  636. return err
  637. case <-quit:
  638. return nil
  639. }
  640. }
  641. }), nil
  642. }
  643. // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
  644. //
  645. // Solidity: event Transfer(address indexed from, address indexed to, uint256 value)
  646. func (_Erc20 *Erc20Filterer) ParseTransfer(log types.Log) (*Erc20Transfer, error) {
  647. event := new(Erc20Transfer)
  648. if err := _Erc20.contract.UnpackLog(event, "Transfer", log); err != nil {
  649. return nil, err
  650. }
  651. return event, nil
  652. }