-
Notifications
You must be signed in to change notification settings - Fork 23
/
deposit.go
204 lines (159 loc) · 5.37 KB
/
deposit.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
//nolint:golint,revive
package bridgev1
import (
"github.com/ethereum/go-ethereum/common"
ethTypes "github.com/ethereum/go-ethereum/core/types"
"github.com/synapsecns/sanguine/core"
"github.com/synapsecns/sanguine/services/explorer/types/bridge"
"math/big"
)
// GetRaw gets the raw event logs from the deposit event.
func (s SynapseBridgeTokenDeposit) GetRaw() ethTypes.Log {
return s.Raw
}
// GetDestinationChainID gets the destination chain id from the deposit log.
func (s SynapseBridgeTokenDeposit) GetDestinationChainID() *big.Int {
return core.CopyBigInt(s.ChainId)
}
// GetToken gets the destination chain id from the deposit and swap log.
func (s SynapseBridgeTokenDeposit) GetToken() common.Address {
return s.Token
}
// GetAmount gets the destination chain id from the deposit log.
func (s SynapseBridgeTokenDeposit) GetAmount() *big.Int {
return core.CopyBigInt(s.Amount)
}
// GetEventType gets the type of the token deposit event.
func (s SynapseBridgeTokenDeposit) GetEventType() bridge.EventType {
return bridge.DepositEvent
}
// GetTxHash gets the unique identifier (txhash) for the deposit.
func (s SynapseBridgeTokenDeposit) GetTxHash() common.Hash {
return s.Raw.TxHash
}
// GetBlockNumber gets the block number for the event.
func (s SynapseBridgeTokenDeposit) GetBlockNumber() uint64 {
return s.Raw.BlockNumber
}
// GetContractAddress gets the contract address the event occurred on.
func (s SynapseBridgeTokenDeposit) GetContractAddress() common.Address {
return s.Raw.Address
}
// GetRecipient gets the recipient of a deposit.
func (s SynapseBridgeTokenDeposit) GetRecipient() *common.Address {
return &s.To
}
func (s SynapseBridgeTokenDeposit) GetTokenIndexFrom() *uint8 {
return nil
}
func (s SynapseBridgeTokenDeposit) GetTokenIndexTo() *uint8 {
return nil
}
func (s SynapseBridgeTokenDeposit) GetMinDy() *big.Int {
return nil
}
func (s SynapseBridgeTokenDeposit) GetDeadline() *big.Int {
return nil
}
func (s SynapseBridgeTokenDeposit) GetSwapTokenIndex() *uint8 {
return nil
}
func (s SynapseBridgeTokenDeposit) GetSwapMinAmount() *big.Int {
return nil
}
func (s SynapseBridgeTokenDeposit) GetSwapDeadline() *big.Int {
return nil
}
func (s SynapseBridgeTokenDeposit) GetRecipientBytes() *[32]byte {
return nil
}
func (s SynapseBridgeTokenDeposit) GetFee() *big.Int {
return nil
}
func (s SynapseBridgeTokenDeposit) GetKappa() *[32]byte {
return nil
}
func (s SynapseBridgeTokenDeposit) GetSwapSuccess() *bool {
return nil
}
func (s SynapseBridgeTokenDeposit) GetEventIndex() uint64 {
return uint64(s.Raw.Index)
}
var _ bridge.EventLog = &SynapseBridgeTokenDeposit{}
// GetRaw gets the raw event logs from the deposit and swap event.
func (s SynapseBridgeTokenDepositAndSwap) GetRaw() ethTypes.Log {
return s.Raw
}
// GetDestinationChainID gets the destination chain id from the deposit and swap log.
func (s SynapseBridgeTokenDepositAndSwap) GetDestinationChainID() *big.Int {
return core.CopyBigInt(s.ChainId)
}
// GetToken gets the destination chain id from the deposit and swap log.
func (s SynapseBridgeTokenDepositAndSwap) GetToken() common.Address {
return s.Token
}
// GetAmount gets the destination chain id from the deposit and swap log.
func (s SynapseBridgeTokenDepositAndSwap) GetAmount() *big.Int {
return core.CopyBigInt(s.Amount)
}
// GetEventType gets the type of the deposit and swap event.
func (s SynapseBridgeTokenDepositAndSwap) GetEventType() bridge.EventType {
return bridge.DepositAndSwapEvent
}
// GetTxHash gets the unique identifier (txhash) for the deposit.
func (s SynapseBridgeTokenDepositAndSwap) GetTxHash() common.Hash {
return s.Raw.TxHash
}
// GetBlockNumber gets the block number for the event.
func (s SynapseBridgeTokenDepositAndSwap) GetBlockNumber() uint64 {
return s.Raw.BlockNumber
}
// GetContractAddress gets the contract address the event occurred on.
func (s SynapseBridgeTokenDepositAndSwap) GetContractAddress() common.Address {
return s.Raw.Address
}
// GetRecipient gets the recipient of a deposit.
func (s SynapseBridgeTokenDepositAndSwap) GetRecipient() *common.Address {
return &s.To
}
// GetTokenIndexFrom gets the token index of the `from` token.
func (s SynapseBridgeTokenDepositAndSwap) GetTokenIndexFrom() *uint8 {
return &s.TokenIndexFrom
}
// GetTokenIndexTo gets the token index of the `to` token.
func (s SynapseBridgeTokenDepositAndSwap) GetTokenIndexTo() *uint8 {
return &s.TokenIndexTo
}
// GetMinDy gets the minimum amount to receive.
func (s SynapseBridgeTokenDepositAndSwap) GetMinDy() *big.Int {
return core.CopyBigInt(s.MinDy)
}
// GetDeadline gets the deadline for the swap.
func (s SynapseBridgeTokenDepositAndSwap) GetDeadline() *big.Int {
return core.CopyBigInt(s.Deadline)
}
func (s SynapseBridgeTokenDepositAndSwap) GetSwapTokenIndex() *uint8 {
return nil
}
func (s SynapseBridgeTokenDepositAndSwap) GetSwapMinAmount() *big.Int {
return nil
}
func (s SynapseBridgeTokenDepositAndSwap) GetSwapDeadline() *big.Int {
return nil
}
func (s SynapseBridgeTokenDepositAndSwap) GetRecipientBytes() *[32]byte {
return nil
}
func (s SynapseBridgeTokenDepositAndSwap) GetFee() *big.Int {
return nil
}
func (s SynapseBridgeTokenDepositAndSwap) GetKappa() *[32]byte {
return nil
}
func (s SynapseBridgeTokenDepositAndSwap) GetSwapSuccess() *bool {
return nil
}
func (s SynapseBridgeTokenDepositAndSwap) GetEventIndex() uint64 {
return uint64(s.Raw.Index)
}
var _ bridge.EventLog = &SynapseBridgeTokenDepositAndSwap{}