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