tx · AQkh8grG25QrUMHqq9YPjWANURKe3AsaDBBVVDvquQpv

3MwbESaeBZhdxSPCzJ7JxDZ79xUm2erVzf6:  -0.01000000 Waves

2024.11.21 12:56 [3381057] smart account 3MwbESaeBZhdxSPCzJ7JxDZ79xUm2erVzf6 > SELF 0.00000000 Waves

{ "type": 13, "id": "AQkh8grG25QrUMHqq9YPjWANURKe3AsaDBBVVDvquQpv", "fee": 1000000, "feeAssetId": null, "timestamp": 1732182933260, "version": 2, "chainId": 84, "sender": "3MwbESaeBZhdxSPCzJ7JxDZ79xUm2erVzf6", "senderPublicKey": "39btfTSFXQDSgoUexr66RNeGJ45hGXiopFBuyG2zmRyn", "proofs": [ "58Wn2q3PQySnL85AXEPrAPTCAc863TArr2qncPjfQCSLRkDMxDaiiWEWYNxrmVtfNpY3nby9816PtBa86aw2U1pM" ], "script": "base64:BwIVCAISBQoDCAgIEgUKAwgIGBIDCgEIJgAJU0VQQVJBVE9SAgJfXwAPQkFUQ0hfU0VQQVJBVE9SAgI6OgAMS0VZX01VTFRJU0lHAghNVUxUSVNJRwAKS0VZX1NUQVRVUwIGU1RBVFVTAAhLRVlfSU5JVAIESU5JVAAUS0VZX1NFUVVFTkNFUl9DQUxMRVICEFNFUVVFTkNFUl9DQUxMRVIAFEtFWV9HQVRFV0FZX0NPTlRSQUNUAhBHQVRFV0FZX0NPTlRSQUNUABFLRVlfU1BPVF9DT05UUkFDVAINU1BPVF9DT05UUkFDVAATS0VZX0xBU1RfQkFUQ0hfSEFTSAIPTEFTVF9CQVRDSF9IQVNIAA1GVU5DX1dJVEhEUkFXAgh3aXRoZHJhdwAKRlVOQ19UUkFERQIFdHJhZGUAEUZVTkNfQ0xBSU1fUkVXQVJEAgtjbGFpbVJld2FyZAAWRlVOQ19SRUpFQ1RfV0lUSERSQVdBTAIQcmVqZWN0V2l0aGRyYXdhbAAQR0FURVdBWV9XSVRIRFJBVwIQR0FURVdBWV9XSVRIRFJBVwARR0FURVdBWV9SRUpFQ1Rf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HRoaXMJAMwIAgkA2AQBCAUCdHgCaWQFA25pbAUJU0VQQVJBVE9SBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleUcApz8=", "height": 3381057, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9jHnHVPuMscKna1myC36s1PBTLjFY64GwwXQ3L4JnfHf Next: none Diff:
OldNewDifferences
2525
2626 let FUNC_CLAIM_REWARD = "claimReward"
2727
28+let FUNC_REJECT_WITHDRAWAL = "rejectWithdrawal"
29+
2830 let GATEWAY_WITHDRAW = "GATEWAY_WITHDRAW"
31+
32+let GATEWAY_REJECT_WD = "GATEWAY_REJECT_WD"
2933
3034 let SPOT_TRADE = "SPOT_TRADE"
3135
190194 then invoke(spotContract, FUNC_CLAIM_REWARD, functionArgs, nil)
191195 else if ((contractAction == GATEWAY_WITHDRAW))
192196 then invoke(gatewayContract, FUNC_WITHDRAW, functionArgs, nil)
193- else throw("processBatch: invalid operation")
197+ else if ((contractAction == GATEWAY_REJECT_WD))
198+ then invoke(gatewayContract, FUNC_REJECT_WITHDRAWAL, functionArgs, nil)
199+ else throw("processBatch: invalid operation")
194200 if ((invocation == invocation))
195201 then acc
196202 else throw("Strict value is not equal to itself.")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 7 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEPARATOR = "__"
55
66 let BATCH_SEPARATOR = "::"
77
88 let KEY_MULTISIG = "MULTISIG"
99
1010 let KEY_STATUS = "STATUS"
1111
1212 let KEY_INIT = "INIT"
1313
1414 let KEY_SEQUENCER_CALLER = "SEQUENCER_CALLER"
1515
1616 let KEY_GATEWAY_CONTRACT = "GATEWAY_CONTRACT"
1717
1818 let KEY_SPOT_CONTRACT = "SPOT_CONTRACT"
1919
2020 let KEY_LAST_BATCH_HASH = "LAST_BATCH_HASH"
2121
2222 let FUNC_WITHDRAW = "withdraw"
2323
2424 let FUNC_TRADE = "trade"
2525
2626 let FUNC_CLAIM_REWARD = "claimReward"
2727
28+let FUNC_REJECT_WITHDRAWAL = "rejectWithdrawal"
29+
2830 let GATEWAY_WITHDRAW = "GATEWAY_WITHDRAW"
31+
32+let GATEWAY_REJECT_WD = "GATEWAY_REJECT_WD"
2933
3034 let SPOT_TRADE = "SPOT_TRADE"
3135
3236 let SPOT_CLAIM_REWARD = "SPOT_CLAIM_REWARD"
3337
3438 let MAX_INT = 9223372036854775807
3539
3640 func _validateAddress (address_,err_) = match addressFromString(address_) {
3741 case a: Address =>
3842 true
3943 case _ =>
4044 throw(err_)
4145 }
4246
4347
4448 func _validateInt (val_,lowerBoundary_,upperBoundary_,err_) = if (if ((lowerBoundary_ > val_))
4549 then true
4650 else (val_ > upperBoundary_))
4751 then throw(err_)
4852 else true
4953
5054
5155 func _loadInit () = match getBoolean(KEY_INIT) {
5256 case a: Boolean =>
5357 a
5458 case _ =>
5559 false
5660 }
5761
5862
5963 func _saveInit (isInit_) = [BooleanEntry(KEY_INIT, isInit_)]
6064
6165
6266 func _loadMultisig () = match getString(KEY_MULTISIG) {
6367 case a: String =>
6468 addressFromStringValue(a)
6569 case _ =>
6670 Address(base58'')
6771 }
6872
6973
7074 func _saveMultisig (multisig_) = [StringEntry(KEY_MULTISIG, toString(multisig_))]
7175
7276
7377 func _loadSequencerCaller () = match getString(KEY_SEQUENCER_CALLER) {
7478 case a: String =>
7579 addressFromStringValue(a)
7680 case _ =>
7781 Address(base58'')
7882 }
7983
8084
8185 func _saveSequencerCaller (sequencerCaller_) = [StringEntry(KEY_SEQUENCER_CALLER, toString(sequencerCaller_))]
8286
8387
8488 func _loadGatewayContract () = match getString(KEY_GATEWAY_CONTRACT) {
8589 case a: String =>
8690 addressFromStringValue(a)
8791 case _ =>
8892 Address(base58'')
8993 }
9094
9195
9296 func _saveGatewayContract (gatewayContract_) = [StringEntry(KEY_GATEWAY_CONTRACT, toString(gatewayContract_))]
9397
9498
9599 func _loadSpotContract () = match getString(KEY_SPOT_CONTRACT) {
96100 case a: String =>
97101 addressFromStringValue(a)
98102 case _ =>
99103 Address(base58'')
100104 }
101105
102106
103107 func _saveSpotContract (spotContract_) = [StringEntry(KEY_SPOT_CONTRACT, toString(spotContract_))]
104108
105109
106110 func _loadLastBatchHash () = match getString(KEY_LAST_BATCH_HASH) {
107111 case a: String =>
108112 a
109113 case _ =>
110114 "GENESIS"
111115 }
112116
113117
114118 func _saveLastBatchHash (lastBatchHash_) = [StringEntry(KEY_LAST_BATCH_HASH, lastBatchHash_)]
115119
116120
117121 func _onlyThisContract (caller_) = if ((caller_ != this))
118122 then throw("_onlyThisContract: revert")
119123 else true
120124
121125
122126 func _whenMultisigSet () = if ((_loadMultisig() == Address(base58'')))
123127 then throw("_whenMultisigSet: revert")
124128 else true
125129
126130
127131 func _whenNotInitialized () = if (_loadInit())
128132 then throw("_whenNotInitialized: revert")
129133 else true
130134
131135
132136 func _whenInitialized () = if (!(_loadInit()))
133137 then throw("_whenInitialized: revert")
134138 else true
135139
136140
137141 func _validateSequencerCaller (caller,err_) = if ((_loadSequencerCaller() != caller))
138142 then throw(err_)
139143 else true
140144
141145
142146 func _validateBatchHash (lastBatchHash_,err_) = if ((_loadLastBatchHash() != lastBatchHash_))
143147 then throw(err_)
144148 else true
145149
146150
147151 @Callable(i)
148152 func init (sequencerCaller_,gatewayContract_,spotContract_) = {
149153 let err = if (if (if (if (if (_onlyThisContract(i.caller))
150154 then _whenNotInitialized()
151155 else false)
152156 then _whenMultisigSet()
153157 else false)
154158 then _validateAddress(sequencerCaller_, "init: invalid sequencerCaller")
155159 else false)
156160 then _validateAddress(gatewayContract_, "init: invalid gatewayContract")
157161 else false)
158162 then _validateAddress(spotContract_, "init: invalid spotContract")
159163 else false
160164 if ((err == err))
161165 then $Tuple2((((_saveInit(true) ++ _saveSequencerCaller(addressFromStringValue(sequencerCaller_))) ++ _saveGatewayContract(addressFromStringValue(gatewayContract_))) ++ _saveSpotContract(addressFromStringValue(spotContract_))), unit)
162166 else throw("Strict value is not equal to itself.")
163167 }
164168
165169
166170
167171 @Callable(i)
168172 func processBatch (currentBatchHash_,lastBatchHash_,batch_) = {
169173 let err = if (if (if (_validateSequencerCaller(i.caller, "processBatch: invalid sequencer caller"))
170174 then _validateInt(size(currentBatchHash_), 1, MAX_INT, "processBatch: invalid currentBatchHash")
171175 else false)
172176 then _validateBatchHash(lastBatchHash_, "processBatch: invalid lastBatchHash")
173177 else false)
174178 then _validateInt(size(batch_), 1, 10, "processBatch: invalid batch size")
175179 else false
176180 if ((err == err))
177181 then {
178182 let spotContract = _loadSpotContract()
179183 let gatewayContract = _loadGatewayContract()
180184 func foldFunc (acc,elem) = {
181185 let fields = split_4C(elem, BATCH_SEPARATOR)
182186 let err1 = _validateInt(size(fields), 1, 23, "processBatch: invalid elem size")
183187 if ((err1 == err1))
184188 then {
185189 let contractAction = fields[0]
186190 let functionArgs = removeByIndex(fields, 0)
187191 let invocation = if ((contractAction == SPOT_TRADE))
188192 then invoke(spotContract, FUNC_TRADE, functionArgs, nil)
189193 else if ((contractAction == SPOT_CLAIM_REWARD))
190194 then invoke(spotContract, FUNC_CLAIM_REWARD, functionArgs, nil)
191195 else if ((contractAction == GATEWAY_WITHDRAW))
192196 then invoke(gatewayContract, FUNC_WITHDRAW, functionArgs, nil)
193- else throw("processBatch: invalid operation")
197+ else if ((contractAction == GATEWAY_REJECT_WD))
198+ then invoke(gatewayContract, FUNC_REJECT_WITHDRAWAL, functionArgs, nil)
199+ else throw("processBatch: invalid operation")
194200 if ((invocation == invocation))
195201 then acc
196202 else throw("Strict value is not equal to itself.")
197203 }
198204 else throw("Strict value is not equal to itself.")
199205 }
200206
201207 let result = {
202208 let $l = batch_
203209 let $s = size($l)
204210 let $acc0 = true
205211 func $f0_1 ($a,$i) = if (($i >= $s))
206212 then $a
207213 else foldFunc($a, $l[$i])
208214
209215 func $f0_2 ($a,$i) = if (($i >= $s))
210216 then $a
211217 else throw("List size exceeds 10")
212218
213219 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
214220 }
215221 if ((result == result))
216222 then $Tuple2(_saveLastBatchHash(currentBatchHash_), unit)
217223 else throw("Strict value is not equal to itself.")
218224 }
219225 else throw("Strict value is not equal to itself.")
220226 }
221227
222228
223229
224230 @Callable(i)
225231 func setMultisig (multisig_) = {
226232 let err = if (_onlyThisContract(i.caller))
227233 then _validateAddress(multisig_, "setMultisig: invalid multisig")
228234 else false
229235 if ((err == err))
230236 then $Tuple2(_saveMultisig(addressFromStringValue(multisig_)), unit)
231237 else throw("Strict value is not equal to itself.")
232238 }
233239
234240
235241 @Verifier(tx)
236242 func verify () = match getString(KEY_MULTISIG) {
237243 case multisig: String =>
238244 valueOrElse(getBoolean(addressFromStringValue(multisig), makeString([KEY_STATUS, toString(this), toBase58String(tx.id)], SEPARATOR)), false)
239245 case _ =>
240246 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
241247 }
242248

github/deemru/w8io/026f985 
26.28 ms