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