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