@@ -263,3 +263,314 @@ func (_SFC *SFCCaller) CreateValidator(opts *bind.TransactOpts, pubkey []byte) (
263
263
func (_SFC * SFCSession ) CreateValidator (pubkey []byte ) (* types.Transaction , error ) {
264
264
return _SFC .Contract .CreateValidator (& _SFC .TransactOpts , pubkey )
265
265
}
266
+ << << << < HEAD
267
+ == == == =
268
+
269
+ // SFCApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the SFC contract.
270
+ type SFCApprovalIterator struct {
271
+ Event * SFCApproval // Event containing the contract specifics and raw log
272
+
273
+ contract * bind.BoundContract // Generic contract to use for unpacking event data
274
+ event string // Event name to use for unpacking event data
275
+
276
+ logs chan types.Log // Log channel receiving the found contract events
277
+ sub ethereum.Subscription // Subscription for errors, completion and termination
278
+ done bool // Whether the subscription completed delivering logs
279
+ fail error // Occurred error to stop iteration
280
+ }
281
+
282
+ // Next advances the iterator to the subsequent event, returning whether there
283
+ // are any more events found. In case of a retrieval or parsing error, false is
284
+ // returned and Error() can be queried for the exact failure.
285
+ func (it * SFCApprovalIterator ) Next () bool {
286
+ // If the iterator failed, stop iterating
287
+ if it .fail != nil {
288
+ return false
289
+ }
290
+ // If the iterator completed, deliver directly whatever's available
291
+ if it .done {
292
+ select {
293
+ case log := <- it .logs :
294
+ it .Event = new (SFCApproval )
295
+ if err := it .contract .UnpackLog (it .Event , it .event , log ); err != nil {
296
+ it .fail = err
297
+ return false
298
+ }
299
+ it .Event .Raw = log
300
+ return true
301
+
302
+ default :
303
+ return false
304
+ }
305
+ }
306
+ // Iterator still in progress, wait for either a data or an error event
307
+ select {
308
+ case log := <- it .logs :
309
+ it .Event = new (SFCApproval )
310
+ if err := it .contract .UnpackLog (it .Event , it .event , log ); err != nil {
311
+ it .fail = err
312
+ return false
313
+ }
314
+ it .Event .Raw = log
315
+ return true
316
+
317
+ case err := <- it .sub .Err ():
318
+ it .done = true
319
+ it .fail = err
320
+ return it .Next ()
321
+ }
322
+ }
323
+
324
+ // Error returns any retrieval or parsing error occurred during filtering.
325
+ func (it * SFCApprovalIterator ) Error () error {
326
+ return it .fail
327
+ }
328
+
329
+ // Close terminates the iteration process, releasing any pending underlying
330
+ // resources.
331
+ func (it * SFCApprovalIterator ) Close () error {
332
+ it .sub .Unsubscribe ()
333
+ return nil
334
+ }
335
+
336
+ // SFCApproval represents a Approval event raised by the SFC contract.
337
+ type SFCApproval struct {
338
+ Owner common.Address
339
+ Spender common.Address
340
+ Value * big.Int
341
+ Raw types.Log // Blockchain specific contextual infos
342
+ }
343
+
344
+ // FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925.
345
+ //
346
+ // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value)
347
+ func (_SFC * SFCFilterer ) FilterApproval (opts * bind.FilterOpts , owner []common.Address , spender []common.Address ) (* SFCApprovalIterator , error ) {
348
+
349
+ var ownerRule []interface {}
350
+ for _ , ownerItem := range owner {
351
+ ownerRule = append (ownerRule , ownerItem )
352
+ }
353
+ var spenderRule []interface {}
354
+ for _ , spenderItem := range spender {
355
+ spenderRule = append (spenderRule , spenderItem )
356
+ }
357
+
358
+ logs , sub , err := _SFC .contract .FilterLogs (opts , "Approval" , ownerRule , spenderRule )
359
+ if err != nil {
360
+ return nil , err
361
+ }
362
+ return & SFCApprovalIterator {contract : _SFC .contract , event : "Approval" , logs : logs , sub : sub }, nil
363
+ }
364
+
365
+ // WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925.
366
+ //
367
+ // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value)
368
+ func (_SFC * SFCFilterer ) WatchApproval (opts * bind.WatchOpts , sink chan <- * SFCApproval , owner []common.Address , spender []common.Address ) (event.Subscription , error ) {
369
+
370
+ var ownerRule []interface {}
371
+ for _ , ownerItem := range owner {
372
+ ownerRule = append (ownerRule , ownerItem )
373
+ }
374
+ var spenderRule []interface {}
375
+ for _ , spenderItem := range spender {
376
+ spenderRule = append (spenderRule , spenderItem )
377
+ }
378
+
379
+ logs , sub , err := _SFC .contract .WatchLogs (opts , "Approval" , ownerRule , spenderRule )
380
+ if err != nil {
381
+ return nil , err
382
+ }
383
+ return event .NewSubscription (func (quit <- chan struct {}) error {
384
+ defer sub .Unsubscribe ()
385
+ for {
386
+ select {
387
+ case log := <- logs :
388
+ // New log arrived, parse the event and forward to the user
389
+ event := new (SFCApproval )
390
+ if err := _SFC .contract .UnpackLog (event , "Approval" , log ); err != nil {
391
+ return err
392
+ }
393
+ event .Raw = log
394
+
395
+ select {
396
+ case sink <- event :
397
+ case err := <- sub .Err ():
398
+ return err
399
+ case <- quit :
400
+ return nil
401
+ }
402
+ case err := <- sub .Err ():
403
+ return err
404
+ case <- quit :
405
+ return nil
406
+ }
407
+ }
408
+ }), nil
409
+ }
410
+
411
+ // ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925.
412
+ //
413
+ // Solidity: event Approval(address indexed owner, address indexed spender, uint256 value)
414
+ func (_SFC * SFCFilterer ) ParseApproval (log types.Log ) (* SFCApproval , error ) {
415
+ event := new (SFCApproval )
416
+ if err := _SFC .contract .UnpackLog (event , "Approval" , log ); err != nil {
417
+ return nil , err
418
+ }
419
+ event .Raw = log
420
+ return event , nil
421
+ }
422
+
423
+ // SFCTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the SFC contract.
424
+ type SFCTransferIterator struct {
425
+ Event * SFCTransfer // Event containing the contract specifics and raw log
426
+
427
+ contract * bind.BoundContract // Generic contract to use for unpacking event data
428
+ event string // Event name to use for unpacking event data
429
+
430
+ logs chan types.Log // Log channel receiving the found contract events
431
+ sub ethereum.Subscription // Subscription for errors, completion and termination
432
+ done bool // Whether the subscription completed delivering logs
433
+ fail error // Occurred error to stop iteration
434
+ }
435
+
436
+ // Next advances the iterator to the subsequent event, returning whether there
437
+ // are any more events found. In case of a retrieval or parsing error, false is
438
+ // returned and Error() can be queried for the exact failure.
439
+ func (it * SFCTransferIterator ) Next () bool {
440
+ // If the iterator failed, stop iterating
441
+ if it .fail != nil {
442
+ return false
443
+ }
444
+ // If the iterator completed, deliver directly whatever's available
445
+ if it .done {
446
+ select {
447
+ case log := <- it .logs :
448
+ it .Event = new (SFCTransfer )
449
+ if err := it .contract .UnpackLog (it .Event , it .event , log ); err != nil {
450
+ it .fail = err
451
+ return false
452
+ }
453
+ it .Event .Raw = log
454
+ return true
455
+
456
+ default :
457
+ return false
458
+ }
459
+ }
460
+ // Iterator still in progress, wait for either a data or an error event
461
+ select {
462
+ case log := <- it .logs :
463
+ it .Event = new (SFCTransfer )
464
+ if err := it .contract .UnpackLog (it .Event , it .event , log ); err != nil {
465
+ it .fail = err
466
+ return false
467
+ }
468
+ it .Event .Raw = log
469
+ return true
470
+
471
+ case err := <- it .sub .Err ():
472
+ it .done = true
473
+ it .fail = err
474
+ return it .Next ()
475
+ }
476
+ }
477
+
478
+ // Error returns any retrieval or parsing error occurred during filtering.
479
+ func (it * SFCTransferIterator ) Error () error {
480
+ return it .fail
481
+ }
482
+
483
+ // Close terminates the iteration process, releasing any pending underlying
484
+ // resources.
485
+ func (it * SFCTransferIterator ) Close () error {
486
+ it .sub .Unsubscribe ()
487
+ return nil
488
+ }
489
+
490
+ // SFCTransfer represents a Transfer event raised by the SFC contract.
491
+ type SFCTransfer struct {
492
+ From common.Address
493
+ To common.Address
494
+ Value * big.Int
495
+ Raw types.Log // Blockchain specific contextual infos
496
+ }
497
+
498
+ // FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
499
+ //
500
+ // Solidity: event Transfer(address indexed from, address indexed to, uint256 value)
501
+ func (_SFC * SFCFilterer ) FilterTransfer (opts * bind.FilterOpts , from []common.Address , to []common.Address ) (* SFCTransferIterator , error ) {
502
+
503
+ var fromRule []interface {}
504
+ for _ , fromItem := range from {
505
+ fromRule = append (fromRule , fromItem )
506
+ }
507
+ var toRule []interface {}
508
+ for _ , toItem := range to {
509
+ toRule = append (toRule , toItem )
510
+ }
511
+
512
+ logs , sub , err := _SFC .contract .FilterLogs (opts , "Transfer" , fromRule , toRule )
513
+ if err != nil {
514
+ return nil , err
515
+ }
516
+ return & SFCTransferIterator {contract : _SFC .contract , event : "Transfer" , logs : logs , sub : sub }, nil
517
+ }
518
+
519
+ // WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
520
+ //
521
+ // Solidity: event Transfer(address indexed from, address indexed to, uint256 value)
522
+ func (_SFC * SFCFilterer ) WatchTransfer (opts * bind.WatchOpts , sink chan <- * SFCTransfer , from []common.Address , to []common.Address ) (event.Subscription , error ) {
523
+
524
+ var fromRule []interface {}
525
+ for _ , fromItem := range from {
526
+ fromRule = append (fromRule , fromItem )
527
+ }
528
+ var toRule []interface {}
529
+ for _ , toItem := range to {
530
+ toRule = append (toRule , toItem )
531
+ }
532
+
533
+ logs , sub , err := _SFC .contract .WatchLogs (opts , "Transfer" , fromRule , toRule )
534
+ if err != nil {
535
+ return nil , err
536
+ }
537
+ return event .NewSubscription (func (quit <- chan struct {}) error {
538
+ defer sub .Unsubscribe ()
539
+ for {
540
+ select {
541
+ case log := <- logs :
542
+ // New log arrived, parse the event and forward to the user
543
+ event := new (SFCTransfer )
544
+ if err := _SFC .contract .UnpackLog (event , "Transfer" , log ); err != nil {
545
+ return err
546
+ }
547
+ event .Raw = log
548
+
549
+ select {
550
+ case sink <- event :
551
+ case err := <- sub .Err ():
552
+ return err
553
+ case <- quit :
554
+ return nil
555
+ }
556
+ case err := <- sub .Err ():
557
+ return err
558
+ case <- quit :
559
+ return nil
560
+ }
561
+ }
562
+ }), nil
563
+ }
564
+
565
+ // ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
566
+ //
567
+ // Solidity: event Transfer(address indexed from, address indexed to, uint256 value)
568
+ func (_SFC * SFCFilterer ) ParseTransfer (log types.Log ) (* SFCTransfer , error ) {
569
+ event := new (SFCTransfer )
570
+ if err := _SFC .contract .UnpackLog (event , "Transfer" , log ); err != nil {
571
+ return nil , err
572
+ }
573
+ event .Raw = log
574
+ return event , nil
575
+ }
576
+ >> >> >> > e87c184 (Add createValidator )
0 commit comments