/
types.go
102 lines (92 loc) · 2.1 KB
/
types.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
package etherman
import (
"math/big"
"time"
"github.com/ethereum/go-ethereum/common"
)
// Block struct
type Block struct {
ID uint64
BlockNumber uint64
BlockHash common.Hash
ParentHash common.Hash
NetworkID uint
GlobalExitRoots []GlobalExitRoot
Deposits []Deposit
Claims []Claim
Tokens []TokenWrapped
VerifiedBatches []VerifiedBatch
ActivateEtrog []bool
ReceivedAt time.Time
}
// GlobalExitRoot struct
type GlobalExitRoot struct {
BlockID uint64
BlockNumber uint64
ExitRoots []common.Hash
GlobalExitRoot common.Hash
}
// Deposit struct
type Deposit struct {
LeafType uint8
OriginalNetwork uint
OriginalAddress common.Address
Amount *big.Int
DestinationNetwork uint
DestinationAddress common.Address
DepositCount uint
BlockID uint64
BlockNumber uint64
NetworkID uint
TxHash common.Hash
Metadata []byte
// it is only used for the bridge service
ReadyForClaim bool
}
// Claim struct
type Claim struct {
MainnetFlag bool
RollupIndex uint64
Index uint
OriginalNetwork uint
OriginalAddress common.Address
Amount *big.Int
DestinationAddress common.Address
BlockID uint64
BlockNumber uint64
NetworkID uint
TxHash common.Hash
}
// TokenWrapped struct
type TokenWrapped struct {
TokenMetadata
OriginalNetwork uint
OriginalTokenAddress common.Address
WrappedTokenAddress common.Address
BlockID uint64
BlockNumber uint64
NetworkID uint
}
// TokenMetadata is a metadata of ERC20 token.
type TokenMetadata struct {
Name string
Symbol string
Decimals uint8
}
type VerifiedBatch struct {
BlockNumber uint64
BatchNumber uint64
RollupID uint
LocalExitRoot common.Hash
TxHash common.Hash
StateRoot common.Hash
Aggregator common.Address
}
// RollupExitLeaf struct
type RollupExitLeaf struct {
ID uint64
BlockID uint64
Leaf common.Hash
RollupId uint
Root common.Hash
}