-
Notifications
You must be signed in to change notification settings - Fork 0
/
contractsapi.go
executable file
·758 lines (585 loc) · 22.3 KB
/
contractsapi.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
// Code generated by scapi/gen. DO NOT EDIT.
package contractsapi
import (
"math/big"
"github.com/definenulls/komerco-chain/types"
"github.com/umbracle/ethgo"
"github.com/umbracle/ethgo/abi"
)
type StateSyncCommitment struct {
StartID *big.Int `abi:"startId"`
EndID *big.Int `abi:"endId"`
Root types.Hash `abi:"root"`
}
var StateSyncCommitmentABIType = abi.MustNewType("tuple(uint256 startId,uint256 endId,bytes32 root)")
func (s *StateSyncCommitment) EncodeAbi() ([]byte, error) {
return StateSyncCommitmentABIType.Encode(s)
}
func (s *StateSyncCommitment) DecodeAbi(buf []byte) error {
return decodeStruct(StateSyncCommitmentABIType, buf, &s)
}
type CommitStateReceiverFn struct {
Commitment *StateSyncCommitment `abi:"commitment"`
Signature []byte `abi:"signature"`
Bitmap []byte `abi:"bitmap"`
}
func (c *CommitStateReceiverFn) Sig() []byte {
return StateReceiver.Abi.Methods["commit"].ID()
}
func (c *CommitStateReceiverFn) EncodeAbi() ([]byte, error) {
return StateReceiver.Abi.Methods["commit"].Encode(c)
}
func (c *CommitStateReceiverFn) DecodeAbi(buf []byte) error {
return decodeMethod(StateReceiver.Abi.Methods["commit"], buf, c)
}
type StateSync struct {
ID *big.Int `abi:"id"`
Sender types.Address `abi:"sender"`
Receiver types.Address `abi:"receiver"`
Data []byte `abi:"data"`
}
var StateSyncABIType = abi.MustNewType("tuple(uint256 id,address sender,address receiver,bytes data)")
func (s *StateSync) EncodeAbi() ([]byte, error) {
return StateSyncABIType.Encode(s)
}
func (s *StateSync) DecodeAbi(buf []byte) error {
return decodeStruct(StateSyncABIType, buf, &s)
}
type ExecuteStateReceiverFn struct {
Proof []types.Hash `abi:"proof"`
Obj *StateSync `abi:"obj"`
}
func (e *ExecuteStateReceiverFn) Sig() []byte {
return StateReceiver.Abi.Methods["execute"].ID()
}
func (e *ExecuteStateReceiverFn) EncodeAbi() ([]byte, error) {
return StateReceiver.Abi.Methods["execute"].Encode(e)
}
func (e *ExecuteStateReceiverFn) DecodeAbi(buf []byte) error {
return decodeMethod(StateReceiver.Abi.Methods["execute"], buf, e)
}
type StateSyncResultEvent struct {
Counter *big.Int `abi:"counter"`
Status bool `abi:"status"`
Message []byte `abi:"message"`
}
func (*StateSyncResultEvent) Sig() ethgo.Hash {
return StateReceiver.Abi.Events["StateSyncResult"].ID()
}
func (*StateSyncResultEvent) Encode(inputs interface{}) ([]byte, error) {
return StateReceiver.Abi.Events["StateSyncResult"].Inputs.Encode(inputs)
}
func (s *StateSyncResultEvent) ParseLog(log *ethgo.Log) (bool, error) {
if !StateReceiver.Abi.Events["StateSyncResult"].Match(log) {
return false, nil
}
return true, decodeEvent(StateReceiver.Abi.Events["StateSyncResult"], log, s)
}
type NewCommitmentEvent struct {
StartID *big.Int `abi:"startId"`
EndID *big.Int `abi:"endId"`
Root types.Hash `abi:"root"`
}
func (*NewCommitmentEvent) Sig() ethgo.Hash {
return StateReceiver.Abi.Events["NewCommitment"].ID()
}
func (*NewCommitmentEvent) Encode(inputs interface{}) ([]byte, error) {
return StateReceiver.Abi.Events["NewCommitment"].Inputs.Encode(inputs)
}
func (n *NewCommitmentEvent) ParseLog(log *ethgo.Log) (bool, error) {
if !StateReceiver.Abi.Events["NewCommitment"].Match(log) {
return false, nil
}
return true, decodeEvent(StateReceiver.Abi.Events["NewCommitment"], log, n)
}
type Epoch struct {
StartBlock *big.Int `abi:"startBlock"`
EndBlock *big.Int `abi:"endBlock"`
EpochRoot types.Hash `abi:"epochRoot"`
}
var EpochABIType = abi.MustNewType("tuple(uint256 startBlock,uint256 endBlock,bytes32 epochRoot)")
func (e *Epoch) EncodeAbi() ([]byte, error) {
return EpochABIType.Encode(e)
}
func (e *Epoch) DecodeAbi(buf []byte) error {
return decodeStruct(EpochABIType, buf, &e)
}
type UptimeData struct {
Validator types.Address `abi:"validator"`
SignedBlocks *big.Int `abi:"signedBlocks"`
}
var UptimeDataABIType = abi.MustNewType("tuple(address validator,uint256 signedBlocks)")
func (u *UptimeData) EncodeAbi() ([]byte, error) {
return UptimeDataABIType.Encode(u)
}
func (u *UptimeData) DecodeAbi(buf []byte) error {
return decodeStruct(UptimeDataABIType, buf, &u)
}
type Uptime struct {
EpochID *big.Int `abi:"epochId"`
UptimeData []*UptimeData `abi:"uptimeData"`
TotalBlocks *big.Int `abi:"totalBlocks"`
}
var UptimeABIType = abi.MustNewType("tuple(uint256 epochId,tuple(address validator,uint256 signedBlocks)[] uptimeData,uint256 totalBlocks)")
func (u *Uptime) EncodeAbi() ([]byte, error) {
return UptimeABIType.Encode(u)
}
func (u *Uptime) DecodeAbi(buf []byte) error {
return decodeStruct(UptimeABIType, buf, &u)
}
type CommitEpochChildValidatorSetFn struct {
ID *big.Int `abi:"id"`
Epoch *Epoch `abi:"epoch"`
Uptime *Uptime `abi:"uptime"`
}
func (c *CommitEpochChildValidatorSetFn) Sig() []byte {
return ChildValidatorSet.Abi.Methods["commitEpoch"].ID()
}
func (c *CommitEpochChildValidatorSetFn) EncodeAbi() ([]byte, error) {
return ChildValidatorSet.Abi.Methods["commitEpoch"].Encode(c)
}
func (c *CommitEpochChildValidatorSetFn) DecodeAbi(buf []byte) error {
return decodeMethod(ChildValidatorSet.Abi.Methods["commitEpoch"], buf, c)
}
type InitStruct struct {
EpochReward *big.Int `abi:"epochReward"`
MinStake *big.Int `abi:"minStake"`
MinDelegation *big.Int `abi:"minDelegation"`
EpochSize *big.Int `abi:"epochSize"`
}
var InitStructABIType = abi.MustNewType("tuple(uint256 epochReward,uint256 minStake,uint256 minDelegation,uint256 epochSize)")
func (i *InitStruct) EncodeAbi() ([]byte, error) {
return InitStructABIType.Encode(i)
}
func (i *InitStruct) DecodeAbi(buf []byte) error {
return decodeStruct(InitStructABIType, buf, &i)
}
type ValidatorInit struct {
Addr types.Address `abi:"addr"`
Pubkey [4]*big.Int `abi:"pubkey"`
Signature [2]*big.Int `abi:"signature"`
Stake *big.Int `abi:"stake"`
}
var ValidatorInitABIType = abi.MustNewType("tuple(address addr,uint256[4] pubkey,uint256[2] signature,uint256 stake)")
func (v *ValidatorInit) EncodeAbi() ([]byte, error) {
return ValidatorInitABIType.Encode(v)
}
func (v *ValidatorInit) DecodeAbi(buf []byte) error {
return decodeStruct(ValidatorInitABIType, buf, &v)
}
type InitializeChildValidatorSetFn struct {
Init *InitStruct `abi:"init"`
Validators []*ValidatorInit `abi:"validators"`
NewBls types.Address `abi:"newBls"`
Governance types.Address `abi:"governance"`
}
func (i *InitializeChildValidatorSetFn) Sig() []byte {
return ChildValidatorSet.Abi.Methods["initialize"].ID()
}
func (i *InitializeChildValidatorSetFn) EncodeAbi() ([]byte, error) {
return ChildValidatorSet.Abi.Methods["initialize"].Encode(i)
}
func (i *InitializeChildValidatorSetFn) DecodeAbi(buf []byte) error {
return decodeMethod(ChildValidatorSet.Abi.Methods["initialize"], buf, i)
}
type AddToWhitelistChildValidatorSetFn struct {
WhitelistAddreses []ethgo.Address `abi:"whitelistAddreses"`
}
func (a *AddToWhitelistChildValidatorSetFn) Sig() []byte {
return ChildValidatorSet.Abi.Methods["addToWhitelist"].ID()
}
func (a *AddToWhitelistChildValidatorSetFn) EncodeAbi() ([]byte, error) {
return ChildValidatorSet.Abi.Methods["addToWhitelist"].Encode(a)
}
func (a *AddToWhitelistChildValidatorSetFn) DecodeAbi(buf []byte) error {
return decodeMethod(ChildValidatorSet.Abi.Methods["addToWhitelist"], buf, a)
}
type RegisterChildValidatorSetFn struct {
Signature [2]*big.Int `abi:"signature"`
Pubkey [4]*big.Int `abi:"pubkey"`
}
func (r *RegisterChildValidatorSetFn) Sig() []byte {
return ChildValidatorSet.Abi.Methods["register"].ID()
}
func (r *RegisterChildValidatorSetFn) EncodeAbi() ([]byte, error) {
return ChildValidatorSet.Abi.Methods["register"].Encode(r)
}
func (r *RegisterChildValidatorSetFn) DecodeAbi(buf []byte) error {
return decodeMethod(ChildValidatorSet.Abi.Methods["register"], buf, r)
}
type NewValidatorEvent struct {
Validator types.Address `abi:"validator"`
BlsKey [4]*big.Int `abi:"blsKey"`
}
func (*NewValidatorEvent) Sig() ethgo.Hash {
return ChildValidatorSet.Abi.Events["NewValidator"].ID()
}
func (*NewValidatorEvent) Encode(inputs interface{}) ([]byte, error) {
return ChildValidatorSet.Abi.Events["NewValidator"].Inputs.Encode(inputs)
}
func (n *NewValidatorEvent) ParseLog(log *ethgo.Log) (bool, error) {
if !ChildValidatorSet.Abi.Events["NewValidator"].Match(log) {
return false, nil
}
return true, decodeEvent(ChildValidatorSet.Abi.Events["NewValidator"], log, n)
}
type StakedEvent struct {
Validator types.Address `abi:"validator"`
Amount *big.Int `abi:"amount"`
}
func (*StakedEvent) Sig() ethgo.Hash {
return ChildValidatorSet.Abi.Events["Staked"].ID()
}
func (*StakedEvent) Encode(inputs interface{}) ([]byte, error) {
return ChildValidatorSet.Abi.Events["Staked"].Inputs.Encode(inputs)
}
func (s *StakedEvent) ParseLog(log *ethgo.Log) (bool, error) {
if !ChildValidatorSet.Abi.Events["Staked"].Match(log) {
return false, nil
}
return true, decodeEvent(ChildValidatorSet.Abi.Events["Staked"], log, s)
}
type DelegatedEvent struct {
Delegator types.Address `abi:"delegator"`
Validator types.Address `abi:"validator"`
Amount *big.Int `abi:"amount"`
}
func (*DelegatedEvent) Sig() ethgo.Hash {
return ChildValidatorSet.Abi.Events["Delegated"].ID()
}
func (*DelegatedEvent) Encode(inputs interface{}) ([]byte, error) {
return ChildValidatorSet.Abi.Events["Delegated"].Inputs.Encode(inputs)
}
func (d *DelegatedEvent) ParseLog(log *ethgo.Log) (bool, error) {
if !ChildValidatorSet.Abi.Events["Delegated"].Match(log) {
return false, nil
}
return true, decodeEvent(ChildValidatorSet.Abi.Events["Delegated"], log, d)
}
type UnstakedEvent struct {
Validator types.Address `abi:"validator"`
Amount *big.Int `abi:"amount"`
}
func (*UnstakedEvent) Sig() ethgo.Hash {
return ChildValidatorSet.Abi.Events["Unstaked"].ID()
}
func (*UnstakedEvent) Encode(inputs interface{}) ([]byte, error) {
return ChildValidatorSet.Abi.Events["Unstaked"].Inputs.Encode(inputs)
}
func (u *UnstakedEvent) ParseLog(log *ethgo.Log) (bool, error) {
if !ChildValidatorSet.Abi.Events["Unstaked"].Match(log) {
return false, nil
}
return true, decodeEvent(ChildValidatorSet.Abi.Events["Unstaked"], log, u)
}
type UndelegatedEvent struct {
Delegator types.Address `abi:"delegator"`
Validator types.Address `abi:"validator"`
Amount *big.Int `abi:"amount"`
}
func (*UndelegatedEvent) Sig() ethgo.Hash {
return ChildValidatorSet.Abi.Events["Undelegated"].ID()
}
func (*UndelegatedEvent) Encode(inputs interface{}) ([]byte, error) {
return ChildValidatorSet.Abi.Events["Undelegated"].Inputs.Encode(inputs)
}
func (u *UndelegatedEvent) ParseLog(log *ethgo.Log) (bool, error) {
if !ChildValidatorSet.Abi.Events["Undelegated"].Match(log) {
return false, nil
}
return true, decodeEvent(ChildValidatorSet.Abi.Events["Undelegated"], log, u)
}
type AddedToWhitelistEvent struct {
Validator types.Address `abi:"validator"`
}
func (*AddedToWhitelistEvent) Sig() ethgo.Hash {
return ChildValidatorSet.Abi.Events["AddedToWhitelist"].ID()
}
func (*AddedToWhitelistEvent) Encode(inputs interface{}) ([]byte, error) {
return ChildValidatorSet.Abi.Events["AddedToWhitelist"].Inputs.Encode(inputs)
}
func (a *AddedToWhitelistEvent) ParseLog(log *ethgo.Log) (bool, error) {
if !ChildValidatorSet.Abi.Events["AddedToWhitelist"].Match(log) {
return false, nil
}
return true, decodeEvent(ChildValidatorSet.Abi.Events["AddedToWhitelist"], log, a)
}
type WithdrawalEvent struct {
Account types.Address `abi:"account"`
To types.Address `abi:"to"`
Amount *big.Int `abi:"amount"`
}
func (*WithdrawalEvent) Sig() ethgo.Hash {
return ChildValidatorSet.Abi.Events["Withdrawal"].ID()
}
func (*WithdrawalEvent) Encode(inputs interface{}) ([]byte, error) {
return ChildValidatorSet.Abi.Events["Withdrawal"].Inputs.Encode(inputs)
}
func (w *WithdrawalEvent) ParseLog(log *ethgo.Log) (bool, error) {
if !ChildValidatorSet.Abi.Events["Withdrawal"].Match(log) {
return false, nil
}
return true, decodeEvent(ChildValidatorSet.Abi.Events["Withdrawal"], log, w)
}
type SyncStateStateSenderFn struct {
Receiver types.Address `abi:"receiver"`
Data []byte `abi:"data"`
}
func (s *SyncStateStateSenderFn) Sig() []byte {
return StateSender.Abi.Methods["syncState"].ID()
}
func (s *SyncStateStateSenderFn) EncodeAbi() ([]byte, error) {
return StateSender.Abi.Methods["syncState"].Encode(s)
}
func (s *SyncStateStateSenderFn) DecodeAbi(buf []byte) error {
return decodeMethod(StateSender.Abi.Methods["syncState"], buf, s)
}
type StateSyncedEvent struct {
ID *big.Int `abi:"id"`
Sender types.Address `abi:"sender"`
Receiver types.Address `abi:"receiver"`
Data []byte `abi:"data"`
}
func (*StateSyncedEvent) Sig() ethgo.Hash {
return StateSender.Abi.Events["StateSynced"].ID()
}
func (*StateSyncedEvent) Encode(inputs interface{}) ([]byte, error) {
return StateSender.Abi.Events["StateSynced"].Inputs.Encode(inputs)
}
func (s *StateSyncedEvent) ParseLog(log *ethgo.Log) (bool, error) {
if !StateSender.Abi.Events["StateSynced"].Match(log) {
return false, nil
}
return true, decodeEvent(StateSender.Abi.Events["StateSynced"], log, s)
}
type L2StateSyncedEvent struct {
ID *big.Int `abi:"id"`
Sender types.Address `abi:"sender"`
Receiver types.Address `abi:"receiver"`
Data []byte `abi:"data"`
}
func (*L2StateSyncedEvent) Sig() ethgo.Hash {
return L2StateSender.Abi.Events["L2StateSynced"].ID()
}
func (*L2StateSyncedEvent) Encode(inputs interface{}) ([]byte, error) {
return L2StateSender.Abi.Events["L2StateSynced"].Inputs.Encode(inputs)
}
func (l *L2StateSyncedEvent) ParseLog(log *ethgo.Log) (bool, error) {
if !L2StateSender.Abi.Events["L2StateSynced"].Match(log) {
return false, nil
}
return true, decodeEvent(L2StateSender.Abi.Events["L2StateSynced"], log, l)
}
type CheckpointMetadata struct {
BlockHash types.Hash `abi:"blockHash"`
BlockRound *big.Int `abi:"blockRound"`
CurrentValidatorSetHash types.Hash `abi:"currentValidatorSetHash"`
}
var CheckpointMetadataABIType = abi.MustNewType("tuple(bytes32 blockHash,uint256 blockRound,bytes32 currentValidatorSetHash)")
func (c *CheckpointMetadata) EncodeAbi() ([]byte, error) {
return CheckpointMetadataABIType.Encode(c)
}
func (c *CheckpointMetadata) DecodeAbi(buf []byte) error {
return decodeStruct(CheckpointMetadataABIType, buf, &c)
}
type Checkpoint struct {
Epoch *big.Int `abi:"epoch"`
BlockNumber *big.Int `abi:"blockNumber"`
EventRoot types.Hash `abi:"eventRoot"`
}
var CheckpointABIType = abi.MustNewType("tuple(uint256 epoch,uint256 blockNumber,bytes32 eventRoot)")
func (c *Checkpoint) EncodeAbi() ([]byte, error) {
return CheckpointABIType.Encode(c)
}
func (c *Checkpoint) DecodeAbi(buf []byte) error {
return decodeStruct(CheckpointABIType, buf, &c)
}
type Validator struct {
Address types.Address `abi:"_address"`
BlsKey [4]*big.Int `abi:"blsKey"`
VotingPower *big.Int `abi:"votingPower"`
}
var ValidatorABIType = abi.MustNewType("tuple(address _address,uint256[4] blsKey,uint256 votingPower)")
func (v *Validator) EncodeAbi() ([]byte, error) {
return ValidatorABIType.Encode(v)
}
func (v *Validator) DecodeAbi(buf []byte) error {
return decodeStruct(ValidatorABIType, buf, &v)
}
type SubmitCheckpointManagerFn struct {
CheckpointMetadata *CheckpointMetadata `abi:"checkpointMetadata"`
Checkpoint *Checkpoint `abi:"checkpoint"`
Signature [2]*big.Int `abi:"signature"`
NewValidatorSet []*Validator `abi:"newValidatorSet"`
Bitmap []byte `abi:"bitmap"`
}
func (s *SubmitCheckpointManagerFn) Sig() []byte {
return CheckpointManager.Abi.Methods["submit"].ID()
}
func (s *SubmitCheckpointManagerFn) EncodeAbi() ([]byte, error) {
return CheckpointManager.Abi.Methods["submit"].Encode(s)
}
func (s *SubmitCheckpointManagerFn) DecodeAbi(buf []byte) error {
return decodeMethod(CheckpointManager.Abi.Methods["submit"], buf, s)
}
type InitializeCheckpointManagerFn struct {
NewBls types.Address `abi:"newBls"`
NewBn256G2 types.Address `abi:"newBn256G2"`
ChainID_ *big.Int `abi:"chainId_"`
NewValidatorSet []*Validator `abi:"newValidatorSet"`
}
func (i *InitializeCheckpointManagerFn) Sig() []byte {
return CheckpointManager.Abi.Methods["initialize"].ID()
}
func (i *InitializeCheckpointManagerFn) EncodeAbi() ([]byte, error) {
return CheckpointManager.Abi.Methods["initialize"].Encode(i)
}
func (i *InitializeCheckpointManagerFn) DecodeAbi(buf []byte) error {
return decodeMethod(CheckpointManager.Abi.Methods["initialize"], buf, i)
}
type GetCheckpointBlockCheckpointManagerFn struct {
BlockNumber *big.Int `abi:"blockNumber"`
}
func (g *GetCheckpointBlockCheckpointManagerFn) Sig() []byte {
return CheckpointManager.Abi.Methods["getCheckpointBlock"].ID()
}
func (g *GetCheckpointBlockCheckpointManagerFn) EncodeAbi() ([]byte, error) {
return CheckpointManager.Abi.Methods["getCheckpointBlock"].Encode(g)
}
func (g *GetCheckpointBlockCheckpointManagerFn) DecodeAbi(buf []byte) error {
return decodeMethod(CheckpointManager.Abi.Methods["getCheckpointBlock"], buf, g)
}
type ExitExitHelperFn struct {
BlockNumber *big.Int `abi:"blockNumber"`
LeafIndex *big.Int `abi:"leafIndex"`
UnhashedLeaf []byte `abi:"unhashedLeaf"`
Proof []types.Hash `abi:"proof"`
}
func (e *ExitExitHelperFn) Sig() []byte {
return ExitHelper.Abi.Methods["exit"].ID()
}
func (e *ExitExitHelperFn) EncodeAbi() ([]byte, error) {
return ExitHelper.Abi.Methods["exit"].Encode(e)
}
func (e *ExitExitHelperFn) DecodeAbi(buf []byte) error {
return decodeMethod(ExitHelper.Abi.Methods["exit"], buf, e)
}
type InitializeChildERC20PredicateFn struct {
NewL2StateSender types.Address `abi:"newL2StateSender"`
NewStateReceiver types.Address `abi:"newStateReceiver"`
NewRootERC20Predicate types.Address `abi:"newRootERC20Predicate"`
NewChildTokenTemplate types.Address `abi:"newChildTokenTemplate"`
NewNativeTokenRootAddress types.Address `abi:"newNativeTokenRootAddress"`
}
func (i *InitializeChildERC20PredicateFn) Sig() []byte {
return ChildERC20Predicate.Abi.Methods["initialize"].ID()
}
func (i *InitializeChildERC20PredicateFn) EncodeAbi() ([]byte, error) {
return ChildERC20Predicate.Abi.Methods["initialize"].Encode(i)
}
func (i *InitializeChildERC20PredicateFn) DecodeAbi(buf []byte) error {
return decodeMethod(ChildERC20Predicate.Abi.Methods["initialize"], buf, i)
}
type WithdrawToChildERC20PredicateFn struct {
ChildToken types.Address `abi:"childToken"`
Receiver types.Address `abi:"receiver"`
Amount *big.Int `abi:"amount"`
}
func (w *WithdrawToChildERC20PredicateFn) Sig() []byte {
return ChildERC20Predicate.Abi.Methods["withdrawTo"].ID()
}
func (w *WithdrawToChildERC20PredicateFn) EncodeAbi() ([]byte, error) {
return ChildERC20Predicate.Abi.Methods["withdrawTo"].Encode(w)
}
func (w *WithdrawToChildERC20PredicateFn) DecodeAbi(buf []byte) error {
return decodeMethod(ChildERC20Predicate.Abi.Methods["withdrawTo"], buf, w)
}
type InitializeNativeERC20Fn struct {
Predicate_ types.Address `abi:"predicate_"`
RootToken_ types.Address `abi:"rootToken_"`
Name_ string `abi:"name_"`
Symbol_ string `abi:"symbol_"`
Decimals_ uint8 `abi:"decimals_"`
}
func (i *InitializeNativeERC20Fn) Sig() []byte {
return NativeERC20.Abi.Methods["initialize"].ID()
}
func (i *InitializeNativeERC20Fn) EncodeAbi() ([]byte, error) {
return NativeERC20.Abi.Methods["initialize"].Encode(i)
}
func (i *InitializeNativeERC20Fn) DecodeAbi(buf []byte) error {
return decodeMethod(NativeERC20.Abi.Methods["initialize"], buf, i)
}
type InitializeNativeERC20MintableFn struct {
Predicate_ types.Address `abi:"predicate_"`
Owner_ types.Address `abi:"owner_"`
RootToken_ types.Address `abi:"rootToken_"`
Name_ string `abi:"name_"`
Symbol_ string `abi:"symbol_"`
Decimals_ uint8 `abi:"decimals_"`
}
func (i *InitializeNativeERC20MintableFn) Sig() []byte {
return NativeERC20Mintable.Abi.Methods["initialize"].ID()
}
func (i *InitializeNativeERC20MintableFn) EncodeAbi() ([]byte, error) {
return NativeERC20Mintable.Abi.Methods["initialize"].Encode(i)
}
func (i *InitializeNativeERC20MintableFn) DecodeAbi(buf []byte) error {
return decodeMethod(NativeERC20Mintable.Abi.Methods["initialize"], buf, i)
}
type InitializeRootERC20PredicateFn struct {
NewStateSender types.Address `abi:"newStateSender"`
NewExitHelper types.Address `abi:"newExitHelper"`
NewChildERC20Predicate types.Address `abi:"newChildERC20Predicate"`
NewChildTokenTemplate types.Address `abi:"newChildTokenTemplate"`
NativeTokenRootAddress types.Address `abi:"nativeTokenRootAddress"`
}
func (i *InitializeRootERC20PredicateFn) Sig() []byte {
return RootERC20Predicate.Abi.Methods["initialize"].ID()
}
func (i *InitializeRootERC20PredicateFn) EncodeAbi() ([]byte, error) {
return RootERC20Predicate.Abi.Methods["initialize"].Encode(i)
}
func (i *InitializeRootERC20PredicateFn) DecodeAbi(buf []byte) error {
return decodeMethod(RootERC20Predicate.Abi.Methods["initialize"], buf, i)
}
type DepositToRootERC20PredicateFn struct {
RootToken types.Address `abi:"rootToken"`
Receiver types.Address `abi:"receiver"`
Amount *big.Int `abi:"amount"`
}
func (d *DepositToRootERC20PredicateFn) Sig() []byte {
return RootERC20Predicate.Abi.Methods["depositTo"].ID()
}
func (d *DepositToRootERC20PredicateFn) EncodeAbi() ([]byte, error) {
return RootERC20Predicate.Abi.Methods["depositTo"].Encode(d)
}
func (d *DepositToRootERC20PredicateFn) DecodeAbi(buf []byte) error {
return decodeMethod(RootERC20Predicate.Abi.Methods["depositTo"], buf, d)
}
type ApproveRootERC20Fn struct {
Spender types.Address `abi:"spender"`
Amount *big.Int `abi:"amount"`
}
func (a *ApproveRootERC20Fn) Sig() []byte {
return RootERC20.Abi.Methods["approve"].ID()
}
func (a *ApproveRootERC20Fn) EncodeAbi() ([]byte, error) {
return RootERC20.Abi.Methods["approve"].Encode(a)
}
func (a *ApproveRootERC20Fn) DecodeAbi(buf []byte) error {
return decodeMethod(RootERC20.Abi.Methods["approve"], buf, a)
}
type MintRootERC20Fn struct {
To types.Address `abi:"to"`
Amount *big.Int `abi:"amount"`
}
func (m *MintRootERC20Fn) Sig() []byte {
return RootERC20.Abi.Methods["mint"].ID()
}
func (m *MintRootERC20Fn) EncodeAbi() ([]byte, error) {
return RootERC20.Abi.Methods["mint"].Encode(m)
}
func (m *MintRootERC20Fn) DecodeAbi(buf []byte) error {
return decodeMethod(RootERC20.Abi.Methods["mint"], buf, m)
}