tx · Gu5uQEFq2nJEQoEUnEL4Fyxcuurwr8CssSdES9ExStz7 3MyXFjhxofZUKbHj3p8TUgZwDEPNzq7YNo3: -0.01300000 Waves 2024.04.24 14:14 [3076835] smart account 3MyXFjhxofZUKbHj3p8TUgZwDEPNzq7YNo3 > SELF 0.00000000 Waves
{ "type": 13, "id": "Gu5uQEFq2nJEQoEUnEL4Fyxcuurwr8CssSdES9ExStz7", "fee": 1300000, "feeAssetId": null, "timestamp": 1713957311100, "version": 2, "chainId": 84, "sender": "3MyXFjhxofZUKbHj3p8TUgZwDEPNzq7YNo3", "senderPublicKey": "GMSDsb2uuChLYT3PeuzaUNyxyxCVWUKaV6Y5dP7xWxUV", "proofs": [ "61s4ePp5kpcbzJpUG3GCLa5LB8CT2fRAH9qRcpknDUgh4musW4hqLuk1G51ua8zHMLSD8oVCDXxSJVizatodMmui" ], "script": "base64:BgIQCAISABIDCgEIEgASAwoBCCwADGNvbnRyYWN0RmlsZQIObDJtcF9zd2FwLnJpZGUAA1NFUAICX18ABnNjYWxlOACAwtcvAQd3cmFwRXJyAQNtc2cJAKwCAgkArAICBQxjb250cmFjdEZpbGUCAjogBQNtc2cBCHRocm93RXJyAQNtc2cJAAIBCQEHd3JhcEVycgEFA21zZwAMa2V5QXNzZXRJbklkCQC5CQIJAMwIAgICJXMJAMwIAgIJYXNzZXRJbklkBQNuaWwFA1NFUAANa2V5QXNzZXRPdXRJZAkAuQkCCQDMCAICAiVzCQDMCAICCmFzc2V0T3V0SWQFA25pbAUDU0VQABBrZXlBc3NldE91dFByaWNlCQC5CQIJAMwIAgICJXMJAMwIAgINYXNzZXRPdXRQcmljZQUDbmlsBQNTRVAAEWtleVN0YWtpbmdBZGRyZXNzCQC5CQIJAMwIAgICJXMJAMwIAgIOc3Rha2luZ0FkZHJlc3MFA25pbAUDU0VQAA9rZXlTdGF0c1RvdGFsSW4JALkJAgkAzAgCAgQlcyVzCQDMCAICBXN0YXRzCQDMCAICB3RvdGFsSW4FA25pbAU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original | compacted Prev: CPpzo1XspHbkSqUVes88kBVNj3KSN8PDBS4nVAviEjdi Next: none Diff:
Old | New | Differences | |
---|---|---|---|
239 | 239 | } | |
240 | 240 | ||
241 | 241 | ||
242 | - | func isForceStopped () = { | |
243 | - | let keyForceStopContract = makeString(["%s", "forceStopContract"], SEP) | |
244 | - | let forceStopAddressString = valueOrElse(getString(this, keyForceStopContract), "") | |
245 | - | let forceStopAddress = valueOrElse(addressFromString(forceStopAddressString), this) | |
246 | - | let keyDisabledStatus = makeString(["%s%s", "disabled", toString(this)], SEP) | |
247 | - | let disabledStatus = valueOrElse(getBoolean(forceStopAddress, keyDisabledStatus), false) | |
248 | - | if ((disabledStatus == true)) | |
249 | - | then throw("Force stopped") | |
250 | - | else false | |
251 | - | } | |
252 | - | ||
253 | - | ||
254 | 242 | @Callable(i) | |
255 | - | func swap () = { | |
256 | - | let checkForceStop = isForceStopped() | |
257 | - | if ((checkForceStop == checkForceStop)) | |
258 | - | then getSwapActions(i, "NULL") | |
259 | - | else throw("Strict value is not equal to itself.") | |
260 | - | } | |
243 | + | func swap () = getSwapActions(i, "NULL") | |
261 | 244 | ||
262 | 245 | ||
263 | 246 | ||
264 | 247 | @Callable(i) | |
265 | 248 | func swapAndStake (stakingNode) = { | |
266 | - | let checkForceStop = isForceStopped() | |
267 | - | if ((checkForceStop == checkForceStop)) | |
249 | + | let check = [if (if (isValidAddress(stakingNode)) | |
250 | + | then true | |
251 | + | else (stakingNode == "")) | |
252 | + | then true | |
253 | + | else throwErr("staking node address is no valid")] | |
254 | + | if ((check == check)) | |
268 | 255 | then { | |
269 | - | let check = [if (if (isValidAddress(stakingNode)) | |
270 | - | then true | |
271 | - | else (stakingNode == "")) | |
272 | - | then true | |
273 | - | else throwErr("staking node address is no valid")] | |
274 | - | if ((check == check)) | |
275 | - | then { | |
276 | - | let node = if ((stakingNode == "")) | |
277 | - | then "NULL" | |
278 | - | else stakingNode | |
279 | - | getSwapActions(i, node) | |
280 | - | } | |
281 | - | else throw("Strict value is not equal to itself.") | |
256 | + | let node = if ((stakingNode == "")) | |
257 | + | then "NULL" | |
258 | + | else stakingNode | |
259 | + | getSwapActions(i, node) | |
282 | 260 | } | |
283 | 261 | else throw("Strict value is not equal to itself.") | |
284 | 262 | } | |
287 | 265 | ||
288 | 266 | @Callable(i) | |
289 | 267 | func claim () = { | |
290 | - | let checkForceStop = isForceStopped() | |
291 | - | if ((checkForceStop == checkForceStop)) | |
292 | - | then { | |
293 | - | let checkCaller = if ((i.caller == allowedAddress)) | |
294 | - | then true | |
295 | - | else throwErr("permission denied") | |
296 | - | if ((checkCaller == checkCaller)) | |
297 | - | then $Tuple2([ScriptTransfer(allowedAddress, assetBalance(this, assetInId), assetInId)], unit) | |
298 | - | else throw("Strict value is not equal to itself.") | |
299 | - | } | |
268 | + | let checkCaller = if ((i.caller == allowedAddress)) | |
269 | + | then true | |
270 | + | else throwErr("permission denied") | |
271 | + | if ((checkCaller == checkCaller)) | |
272 | + | then $Tuple2([ScriptTransfer(allowedAddress, assetBalance(this, assetInId), assetInId)], unit) | |
300 | 273 | else throw("Strict value is not equal to itself.") | |
301 | 274 | } | |
302 | 275 | ||
304 | 277 | ||
305 | 278 | @Callable(i) | |
306 | 279 | func voteForTxId (txId) = { | |
307 | - | let checkForceStop = isForceStopped() | |
308 | - | if ((checkForceStop == checkForceStop)) | |
309 | - | then { | |
310 | - | let callerAddressString = toBase58String(i.caller.bytes) | |
311 | - | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
312 | - | let result = [StringEntry(keyAllowedTxId(), txId)] | |
313 | - | let allowedTxIdOption = getString(this, keyAllowedTxId()) | |
314 | - | let err = [if ((size(fromBase58String(txId)) == TXID_BYTES_LENGTH)) | |
315 | - | then true | |
316 | - | else throwErr((txId + " is not valid txId")), if (if ((allowedTxIdOption == unit)) | |
317 | - | then true | |
318 | - | else (value(allowedTxIdOption) != txId)) | |
319 | - | then true | |
320 | - | else throwErr((txId + " is already allowed"))] | |
321 | - | if ((err == err)) | |
322 | - | then voteINTERNAL(callerAddressString, keyPrefix, QUORUM, result) | |
323 | - | else throw("Strict value is not equal to itself.") | |
324 | - | } | |
280 | + | let callerAddressString = toBase58String(i.caller.bytes) | |
281 | + | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
282 | + | let result = [StringEntry(keyAllowedTxId(), txId)] | |
283 | + | let allowedTxIdOption = getString(this, keyAllowedTxId()) | |
284 | + | let err = [if ((size(fromBase58String(txId)) == TXID_BYTES_LENGTH)) | |
285 | + | then true | |
286 | + | else throwErr((txId + " is not valid txId")), if (if ((allowedTxIdOption == unit)) | |
287 | + | then true | |
288 | + | else (value(allowedTxIdOption) != txId)) | |
289 | + | then true | |
290 | + | else throwErr((txId + " is already allowed"))] | |
291 | + | if ((err == err)) | |
292 | + | then voteINTERNAL(callerAddressString, keyPrefix, QUORUM, result) | |
325 | 293 | else throw("Strict value is not equal to itself.") | |
326 | 294 | } | |
327 | 295 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let contractFile = "l2mp_swap.ride" | |
5 | 5 | ||
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | let scale8 = 100000000 | |
9 | 9 | ||
10 | 10 | func wrapErr (msg) = ((contractFile + ": ") + msg) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func throwErr (msg) = throw(wrapErr(msg)) | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | let keyAssetInId = makeString(["%s", "assetInId"], SEP) | |
17 | 17 | ||
18 | 18 | let keyAssetOutId = makeString(["%s", "assetOutId"], SEP) | |
19 | 19 | ||
20 | 20 | let keyAssetOutPrice = makeString(["%s", "assetOutPrice"], SEP) | |
21 | 21 | ||
22 | 22 | let keyStakingAddress = makeString(["%s", "stakingAddress"], SEP) | |
23 | 23 | ||
24 | 24 | let keyStatsTotalIn = makeString(["%s%s", "stats", "totalIn"], SEP) | |
25 | 25 | ||
26 | 26 | let keyStatsTotalOut = makeString(["%s%s", "stats", "totalOut"], SEP) | |
27 | 27 | ||
28 | 28 | let keyAllowedAddress = makeString(["%s", "allowedAddress"], SEP) | |
29 | 29 | ||
30 | 30 | func keyStatsTotalInByAddress (address) = makeString(["%s%s%s", "stats", "totalIn", toString(address)], SEP) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func keyStatsTotalOutByAddress (address) = makeString(["%s%s%s", "stats", "totalOut", toString(address)], SEP) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func keyHistory (address,txId) = makeString(["%s%s%s", "history", toString(address), toBase58String(txId)], SEP) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func formatHistory (amountIn,amountOut,stake,stakingNode) = makeString(["%d%d%b%s", toString(amountIn), toString(amountOut), toString(stake), stakingNode], SEP) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | let assetInId = fromBase58String(valueOrErrorMessage(getString(this, keyAssetInId), wrapErr("invalid assetInId"))) | |
43 | 43 | ||
44 | 44 | let assetInInfo = valueOrErrorMessage(assetInfo(assetInId), wrapErr("invalid assetInInfo")) | |
45 | 45 | ||
46 | 46 | let assetOutId = fromBase58String(valueOrErrorMessage(getString(this, keyAssetOutId), wrapErr("invalid assetInId"))) | |
47 | 47 | ||
48 | 48 | let assetOutInfo = valueOrErrorMessage(assetInfo(assetOutId), wrapErr("invalid assetOutInfo")) | |
49 | 49 | ||
50 | 50 | let assetOutPrice = valueOrErrorMessage(getInteger(this, keyAssetOutPrice), wrapErr("invalid assetOutPrice")) | |
51 | 51 | ||
52 | 52 | let stakingAddressOption = match getString(this, keyStakingAddress) { | |
53 | 53 | case s: String => | |
54 | 54 | addressFromString(s) | |
55 | 55 | case _: Unit => | |
56 | 56 | unit | |
57 | 57 | case _ => | |
58 | 58 | throw("Match error") | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | let stakingAddress = valueOrErrorMessage(stakingAddressOption, wrapErr("invalid stakingAddress")) | |
62 | 62 | ||
63 | 63 | let allowedAddressOption = match getString(this, keyAllowedAddress) { | |
64 | 64 | case s: String => | |
65 | 65 | addressFromString(s) | |
66 | 66 | case _: Unit => | |
67 | 67 | unit | |
68 | 68 | case _ => | |
69 | 69 | throw("Match error") | |
70 | 70 | } | |
71 | 71 | ||
72 | 72 | let allowedAddress = valueOrErrorMessage(allowedAddressOption, wrapErr("invalid allowedAddress")) | |
73 | 73 | ||
74 | 74 | func isValidAddress (addressString) = match addressFromString(addressString) { | |
75 | 75 | case t: Address => | |
76 | 76 | true | |
77 | 77 | case _ => | |
78 | 78 | false | |
79 | 79 | } | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | let ADMIN_LIST_SIZE = 5 | |
83 | 83 | ||
84 | 84 | let QUORUM = 3 | |
85 | 85 | ||
86 | 86 | let TXID_BYTES_LENGTH = 32 | |
87 | 87 | ||
88 | 88 | func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func keyFullAdminVote (prefix,adminAddress) = makeString([prefix, adminAddress], SEP) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func keyAllowedTxId () = makeString(["%s", "txId"], SEP) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func getAdminVote (prefix,admin) = { | |
101 | 101 | let voteKey = keyFullAdminVote(prefix, admin) | |
102 | 102 | valueOrElse(getInteger(voteKey), 0) | |
103 | 103 | } | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func getAdminsList () = match getString(this, keyAdminAddressList()) { | |
107 | 107 | case s: String => | |
108 | 108 | split(s, SEP) | |
109 | 109 | case _ => | |
110 | 110 | nil | |
111 | 111 | } | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func isInAdminList (address) = containsElement(getAdminsList(), address) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func genVotesKeysHelper (a,adminAddress) = { | |
118 | 118 | let $t034863510 = a | |
119 | 119 | let result = $t034863510._1 | |
120 | 120 | let prefix = $t034863510._2 | |
121 | 121 | $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix) | |
122 | 122 | } | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func genVotesKeys (keyPrefix) = { | |
126 | 126 | let adminList = keyAdminAddressList() | |
127 | 127 | let $t036573741 = { | |
128 | 128 | let $l = getAdminsList() | |
129 | 129 | let $s = size($l) | |
130 | 130 | let $acc0 = $Tuple2(nil, keyPrefix) | |
131 | 131 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
132 | 132 | then $a | |
133 | 133 | else genVotesKeysHelper($a, $l[$i]) | |
134 | 134 | ||
135 | 135 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
136 | 136 | then $a | |
137 | 137 | else throw("List size exceeds 5") | |
138 | 138 | ||
139 | 139 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
140 | 140 | } | |
141 | 141 | let result = $t036573741._1 | |
142 | 142 | let prefix = $t036573741._2 | |
143 | 143 | result | |
144 | 144 | } | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0)) | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func countVotes (prefix) = { | |
151 | 151 | let votes = genVotesKeys(prefix) | |
152 | 152 | let $l = votes | |
153 | 153 | let $s = size($l) | |
154 | 154 | let $acc0 = 0 | |
155 | 155 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
156 | 156 | then $a | |
157 | 157 | else countVotesHelper($a, $l[$i]) | |
158 | 158 | ||
159 | 159 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
160 | 160 | then $a | |
161 | 161 | else throw("List size exceeds 5") | |
162 | 162 | ||
163 | 163 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
164 | 164 | } | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func clearVotesHelper (result,key) = (result :+ DeleteEntry(key)) | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func getClearVoteEntries (prefix) = { | |
171 | 171 | let votes = genVotesKeys(prefix) | |
172 | 172 | let $l = votes | |
173 | 173 | let $s = size($l) | |
174 | 174 | let $acc0 = nil | |
175 | 175 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
176 | 176 | then $a | |
177 | 177 | else clearVotesHelper($a, $l[$i]) | |
178 | 178 | ||
179 | 179 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
180 | 180 | then $a | |
181 | 181 | else throw("List size exceeds 5") | |
182 | 182 | ||
183 | 183 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
184 | 184 | } | |
185 | 185 | ||
186 | 186 | ||
187 | 187 | func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = { | |
188 | 188 | let voteKey = keyFullAdminVote(keyPrefix, callerAddressString) | |
189 | 189 | let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString) | |
190 | 190 | let err = if (!(isInAdminList(callerAddressString))) | |
191 | 191 | then throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
192 | 192 | else if ((adminCurrentVote == 1)) | |
193 | 193 | then throwErr((voteKey + " you already voted")) | |
194 | 194 | else unit | |
195 | 195 | if ((err == err)) | |
196 | 196 | then { | |
197 | 197 | let votes = countVotes(keyPrefix) | |
198 | 198 | if (((votes + 1) >= minVotes)) | |
199 | 199 | then { | |
200 | 200 | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
201 | 201 | (clearVoteEntries ++ voteResult) | |
202 | 202 | } | |
203 | 203 | else [IntegerEntry(voteKey, 1)] | |
204 | 204 | } | |
205 | 205 | else throw("Strict value is not equal to itself.") | |
206 | 206 | } | |
207 | 207 | ||
208 | 208 | ||
209 | 209 | func getSwapActions (i,stakingNode) = { | |
210 | 210 | let userAddress = i.originCaller | |
211 | 211 | let payment = i.payments[0] | |
212 | 212 | let assetInAmount = payment.amount | |
213 | 213 | let assetOutAmount = fraction(assetInAmount, scale8, assetOutPrice) | |
214 | 214 | let stake = if (isValidAddress(stakingNode)) | |
215 | 215 | then true | |
216 | 216 | else false | |
217 | 217 | let checks = [if ((size(i.payments) == 1)) | |
218 | 218 | then true | |
219 | 219 | else throwErr("invalid payments size"), if ((payment.assetId == assetInId)) | |
220 | 220 | then true | |
221 | 221 | else throwErr("invalid payment assetId"), if ((assetOutPrice > 0)) | |
222 | 222 | then true | |
223 | 223 | else throwErr("invalid assetOutPrice"), if ((assetOutAmount > 0)) | |
224 | 224 | then true | |
225 | 225 | else throwErr("invalid assetOutAmount")] | |
226 | 226 | if ((checks == checks)) | |
227 | 227 | then { | |
228 | 228 | let stakeAction = if (!(stake)) | |
229 | 229 | then [ScriptTransfer(userAddress, assetOutAmount, assetOutId)] | |
230 | 230 | else { | |
231 | 231 | let stakeInvoke = invoke(stakingAddress, "leaseByAddress", [stakingNode, toString(userAddress)], [AttachedPayment(assetOutId, assetOutAmount)]) | |
232 | 232 | if ((stakeInvoke == stakeInvoke)) | |
233 | 233 | then nil | |
234 | 234 | else throw("Strict value is not equal to itself.") | |
235 | 235 | } | |
236 | 236 | $Tuple2(([IntegerEntry(keyStatsTotalIn, (valueOrElse(getInteger(this, keyStatsTotalIn), 0) + assetInAmount)), IntegerEntry(keyStatsTotalOut, (valueOrElse(getInteger(this, keyStatsTotalOut), 0) + assetOutAmount)), IntegerEntry(keyStatsTotalInByAddress(userAddress), (valueOrElse(getInteger(this, keyStatsTotalInByAddress(userAddress)), 0) + assetInAmount)), IntegerEntry(keyStatsTotalOutByAddress(userAddress), (valueOrElse(getInteger(this, keyStatsTotalOutByAddress(userAddress)), 0) + assetOutAmount)), StringEntry(keyHistory(userAddress, i.transactionId), formatHistory(assetInAmount, assetOutAmount, stake, stakingNode))] ++ stakeAction), assetOutAmount) | |
237 | 237 | } | |
238 | 238 | else throw("Strict value is not equal to itself.") | |
239 | 239 | } | |
240 | 240 | ||
241 | 241 | ||
242 | - | func isForceStopped () = { | |
243 | - | let keyForceStopContract = makeString(["%s", "forceStopContract"], SEP) | |
244 | - | let forceStopAddressString = valueOrElse(getString(this, keyForceStopContract), "") | |
245 | - | let forceStopAddress = valueOrElse(addressFromString(forceStopAddressString), this) | |
246 | - | let keyDisabledStatus = makeString(["%s%s", "disabled", toString(this)], SEP) | |
247 | - | let disabledStatus = valueOrElse(getBoolean(forceStopAddress, keyDisabledStatus), false) | |
248 | - | if ((disabledStatus == true)) | |
249 | - | then throw("Force stopped") | |
250 | - | else false | |
251 | - | } | |
252 | - | ||
253 | - | ||
254 | 242 | @Callable(i) | |
255 | - | func swap () = { | |
256 | - | let checkForceStop = isForceStopped() | |
257 | - | if ((checkForceStop == checkForceStop)) | |
258 | - | then getSwapActions(i, "NULL") | |
259 | - | else throw("Strict value is not equal to itself.") | |
260 | - | } | |
243 | + | func swap () = getSwapActions(i, "NULL") | |
261 | 244 | ||
262 | 245 | ||
263 | 246 | ||
264 | 247 | @Callable(i) | |
265 | 248 | func swapAndStake (stakingNode) = { | |
266 | - | let checkForceStop = isForceStopped() | |
267 | - | if ((checkForceStop == checkForceStop)) | |
249 | + | let check = [if (if (isValidAddress(stakingNode)) | |
250 | + | then true | |
251 | + | else (stakingNode == "")) | |
252 | + | then true | |
253 | + | else throwErr("staking node address is no valid")] | |
254 | + | if ((check == check)) | |
268 | 255 | then { | |
269 | - | let check = [if (if (isValidAddress(stakingNode)) | |
270 | - | then true | |
271 | - | else (stakingNode == "")) | |
272 | - | then true | |
273 | - | else throwErr("staking node address is no valid")] | |
274 | - | if ((check == check)) | |
275 | - | then { | |
276 | - | let node = if ((stakingNode == "")) | |
277 | - | then "NULL" | |
278 | - | else stakingNode | |
279 | - | getSwapActions(i, node) | |
280 | - | } | |
281 | - | else throw("Strict value is not equal to itself.") | |
256 | + | let node = if ((stakingNode == "")) | |
257 | + | then "NULL" | |
258 | + | else stakingNode | |
259 | + | getSwapActions(i, node) | |
282 | 260 | } | |
283 | 261 | else throw("Strict value is not equal to itself.") | |
284 | 262 | } | |
285 | 263 | ||
286 | 264 | ||
287 | 265 | ||
288 | 266 | @Callable(i) | |
289 | 267 | func claim () = { | |
290 | - | let checkForceStop = isForceStopped() | |
291 | - | if ((checkForceStop == checkForceStop)) | |
292 | - | then { | |
293 | - | let checkCaller = if ((i.caller == allowedAddress)) | |
294 | - | then true | |
295 | - | else throwErr("permission denied") | |
296 | - | if ((checkCaller == checkCaller)) | |
297 | - | then $Tuple2([ScriptTransfer(allowedAddress, assetBalance(this, assetInId), assetInId)], unit) | |
298 | - | else throw("Strict value is not equal to itself.") | |
299 | - | } | |
268 | + | let checkCaller = if ((i.caller == allowedAddress)) | |
269 | + | then true | |
270 | + | else throwErr("permission denied") | |
271 | + | if ((checkCaller == checkCaller)) | |
272 | + | then $Tuple2([ScriptTransfer(allowedAddress, assetBalance(this, assetInId), assetInId)], unit) | |
300 | 273 | else throw("Strict value is not equal to itself.") | |
301 | 274 | } | |
302 | 275 | ||
303 | 276 | ||
304 | 277 | ||
305 | 278 | @Callable(i) | |
306 | 279 | func voteForTxId (txId) = { | |
307 | - | let checkForceStop = isForceStopped() | |
308 | - | if ((checkForceStop == checkForceStop)) | |
309 | - | then { | |
310 | - | let callerAddressString = toBase58String(i.caller.bytes) | |
311 | - | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
312 | - | let result = [StringEntry(keyAllowedTxId(), txId)] | |
313 | - | let allowedTxIdOption = getString(this, keyAllowedTxId()) | |
314 | - | let err = [if ((size(fromBase58String(txId)) == TXID_BYTES_LENGTH)) | |
315 | - | then true | |
316 | - | else throwErr((txId + " is not valid txId")), if (if ((allowedTxIdOption == unit)) | |
317 | - | then true | |
318 | - | else (value(allowedTxIdOption) != txId)) | |
319 | - | then true | |
320 | - | else throwErr((txId + " is already allowed"))] | |
321 | - | if ((err == err)) | |
322 | - | then voteINTERNAL(callerAddressString, keyPrefix, QUORUM, result) | |
323 | - | else throw("Strict value is not equal to itself.") | |
324 | - | } | |
280 | + | let callerAddressString = toBase58String(i.caller.bytes) | |
281 | + | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
282 | + | let result = [StringEntry(keyAllowedTxId(), txId)] | |
283 | + | let allowedTxIdOption = getString(this, keyAllowedTxId()) | |
284 | + | let err = [if ((size(fromBase58String(txId)) == TXID_BYTES_LENGTH)) | |
285 | + | then true | |
286 | + | else throwErr((txId + " is not valid txId")), if (if ((allowedTxIdOption == unit)) | |
287 | + | then true | |
288 | + | else (value(allowedTxIdOption) != txId)) | |
289 | + | then true | |
290 | + | else throwErr((txId + " is already allowed"))] | |
291 | + | if ((err == err)) | |
292 | + | then voteINTERNAL(callerAddressString, keyPrefix, QUORUM, result) | |
325 | 293 | else throw("Strict value is not equal to itself.") | |
326 | 294 | } | |
327 | 295 | ||
328 | 296 | ||
329 | 297 | @Verifier(tx) | |
330 | 298 | func verify () = { | |
331 | 299 | let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(this, keyAllowedTxId()), ""))) | |
332 | 300 | let byOwner = if ((size(getAdminsList()) >= QUORUM)) | |
333 | 301 | then false | |
334 | 302 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
335 | 303 | if (byAdmins) | |
336 | 304 | then true | |
337 | 305 | else byOwner | |
338 | 306 | } | |
339 | 307 |
github/deemru/w8io/169f3d6 48.97 ms ◑