tx · 2zhLDdgkUJedH3EUp11sSv7VXQDMvWErLDjTFbpkpkjt 3MsgzbtRg8NEkbTcHBywtwTdCe9BRxMQo5T: -0.00800000 Waves 2024.11.18 11:58 [3376685] smart account 3MsgzbtRg8NEkbTcHBywtwTdCe9BRxMQo5T > SELF 0.00000000 Waves
{ "type": 13, "id": "2zhLDdgkUJedH3EUp11sSv7VXQDMvWErLDjTFbpkpkjt", "fee": 800000, "feeAssetId": null, "timestamp": 1731920310972, "version": 2, "chainId": 84, "sender": "3MsgzbtRg8NEkbTcHBywtwTdCe9BRxMQo5T", "senderPublicKey": "iTiQR3Kvxn7i8PFgEbZn36n5iFLxFwkTA6M3wi846Vx", "proofs": [ "3oUUtkjb3RcGFccutqu6Fg8x5KD2RME5kWKFrPnLEm9nbYcTLUPSC95f2SkKkHE3ZqYk1LbswVGqz78N82t3LE8" ], "script": "base64:BwJbCAISAwoBCBIECgIICBIECgIIARIECgIIBBIECgIIAhIDCgEIEgUKAwIBBBIECgICARIFCgMCAQISBQoDAhIREgQKAgIBEgQKAggYEgQKAggYEgMKAQESAwoBCCMAA1NFUAICX18AC3dhdmVzU3RyaW5nAgVXQVZFUwAQY29udHJhY3RGaWxlbmFtZQIUbWVtZV9pbV9mYWN0b3J5LnJpZGUAC2tQcmljZUFzc2V0AgxwcmljZV9fYXNzZXQACWtTaHV0ZG93bgIOc2h1dGRvd25fX2ZsYWcACHNodXRkb3duCQELdmFsdWVPckVsc2UCCQCgCAEFCWtTaHV0ZG93bgcBB3dyYXBFcnIBAXMJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMAD0FETUlOX0xJU1RfU0laRQAKAAZRVU9SVU0AAwARVFhJRF9CWVRFU19MRU5HVEgAIAEYa2V5QWxsb3dlZFR4SWRWb3RlUHJlZml4AQR0eElkCQC5CQIJAMwIAgIGJXMlcyVzCQDMCAICCWFsbG93VHhJZAkAzAg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GVGb3JUeElkAQR0eElkBBNjYWxsZXJBZGRyZXNzU3RyaW5nCQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMECWtleVByZWZpeAkBGGtleUFsbG93ZWRUeElkVm90ZVByZWZpeAEFBHR4SWQEBnJlc3VsdAkAzAgCCQELU3RyaW5nRW50cnkCCQEOa2V5QWxsb3dlZFR4SWQABQR0eElkBQNuaWwEEWFsbG93ZWRUeElkT3B0aW9uCQCdCAIFBHRoaXMJAQ5rZXlBbGxvd2VkVHhJZAAEA2VycgkAzAgCAwkAAAIJAMgBAQkA2QQBBQR0eElkBRFUWElEX0JZVEVTX0xFTkdUSAYJAQh0aHJvd0VycgEJAKwCAgUEdHhJZAISIGlzIG5vdCB2YWxpZCB0eElkCQDMCAIDAwkAAAIFEWFsbG93ZWRUeElkT3B0aW9uBQR1bml0BgkBAiE9AgkBBXZhbHVlAQURYWxsb3dlZFR4SWRPcHRpb24FBHR4SWQGCQEIdGhyb3dFcnIBCQCsAgIFBHR4SWQCEyBpcyBhbHJlYWR5IGFsbG93ZWQFA25pbAMJAAACBQNlcnIFA2VycgkBDHZvdGVJTlRFUk5BTAQFE2NhbGxlckFkZHJlc3NTdHJpbmcFCWtleVByZWZpeAUGUVVPUlVNBQZyZXN1bHQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4A5Nmu7g==", "height": 3376685, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FH2e5hPUf8o7CfbdQuY44NEafiWXezNwYUQfsnmsaUa4 Next: 4QTuVspwQvaP834z8rbWSSMf1pkmhnzSauW6EFpiJKW2 Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 7 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let wavesString = "WAVES" | |
7 | 7 | ||
17 | 17 | ||
18 | 18 | ||
19 | 19 | func throwErr (s) = throw(wrapErr(s)) | |
20 | + | ||
21 | + | ||
22 | + | let ADMIN_LIST_SIZE = 10 | |
23 | + | ||
24 | + | let QUORUM = 3 | |
25 | + | ||
26 | + | let TXID_BYTES_LENGTH = 32 | |
27 | + | ||
28 | + | func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP) | |
29 | + | ||
30 | + | ||
31 | + | func keyFullAdminVote (prefix,adminAddress) = makeString([prefix, adminAddress], SEP) | |
32 | + | ||
33 | + | ||
34 | + | func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP) | |
35 | + | ||
36 | + | ||
37 | + | func keyAllowedTxId () = makeString(["%s", "txId"], SEP) | |
38 | + | ||
39 | + | ||
40 | + | func getAdminVote (prefix,admin) = { | |
41 | + | let voteKey = keyFullAdminVote(prefix, admin) | |
42 | + | valueOrElse(getInteger(voteKey), 0) | |
43 | + | } | |
44 | + | ||
45 | + | ||
46 | + | func getAdminsList () = match getString(this, keyAdminAddressList()) { | |
47 | + | case s: String => | |
48 | + | split(s, SEP) | |
49 | + | case _ => | |
50 | + | nil | |
51 | + | } | |
52 | + | ||
53 | + | ||
54 | + | let adminList = getAdminsList() | |
55 | + | ||
56 | + | func isInAdminList (address) = containsElement(adminList, address) | |
57 | + | ||
58 | + | ||
59 | + | func genVotesKeysHelper (a,adminAddress) = { | |
60 | + | let $t015021526 = a | |
61 | + | let result = $t015021526._1 | |
62 | + | let prefix = $t015021526._2 | |
63 | + | $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix) | |
64 | + | } | |
65 | + | ||
66 | + | ||
67 | + | func genVotesKeys (keyPrefix) = { | |
68 | + | let $t016371716 = { | |
69 | + | let $l = adminList | |
70 | + | let $s = size($l) | |
71 | + | let $acc0 = $Tuple2(nil, keyPrefix) | |
72 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
73 | + | then $a | |
74 | + | else genVotesKeysHelper($a, $l[$i]) | |
75 | + | ||
76 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
77 | + | then $a | |
78 | + | else throw("List size exceeds 10") | |
79 | + | ||
80 | + | $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) | |
81 | + | } | |
82 | + | let result = $t016371716._1 | |
83 | + | let prefix = $t016371716._2 | |
84 | + | result | |
85 | + | } | |
86 | + | ||
87 | + | ||
88 | + | func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0)) | |
89 | + | ||
90 | + | ||
91 | + | func countVotes (prefix) = { | |
92 | + | let votes = genVotesKeys(prefix) | |
93 | + | let $l = votes | |
94 | + | let $s = size($l) | |
95 | + | let $acc0 = 0 | |
96 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
97 | + | then $a | |
98 | + | else countVotesHelper($a, $l[$i]) | |
99 | + | ||
100 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
101 | + | then $a | |
102 | + | else throw("List size exceeds 10") | |
103 | + | ||
104 | + | $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) | |
105 | + | } | |
106 | + | ||
107 | + | ||
108 | + | func clearVotesHelper (result,key) = (result :+ DeleteEntry(key)) | |
109 | + | ||
110 | + | ||
111 | + | func getClearVoteEntries (prefix) = { | |
112 | + | let votes = genVotesKeys(prefix) | |
113 | + | let $l = votes | |
114 | + | let $s = size($l) | |
115 | + | let $acc0 = nil | |
116 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
117 | + | then $a | |
118 | + | else clearVotesHelper($a, $l[$i]) | |
119 | + | ||
120 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
121 | + | then $a | |
122 | + | else throw("List size exceeds 10") | |
123 | + | ||
124 | + | $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) | |
125 | + | } | |
126 | + | ||
127 | + | ||
128 | + | func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = { | |
129 | + | let voteKey = keyFullAdminVote(keyPrefix, callerAddressString) | |
130 | + | let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString) | |
131 | + | let err = if (!(isInAdminList(callerAddressString))) | |
132 | + | then throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
133 | + | else if ((adminCurrentVote == 1)) | |
134 | + | then throwErr((voteKey + " you already voted")) | |
135 | + | else unit | |
136 | + | if ((err == err)) | |
137 | + | then { | |
138 | + | let votes = countVotes(keyPrefix) | |
139 | + | if (((votes + 1) >= minVotes)) | |
140 | + | then { | |
141 | + | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
142 | + | (clearVoteEntries ++ voteResult) | |
143 | + | } | |
144 | + | else [IntegerEntry(voteKey, 1)] | |
145 | + | } | |
146 | + | else throw("Strict value is not equal to itself.") | |
147 | + | } | |
20 | 148 | ||
21 | 149 | ||
22 | 150 | func validateAddress (address) = isDefined(addressFromString(address)) | |
144 | 272 | else false) | |
145 | 273 | then { | |
146 | 274 | func addNewTransfer (acc,nextAssetId) = { | |
147 | - | let $ | |
148 | - | let transfers = $ | |
149 | - | let j = $ | |
275 | + | let $t059796003 = acc | |
276 | + | let transfers = $t059796003._1 | |
277 | + | let j = $t059796003._2 | |
150 | 278 | let newTransfer = ScriptTransfer(Address(recipientBytes), amountsList[j], assetsList[j]) | |
151 | 279 | let updatedTransfers = (transfers :+ newTransfer) | |
152 | 280 | $Tuple2(updatedTransfers, (j + 1)) | |
153 | 281 | } | |
154 | 282 | ||
155 | - | let $ | |
283 | + | let $t062406321 = { | |
156 | 284 | let $l = assetsList | |
157 | 285 | let $s = size($l) | |
158 | 286 | let $acc0 = $Tuple2(nil, 0) | |
166 | 294 | ||
167 | 295 | $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) | |
168 | 296 | } | |
169 | - | let assetsTransfers = $ | |
170 | - | let _lastIndex = $ | |
297 | + | let assetsTransfers = $t062406321._1 | |
298 | + | let _lastIndex = $t062406321._2 | |
171 | 299 | $Tuple2(assetsTransfers, unit) | |
172 | 300 | } | |
173 | 301 | else throwErr("not allowed") | |
213 | 341 | } | |
214 | 342 | ||
215 | 343 | ||
344 | + | ||
345 | + | @Callable(i) | |
346 | + | func voteForTxId (txId) = { | |
347 | + | let callerAddressString = toBase58String(i.caller.bytes) | |
348 | + | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
349 | + | let result = [StringEntry(keyAllowedTxId(), txId)] | |
350 | + | let allowedTxIdOption = getString(this, keyAllowedTxId()) | |
351 | + | let err = [if ((size(fromBase58String(txId)) == TXID_BYTES_LENGTH)) | |
352 | + | then true | |
353 | + | else throwErr((txId + " is not valid txId")), if (if ((allowedTxIdOption == unit)) | |
354 | + | then true | |
355 | + | else (value(allowedTxIdOption) != txId)) | |
356 | + | then true | |
357 | + | else throwErr((txId + " is already allowed"))] | |
358 | + | if ((err == err)) | |
359 | + | then voteINTERNAL(callerAddressString, keyPrefix, QUORUM, result) | |
360 | + | else throw("Strict value is not equal to itself.") | |
361 | + | } | |
362 | + | ||
363 | + |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 7 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let wavesString = "WAVES" | |
7 | 7 | ||
8 | 8 | let contractFilename = "meme_im_factory.ride" | |
9 | 9 | ||
10 | 10 | let kPriceAsset = "price__asset" | |
11 | 11 | ||
12 | 12 | let kShutdown = "shutdown__flag" | |
13 | 13 | ||
14 | 14 | let shutdown = valueOrElse(getBoolean(kShutdown), false) | |
15 | 15 | ||
16 | 16 | func wrapErr (s) = ((contractFilename + ": ") + s) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func throwErr (s) = throw(wrapErr(s)) | |
20 | + | ||
21 | + | ||
22 | + | let ADMIN_LIST_SIZE = 10 | |
23 | + | ||
24 | + | let QUORUM = 3 | |
25 | + | ||
26 | + | let TXID_BYTES_LENGTH = 32 | |
27 | + | ||
28 | + | func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP) | |
29 | + | ||
30 | + | ||
31 | + | func keyFullAdminVote (prefix,adminAddress) = makeString([prefix, adminAddress], SEP) | |
32 | + | ||
33 | + | ||
34 | + | func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP) | |
35 | + | ||
36 | + | ||
37 | + | func keyAllowedTxId () = makeString(["%s", "txId"], SEP) | |
38 | + | ||
39 | + | ||
40 | + | func getAdminVote (prefix,admin) = { | |
41 | + | let voteKey = keyFullAdminVote(prefix, admin) | |
42 | + | valueOrElse(getInteger(voteKey), 0) | |
43 | + | } | |
44 | + | ||
45 | + | ||
46 | + | func getAdminsList () = match getString(this, keyAdminAddressList()) { | |
47 | + | case s: String => | |
48 | + | split(s, SEP) | |
49 | + | case _ => | |
50 | + | nil | |
51 | + | } | |
52 | + | ||
53 | + | ||
54 | + | let adminList = getAdminsList() | |
55 | + | ||
56 | + | func isInAdminList (address) = containsElement(adminList, address) | |
57 | + | ||
58 | + | ||
59 | + | func genVotesKeysHelper (a,adminAddress) = { | |
60 | + | let $t015021526 = a | |
61 | + | let result = $t015021526._1 | |
62 | + | let prefix = $t015021526._2 | |
63 | + | $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix) | |
64 | + | } | |
65 | + | ||
66 | + | ||
67 | + | func genVotesKeys (keyPrefix) = { | |
68 | + | let $t016371716 = { | |
69 | + | let $l = adminList | |
70 | + | let $s = size($l) | |
71 | + | let $acc0 = $Tuple2(nil, keyPrefix) | |
72 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
73 | + | then $a | |
74 | + | else genVotesKeysHelper($a, $l[$i]) | |
75 | + | ||
76 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
77 | + | then $a | |
78 | + | else throw("List size exceeds 10") | |
79 | + | ||
80 | + | $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) | |
81 | + | } | |
82 | + | let result = $t016371716._1 | |
83 | + | let prefix = $t016371716._2 | |
84 | + | result | |
85 | + | } | |
86 | + | ||
87 | + | ||
88 | + | func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0)) | |
89 | + | ||
90 | + | ||
91 | + | func countVotes (prefix) = { | |
92 | + | let votes = genVotesKeys(prefix) | |
93 | + | let $l = votes | |
94 | + | let $s = size($l) | |
95 | + | let $acc0 = 0 | |
96 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
97 | + | then $a | |
98 | + | else countVotesHelper($a, $l[$i]) | |
99 | + | ||
100 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
101 | + | then $a | |
102 | + | else throw("List size exceeds 10") | |
103 | + | ||
104 | + | $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) | |
105 | + | } | |
106 | + | ||
107 | + | ||
108 | + | func clearVotesHelper (result,key) = (result :+ DeleteEntry(key)) | |
109 | + | ||
110 | + | ||
111 | + | func getClearVoteEntries (prefix) = { | |
112 | + | let votes = genVotesKeys(prefix) | |
113 | + | let $l = votes | |
114 | + | let $s = size($l) | |
115 | + | let $acc0 = nil | |
116 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
117 | + | then $a | |
118 | + | else clearVotesHelper($a, $l[$i]) | |
119 | + | ||
120 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
121 | + | then $a | |
122 | + | else throw("List size exceeds 10") | |
123 | + | ||
124 | + | $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) | |
125 | + | } | |
126 | + | ||
127 | + | ||
128 | + | func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = { | |
129 | + | let voteKey = keyFullAdminVote(keyPrefix, callerAddressString) | |
130 | + | let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString) | |
131 | + | let err = if (!(isInAdminList(callerAddressString))) | |
132 | + | then throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
133 | + | else if ((adminCurrentVote == 1)) | |
134 | + | then throwErr((voteKey + " you already voted")) | |
135 | + | else unit | |
136 | + | if ((err == err)) | |
137 | + | then { | |
138 | + | let votes = countVotes(keyPrefix) | |
139 | + | if (((votes + 1) >= minVotes)) | |
140 | + | then { | |
141 | + | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
142 | + | (clearVoteEntries ++ voteResult) | |
143 | + | } | |
144 | + | else [IntegerEntry(voteKey, 1)] | |
145 | + | } | |
146 | + | else throw("Strict value is not equal to itself.") | |
147 | + | } | |
20 | 148 | ||
21 | 149 | ||
22 | 150 | func validateAddress (address) = isDefined(addressFromString(address)) | |
23 | 151 | ||
24 | 152 | ||
25 | 153 | let kCalculatorAddress = "calculator__address" | |
26 | 154 | ||
27 | 155 | let calculatorAddressOption = match getString(this, kCalculatorAddress) { | |
28 | 156 | case s: String => | |
29 | 157 | addressFromString(s) | |
30 | 158 | case _: Unit => | |
31 | 159 | unit | |
32 | 160 | case _ => | |
33 | 161 | throw("Match error") | |
34 | 162 | } | |
35 | 163 | ||
36 | 164 | let calculatorAddress = valueOrErrorMessage(calculatorAddressOption, wrapErr("invalid calculator address")) | |
37 | 165 | ||
38 | 166 | func mustAddress (i,address) = if ((i.caller == address)) | |
39 | 167 | then true | |
40 | 168 | else throwErr("permission denied") | |
41 | 169 | ||
42 | 170 | ||
43 | 171 | func mustThis (i) = mustAddress(i, this) | |
44 | 172 | ||
45 | 173 | ||
46 | 174 | func mustCalculator (i) = mustAddress(i, calculatorAddress) | |
47 | 175 | ||
48 | 176 | ||
49 | 177 | func parseAssetId (input) = if ((input == wavesString)) | |
50 | 178 | then unit | |
51 | 179 | else fromBase58String(input) | |
52 | 180 | ||
53 | 181 | ||
54 | 182 | func assetIdToString (input) = if ((input == unit)) | |
55 | 183 | then wavesString | |
56 | 184 | else toBase58String(value(input)) | |
57 | 185 | ||
58 | 186 | ||
59 | 187 | @Callable(i) | |
60 | 188 | func init (calculatorAddressStr) = { | |
61 | 189 | let checkCaller = mustThis(i) | |
62 | 190 | if ((checkCaller == checkCaller)) | |
63 | 191 | then $Tuple2([StringEntry(kCalculatorAddress, calculatorAddressStr), StringEntry(kPriceAsset, wavesString)], unit) | |
64 | 192 | else throw("Strict value is not equal to itself.") | |
65 | 193 | } | |
66 | 194 | ||
67 | 195 | ||
68 | 196 | ||
69 | 197 | @Callable(i) | |
70 | 198 | func stringEntry (key,val) = if (if (!(shutdown)) | |
71 | 199 | then mustCalculator(i) | |
72 | 200 | else false) | |
73 | 201 | then $Tuple2([StringEntry(key, val)], key) | |
74 | 202 | else throwErr("not allowed") | |
75 | 203 | ||
76 | 204 | ||
77 | 205 | ||
78 | 206 | @Callable(i) | |
79 | 207 | func integerEntry (key,val) = if (if (!(shutdown)) | |
80 | 208 | then mustCalculator(i) | |
81 | 209 | else false) | |
82 | 210 | then $Tuple2([IntegerEntry(key, val)], key) | |
83 | 211 | else throwErr("not allowed") | |
84 | 212 | ||
85 | 213 | ||
86 | 214 | ||
87 | 215 | @Callable(i) | |
88 | 216 | func booleanEntry (key,val) = if (if (!(shutdown)) | |
89 | 217 | then mustCalculator(i) | |
90 | 218 | else false) | |
91 | 219 | then $Tuple2([BooleanEntry(key, val)], key) | |
92 | 220 | else throwErr("not allowed") | |
93 | 221 | ||
94 | 222 | ||
95 | 223 | ||
96 | 224 | @Callable(i) | |
97 | 225 | func binaryEntry (key,val) = if (if (!(shutdown)) | |
98 | 226 | then mustCalculator(i) | |
99 | 227 | else false) | |
100 | 228 | then $Tuple2([BinaryEntry(key, val)], key) | |
101 | 229 | else throwErr("not allowed") | |
102 | 230 | ||
103 | 231 | ||
104 | 232 | ||
105 | 233 | @Callable(i) | |
106 | 234 | func deleteEntry (key) = if (if (!(shutdown)) | |
107 | 235 | then mustCalculator(i) | |
108 | 236 | else false) | |
109 | 237 | then $Tuple2([DeleteEntry(key)], key) | |
110 | 238 | else throwErr("not allowed") | |
111 | 239 | ||
112 | 240 | ||
113 | 241 | ||
114 | 242 | @Callable(i) | |
115 | 243 | func reissue (assetId,amount,reissuable) = if (if (!(shutdown)) | |
116 | 244 | then mustCalculator(i) | |
117 | 245 | else false) | |
118 | 246 | then $Tuple2([Reissue(assetId, amount, reissuable)], amount) | |
119 | 247 | else throwErr("not allowed") | |
120 | 248 | ||
121 | 249 | ||
122 | 250 | ||
123 | 251 | @Callable(i) | |
124 | 252 | func burn (assetId,amount) = if (if (!(shutdown)) | |
125 | 253 | then mustCalculator(i) | |
126 | 254 | else false) | |
127 | 255 | then $Tuple2([Burn(assetId, amount)], amount) | |
128 | 256 | else throwErr("not allowed") | |
129 | 257 | ||
130 | 258 | ||
131 | 259 | ||
132 | 260 | @Callable(i) | |
133 | 261 | func transferAsset (recipientBytes,amount,assetId) = if (if (!(shutdown)) | |
134 | 262 | then mustCalculator(i) | |
135 | 263 | else false) | |
136 | 264 | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, assetId)], amount) | |
137 | 265 | else throwErr("not allowed") | |
138 | 266 | ||
139 | 267 | ||
140 | 268 | ||
141 | 269 | @Callable(i) | |
142 | 270 | func transferAssets (recipientBytes,assetsList,amountsList) = if (if (!(shutdown)) | |
143 | 271 | then mustCalculator(i) | |
144 | 272 | else false) | |
145 | 273 | then { | |
146 | 274 | func addNewTransfer (acc,nextAssetId) = { | |
147 | - | let $ | |
148 | - | let transfers = $ | |
149 | - | let j = $ | |
275 | + | let $t059796003 = acc | |
276 | + | let transfers = $t059796003._1 | |
277 | + | let j = $t059796003._2 | |
150 | 278 | let newTransfer = ScriptTransfer(Address(recipientBytes), amountsList[j], assetsList[j]) | |
151 | 279 | let updatedTransfers = (transfers :+ newTransfer) | |
152 | 280 | $Tuple2(updatedTransfers, (j + 1)) | |
153 | 281 | } | |
154 | 282 | ||
155 | - | let $ | |
283 | + | let $t062406321 = { | |
156 | 284 | let $l = assetsList | |
157 | 285 | let $s = size($l) | |
158 | 286 | let $acc0 = $Tuple2(nil, 0) | |
159 | 287 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
160 | 288 | then $a | |
161 | 289 | else addNewTransfer($a, $l[$i]) | |
162 | 290 | ||
163 | 291 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
164 | 292 | then $a | |
165 | 293 | else throw("List size exceeds 10") | |
166 | 294 | ||
167 | 295 | $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) | |
168 | 296 | } | |
169 | - | let assetsTransfers = $ | |
170 | - | let _lastIndex = $ | |
297 | + | let assetsTransfers = $t062406321._1 | |
298 | + | let _lastIndex = $t062406321._2 | |
171 | 299 | $Tuple2(assetsTransfers, unit) | |
172 | 300 | } | |
173 | 301 | else throwErr("not allowed") | |
174 | 302 | ||
175 | 303 | ||
176 | 304 | ||
177 | 305 | @Callable(i) | |
178 | 306 | func transferWaves (recipientBytes,amount) = if (if (!(shutdown)) | |
179 | 307 | then mustCalculator(i) | |
180 | 308 | else false) | |
181 | 309 | then $Tuple2([ScriptTransfer(Address(recipientBytes), amount, unit)], amount) | |
182 | 310 | else throwErr("not allowed") | |
183 | 311 | ||
184 | 312 | ||
185 | 313 | ||
186 | 314 | @Callable(i) | |
187 | 315 | func call (function,args) = { | |
188 | 316 | let cleanPayments = if ((i.callerPublicKey == base58'11111111111111111111111111111111')) | |
189 | 317 | then nil | |
190 | 318 | else i.payments | |
191 | 319 | let result = reentrantInvoke(calculatorAddress, function, [i.callerPublicKey, args], cleanPayments) | |
192 | 320 | $Tuple2(nil, result) | |
193 | 321 | } | |
194 | 322 | ||
195 | 323 | ||
196 | 324 | ||
197 | 325 | @Callable(i) | |
198 | 326 | func initPoolInvoke (poolAddressString,args) = if (if (!(shutdown)) | |
199 | 327 | then mustCalculator(i) | |
200 | 328 | else false) | |
201 | 329 | then { | |
202 | 330 | let convertedArgs = [args[0], args[1], args[2], args[3], parseIntValue(args[4])] | |
203 | 331 | $Tuple2(nil, invoke(addressFromStringValue(poolAddressString), "init", convertedArgs, i.payments)) | |
204 | 332 | } | |
205 | 333 | else throwErr("not allowed") | |
206 | 334 | ||
207 | 335 | ||
208 | 336 | ||
209 | 337 | @Callable(i) | |
210 | 338 | func notifyStatusUpdate (status) = { | |
211 | 339 | let result = reentrantInvoke(calculatorAddress, "notifyStatusUpdate", [i.callerPublicKey, [toString(status)]], nil) | |
212 | 340 | $Tuple2(nil, result) | |
213 | 341 | } | |
214 | 342 | ||
215 | 343 | ||
344 | + | ||
345 | + | @Callable(i) | |
346 | + | func voteForTxId (txId) = { | |
347 | + | let callerAddressString = toBase58String(i.caller.bytes) | |
348 | + | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
349 | + | let result = [StringEntry(keyAllowedTxId(), txId)] | |
350 | + | let allowedTxIdOption = getString(this, keyAllowedTxId()) | |
351 | + | let err = [if ((size(fromBase58String(txId)) == TXID_BYTES_LENGTH)) | |
352 | + | then true | |
353 | + | else throwErr((txId + " is not valid txId")), if (if ((allowedTxIdOption == unit)) | |
354 | + | then true | |
355 | + | else (value(allowedTxIdOption) != txId)) | |
356 | + | then true | |
357 | + | else throwErr((txId + " is already allowed"))] | |
358 | + | if ((err == err)) | |
359 | + | then voteINTERNAL(callerAddressString, keyPrefix, QUORUM, result) | |
360 | + | else throw("Strict value is not equal to itself.") | |
361 | + | } | |
362 | + | ||
363 | + |
github/deemru/w8io/169f3d6 59.13 ms ◑