tx · HV3fFkUaikCTs9gUWtc5M4sitXDqQq2W9fdnPuw917Ti 3MuS6qVvhBR6wSynFRdcE3fVqmGBjoc7Hhx: -0.01300000 Waves 2023.07.04 17:30 [2651279] smart account 3MuS6qVvhBR6wSynFRdcE3fVqmGBjoc7Hhx > SELF 0.00000000 Waves
{ "type": 13, "id": "HV3fFkUaikCTs9gUWtc5M4sitXDqQq2W9fdnPuw917Ti", "fee": 1300000, "feeAssetId": null, "timestamp": 1688481017507, "version": 1, "sender": "3MuS6qVvhBR6wSynFRdcE3fVqmGBjoc7Hhx", "senderPublicKey": "62CHk4MqTdq3LqeUycy7TPnpvwrjgerSa2FqAY2EafXn", "proofs": [ "3TCV1D5CAmfQShiEqJyAzrdE1hPkLjTbtKUvvvTHDonyXx35Yoz6V9nEnWUsMCvcqJBSEh656bVwWgNQGnj7hEjE" ], "script": "base64:BwJaCAISBAoCCAgSBAoCCAESBAoCCAQSBAoCCAISAwoBCBIDCgEBEgMKAQESBQoDAgECEgQKAgIBEgQKAgIBEgUKAwEBARIAEgMKAQgSABIAEgMKAQgSABIDCgEILwADU0VQAgJfXwAQY29udHJhY3RGaWxlbmFtZQIMZmFjdG9yeS5yaWRlAQd3cmFwRXJyAQFzCQCsAgIJAKwCAgUQY29udHJhY3RGaWxlbmFtZQICOiAFAXMBCHRocm93RXJyAQFzCQACAQkBB3dyYXBFcnIBBQFzAA9BRE1JTl9MSVNUX1NJWkUABQAGUVVPUlVNAAMAEVRYSURfQllURVNfTEVOR1RIACABGGtleUFsbG93ZWRUeElkVm90ZVByZWZpeAEEdHhJZAkAuQkCCQDMCAICBiVzJXMlcwkAzAgCAglhbGxvd1R4SWQJAMwIAgUEdHhJZAUDbmlsBQNTRVABEGtleUZ1bGxBZG1pblZvdGUCBnByZWZpeAxhZG1pbkFkZHJlc3MJALkJAgkAzAgCBQZwcmVmaXgJAMwIAgUMYWRtaW5BZGRyZXNzBQNuaWwFA1NFUAETa2V5QWRtaW5BZGRyZXNzTGlzdA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2J5T3duZXIDCQBnAgkAkAMBCQENZ2V0QWRtaW5zTGlzdAAFBlFVT1JVTQcJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkDAwUKYnlQcm9wb3NhbAYFCGJ5QWRtaW5zBgUHYnlPd25lcsGySmY=", "chainId": 84, "height": 2651279, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6UzAfASQVx6Ecb3dsUB23K3RdxiobYfiwWjAXX1MSv9x Next: HKTE68oavY7L6zq5obn9VT2M2nJfeRK41Xcq2hUx9h5S Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | ||
10 | 10 | ||
11 | 11 | func throwErr (s) = throw(wrapErr(s)) | |
12 | + | ||
13 | + | ||
14 | + | let ADMIN_LIST_SIZE = 5 | |
15 | + | ||
16 | + | let QUORUM = 3 | |
17 | + | ||
18 | + | let TXID_BYTES_LENGTH = 32 | |
19 | + | ||
20 | + | func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP) | |
21 | + | ||
22 | + | ||
23 | + | func keyFullAdminVote (prefix,adminAddress) = makeString([prefix, adminAddress], SEP) | |
24 | + | ||
25 | + | ||
26 | + | func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP) | |
27 | + | ||
28 | + | ||
29 | + | func keyAllowedTxId () = makeString(["%s", "txId"], SEP) | |
30 | + | ||
31 | + | ||
32 | + | func getAdminVote (prefix,admin) = { | |
33 | + | let voteKey = keyFullAdminVote(prefix, admin) | |
34 | + | valueOrElse(getInteger(voteKey), 0) | |
35 | + | } | |
36 | + | ||
37 | + | ||
38 | + | func getAdminsList () = match getString(this, keyAdminAddressList()) { | |
39 | + | case s: String => | |
40 | + | split(s, SEP) | |
41 | + | case _ => | |
42 | + | nil | |
43 | + | } | |
44 | + | ||
45 | + | ||
46 | + | func isInAdminList (address) = containsElement(getAdminsList(), address) | |
47 | + | ||
48 | + | ||
49 | + | func genVotesKeysHelper (a,adminAddress) = { | |
50 | + | let $t012621286 = a | |
51 | + | let result = $t012621286._1 | |
52 | + | let prefix = $t012621286._2 | |
53 | + | $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix) | |
54 | + | } | |
55 | + | ||
56 | + | ||
57 | + | func genVotesKeys (keyPrefix) = { | |
58 | + | let adminList = keyAdminAddressList() | |
59 | + | let $t014331517 = { | |
60 | + | let $l = getAdminsList() | |
61 | + | let $s = size($l) | |
62 | + | let $acc0 = $Tuple2(nil, keyPrefix) | |
63 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
64 | + | then $a | |
65 | + | else genVotesKeysHelper($a, $l[$i]) | |
66 | + | ||
67 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
68 | + | then $a | |
69 | + | else throw("List size exceeds 5") | |
70 | + | ||
71 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
72 | + | } | |
73 | + | let result = $t014331517._1 | |
74 | + | let prefix = $t014331517._2 | |
75 | + | result | |
76 | + | } | |
77 | + | ||
78 | + | ||
79 | + | func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0)) | |
80 | + | ||
81 | + | ||
82 | + | func countVotes (prefix) = { | |
83 | + | let votes = genVotesKeys(prefix) | |
84 | + | let $l = votes | |
85 | + | let $s = size($l) | |
86 | + | let $acc0 = 0 | |
87 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
88 | + | then $a | |
89 | + | else countVotesHelper($a, $l[$i]) | |
90 | + | ||
91 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
92 | + | then $a | |
93 | + | else throw("List size exceeds 5") | |
94 | + | ||
95 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
96 | + | } | |
97 | + | ||
98 | + | ||
99 | + | func clearVotesHelper (result,key) = (result :+ DeleteEntry(key)) | |
100 | + | ||
101 | + | ||
102 | + | func getClearVoteEntries (prefix) = { | |
103 | + | let votes = genVotesKeys(prefix) | |
104 | + | let $l = votes | |
105 | + | let $s = size($l) | |
106 | + | let $acc0 = nil | |
107 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
108 | + | then $a | |
109 | + | else clearVotesHelper($a, $l[$i]) | |
110 | + | ||
111 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
112 | + | then $a | |
113 | + | else throw("List size exceeds 5") | |
114 | + | ||
115 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
116 | + | } | |
117 | + | ||
118 | + | ||
119 | + | func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = { | |
120 | + | let voteKey = keyFullAdminVote(keyPrefix, callerAddressString) | |
121 | + | let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString) | |
122 | + | let err = if (!(isInAdminList(callerAddressString))) | |
123 | + | then throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
124 | + | else if ((adminCurrentVote == 1)) | |
125 | + | then throwErr((voteKey + " you already voted")) | |
126 | + | else unit | |
127 | + | if ((err == err)) | |
128 | + | then { | |
129 | + | let votes = countVotes(keyPrefix) | |
130 | + | if (((votes + 1) >= minVotes)) | |
131 | + | then { | |
132 | + | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
133 | + | (clearVoteEntries ++ voteResult) | |
134 | + | } | |
135 | + | else [IntegerEntry(voteKey, 1)] | |
136 | + | } | |
137 | + | else throw("Strict value is not equal to itself.") | |
138 | + | } | |
12 | 139 | ||
13 | 140 | ||
14 | 141 | func keyCalculatorAddress () = "%s__calculator" | |
239 | 366 | func processBlocks () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "processBlocks", [i.caller.bytes], i.payments)) | |
240 | 367 | ||
241 | 368 | ||
369 | + | ||
370 | + | @Callable(i) | |
371 | + | func voteForTxId (txId) = { | |
372 | + | let callerAddressString = toBase58String(i.caller.bytes) | |
373 | + | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
374 | + | let result = [StringEntry(keyAllowedTxId(), txId)] | |
375 | + | let allowedTxIdOption = getString(this, keyAllowedTxId()) | |
376 | + | let err = [if ((size(fromBase58String(txId)) == TXID_BYTES_LENGTH)) | |
377 | + | then true | |
378 | + | else throwErr((txId + " is not valid txId")), if (if ((allowedTxIdOption == unit)) | |
379 | + | then true | |
380 | + | else (value(allowedTxIdOption) != txId)) | |
381 | + | then true | |
382 | + | else throwErr((txId + " is already allowed"))] | |
383 | + | if ((err == err)) | |
384 | + | then voteINTERNAL(callerAddressString, keyPrefix, QUORUM, result) | |
385 | + | else throw("Strict value is not equal to itself.") | |
386 | + | } | |
387 | + | ||
388 | + | ||
242 | 389 | @Verifier(tx) | |
243 | 390 | func verify () = { | |
244 | - | let byProposal = valueOrElse(getBoolean(votingResultAddressOrFail, keyProposalAllowBroadcast(this, tx.id)), false) | |
245 | - | let byOwner = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
246 | - | if ((votingResultAddressOption != unit)) | |
247 | - | then if (byProposal) | |
248 | - | then true | |
249 | - | else byOwner | |
391 | + | let byProposal = match votingResultAddressOption { | |
392 | + | case proposalAddress: Address => | |
393 | + | valueOrElse(getBoolean(proposalAddress, keyProposalAllowBroadcast(this, tx.id)), false) | |
394 | + | case _ => | |
395 | + | false | |
396 | + | } | |
397 | + | let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(this, keyAllowedTxId()), ""))) | |
398 | + | let byOwner = if ((size(getAdminsList()) >= QUORUM)) | |
399 | + | then false | |
400 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
401 | + | if (if (byProposal) | |
402 | + | then true | |
403 | + | else byAdmins) | |
404 | + | then true | |
250 | 405 | else byOwner | |
251 | 406 | } | |
252 | 407 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 7 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let contractFilename = "factory.ride" | |
7 | 7 | ||
8 | 8 | func wrapErr (s) = ((contractFilename + ": ") + s) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | func throwErr (s) = throw(wrapErr(s)) | |
12 | + | ||
13 | + | ||
14 | + | let ADMIN_LIST_SIZE = 5 | |
15 | + | ||
16 | + | let QUORUM = 3 | |
17 | + | ||
18 | + | let TXID_BYTES_LENGTH = 32 | |
19 | + | ||
20 | + | func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP) | |
21 | + | ||
22 | + | ||
23 | + | func keyFullAdminVote (prefix,adminAddress) = makeString([prefix, adminAddress], SEP) | |
24 | + | ||
25 | + | ||
26 | + | func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP) | |
27 | + | ||
28 | + | ||
29 | + | func keyAllowedTxId () = makeString(["%s", "txId"], SEP) | |
30 | + | ||
31 | + | ||
32 | + | func getAdminVote (prefix,admin) = { | |
33 | + | let voteKey = keyFullAdminVote(prefix, admin) | |
34 | + | valueOrElse(getInteger(voteKey), 0) | |
35 | + | } | |
36 | + | ||
37 | + | ||
38 | + | func getAdminsList () = match getString(this, keyAdminAddressList()) { | |
39 | + | case s: String => | |
40 | + | split(s, SEP) | |
41 | + | case _ => | |
42 | + | nil | |
43 | + | } | |
44 | + | ||
45 | + | ||
46 | + | func isInAdminList (address) = containsElement(getAdminsList(), address) | |
47 | + | ||
48 | + | ||
49 | + | func genVotesKeysHelper (a,adminAddress) = { | |
50 | + | let $t012621286 = a | |
51 | + | let result = $t012621286._1 | |
52 | + | let prefix = $t012621286._2 | |
53 | + | $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix) | |
54 | + | } | |
55 | + | ||
56 | + | ||
57 | + | func genVotesKeys (keyPrefix) = { | |
58 | + | let adminList = keyAdminAddressList() | |
59 | + | let $t014331517 = { | |
60 | + | let $l = getAdminsList() | |
61 | + | let $s = size($l) | |
62 | + | let $acc0 = $Tuple2(nil, keyPrefix) | |
63 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
64 | + | then $a | |
65 | + | else genVotesKeysHelper($a, $l[$i]) | |
66 | + | ||
67 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
68 | + | then $a | |
69 | + | else throw("List size exceeds 5") | |
70 | + | ||
71 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
72 | + | } | |
73 | + | let result = $t014331517._1 | |
74 | + | let prefix = $t014331517._2 | |
75 | + | result | |
76 | + | } | |
77 | + | ||
78 | + | ||
79 | + | func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0)) | |
80 | + | ||
81 | + | ||
82 | + | func countVotes (prefix) = { | |
83 | + | let votes = genVotesKeys(prefix) | |
84 | + | let $l = votes | |
85 | + | let $s = size($l) | |
86 | + | let $acc0 = 0 | |
87 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
88 | + | then $a | |
89 | + | else countVotesHelper($a, $l[$i]) | |
90 | + | ||
91 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
92 | + | then $a | |
93 | + | else throw("List size exceeds 5") | |
94 | + | ||
95 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
96 | + | } | |
97 | + | ||
98 | + | ||
99 | + | func clearVotesHelper (result,key) = (result :+ DeleteEntry(key)) | |
100 | + | ||
101 | + | ||
102 | + | func getClearVoteEntries (prefix) = { | |
103 | + | let votes = genVotesKeys(prefix) | |
104 | + | let $l = votes | |
105 | + | let $s = size($l) | |
106 | + | let $acc0 = nil | |
107 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
108 | + | then $a | |
109 | + | else clearVotesHelper($a, $l[$i]) | |
110 | + | ||
111 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
112 | + | then $a | |
113 | + | else throw("List size exceeds 5") | |
114 | + | ||
115 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
116 | + | } | |
117 | + | ||
118 | + | ||
119 | + | func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = { | |
120 | + | let voteKey = keyFullAdminVote(keyPrefix, callerAddressString) | |
121 | + | let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString) | |
122 | + | let err = if (!(isInAdminList(callerAddressString))) | |
123 | + | then throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
124 | + | else if ((adminCurrentVote == 1)) | |
125 | + | then throwErr((voteKey + " you already voted")) | |
126 | + | else unit | |
127 | + | if ((err == err)) | |
128 | + | then { | |
129 | + | let votes = countVotes(keyPrefix) | |
130 | + | if (((votes + 1) >= minVotes)) | |
131 | + | then { | |
132 | + | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
133 | + | (clearVoteEntries ++ voteResult) | |
134 | + | } | |
135 | + | else [IntegerEntry(voteKey, 1)] | |
136 | + | } | |
137 | + | else throw("Strict value is not equal to itself.") | |
138 | + | } | |
12 | 139 | ||
13 | 140 | ||
14 | 141 | func keyCalculatorAddress () = "%s__calculator" | |
15 | 142 | ||
16 | 143 | ||
17 | 144 | func keyProxyTreasuryAddress () = "%s__proxyTreasury" | |
18 | 145 | ||
19 | 146 | ||
20 | 147 | func keyChildAddress () = "%s__child" | |
21 | 148 | ||
22 | 149 | ||
23 | 150 | func keyBlockProcessingReward () = "%s__blockProcessingReward" | |
24 | 151 | ||
25 | 152 | ||
26 | 153 | func keyNextBlockToProcess () = "%s__nextBlockToProcess" | |
27 | 154 | ||
28 | 155 | ||
29 | 156 | func keyLpAssetId () = "%s__lpAssetId" | |
30 | 157 | ||
31 | 158 | ||
32 | 159 | let calculatorAddressOption = match getString(this, keyCalculatorAddress()) { | |
33 | 160 | case s: String => | |
34 | 161 | addressFromString(s) | |
35 | 162 | case _: Unit => | |
36 | 163 | unit | |
37 | 164 | case _ => | |
38 | 165 | throw("Match error") | |
39 | 166 | } | |
40 | 167 | ||
41 | 168 | let calculatorAddressOrFail = valueOrErrorMessage(calculatorAddressOption, wrapErr("invalid calculator address")) | |
42 | 169 | ||
43 | 170 | let proxyTreasuryAddressOption = match getString(this, keyProxyTreasuryAddress()) { | |
44 | 171 | case s: String => | |
45 | 172 | addressFromString(s) | |
46 | 173 | case _: Unit => | |
47 | 174 | unit | |
48 | 175 | case _ => | |
49 | 176 | throw("Match error") | |
50 | 177 | } | |
51 | 178 | ||
52 | 179 | let proxyTreasuryAddressOrFail = valueOrErrorMessage(proxyTreasuryAddressOption, wrapErr("invalid proxy treasury address")) | |
53 | 180 | ||
54 | 181 | func keyConfigAddress () = "%s__config" | |
55 | 182 | ||
56 | 183 | ||
57 | 184 | func keyChildrenAddress () = "contract_children" | |
58 | 185 | ||
59 | 186 | ||
60 | 187 | func keyVotingResultAddress () = "contract_voting_result" | |
61 | 188 | ||
62 | 189 | ||
63 | 190 | func keyProposalAllowBroadcast (address,txId) = ((("proposal_allow_broadcast_" + toString(address)) + "_") + toBase58String(txId)) | |
64 | 191 | ||
65 | 192 | ||
66 | 193 | func keyInvestedByUser (childAddress,userAddress) = makeString(["investor", toString(childAddress), toString(userAddress)], "_") | |
67 | 194 | ||
68 | 195 | ||
69 | 196 | let configAddressOption = match getString(this, keyConfigAddress()) { | |
70 | 197 | case s: String => | |
71 | 198 | addressFromString(s) | |
72 | 199 | case _: Unit => | |
73 | 200 | unit | |
74 | 201 | case _ => | |
75 | 202 | throw("Match error") | |
76 | 203 | } | |
77 | 204 | ||
78 | 205 | let configAddressOrFail = valueOrErrorMessage(configAddressOption, wrapErr("invalid config address")) | |
79 | 206 | ||
80 | 207 | let votingResultAddressOption = match configAddressOption { | |
81 | 208 | case a: Address => | |
82 | 209 | match getString(a, keyVotingResultAddress()) { | |
83 | 210 | case s: String => | |
84 | 211 | addressFromString(s) | |
85 | 212 | case _: Unit => | |
86 | 213 | unit | |
87 | 214 | case _ => | |
88 | 215 | throw("Match error") | |
89 | 216 | } | |
90 | 217 | case _: Unit => | |
91 | 218 | unit | |
92 | 219 | case _ => | |
93 | 220 | throw("Match error") | |
94 | 221 | } | |
95 | 222 | ||
96 | 223 | let votingResultAddressOrFail = valueOrErrorMessage(votingResultAddressOption, wrapErr("invalid voting result address")) | |
97 | 224 | ||
98 | 225 | let childrenAddressOption = match configAddressOption { | |
99 | 226 | case a: Address => | |
100 | 227 | match getString(a, keyChildrenAddress()) { | |
101 | 228 | case s: String => | |
102 | 229 | addressFromString(s) | |
103 | 230 | case _: Unit => | |
104 | 231 | unit | |
105 | 232 | case _ => | |
106 | 233 | throw("Match error") | |
107 | 234 | } | |
108 | 235 | case _: Unit => | |
109 | 236 | unit | |
110 | 237 | case _ => | |
111 | 238 | throw("Match error") | |
112 | 239 | } | |
113 | 240 | ||
114 | 241 | let childrenAddressOrFail = valueOrErrorMessage(childrenAddressOption, wrapErr("invalid children address")) | |
115 | 242 | ||
116 | 243 | let lpAssetIdOption = match getString(this, keyLpAssetId()) { | |
117 | 244 | case s: String => | |
118 | 245 | fromBase58String(s) | |
119 | 246 | case _: Unit => | |
120 | 247 | unit | |
121 | 248 | case _ => | |
122 | 249 | throw("Match error") | |
123 | 250 | } | |
124 | 251 | ||
125 | 252 | let lpAssetIdOrFail = valueOrErrorMessage(lpAssetIdOption, wrapErr("invalid lpAssetId")) | |
126 | 253 | ||
127 | 254 | func onlyAddress (i,address) = if ((i.caller == address)) | |
128 | 255 | then true | |
129 | 256 | else throwErr("permission denied") | |
130 | 257 | ||
131 | 258 | ||
132 | 259 | func onlyThis (i) = onlyAddress(i, this) | |
133 | 260 | ||
134 | 261 | ||
135 | 262 | func onlyCalculator (i) = onlyAddress(i, calculatorAddressOrFail) | |
136 | 263 | ||
137 | 264 | ||
138 | 265 | @Callable(i) | |
139 | 266 | func stringEntry (key,val) = if (onlyCalculator(i)) | |
140 | 267 | then $Tuple2([StringEntry(key, val)], key) | |
141 | 268 | else $Tuple2(nil, unit) | |
142 | 269 | ||
143 | 270 | ||
144 | 271 | ||
145 | 272 | @Callable(i) | |
146 | 273 | func integerEntry (key,val) = if (onlyCalculator(i)) | |
147 | 274 | then $Tuple2([IntegerEntry(key, val)], key) | |
148 | 275 | else $Tuple2(nil, unit) | |
149 | 276 | ||
150 | 277 | ||
151 | 278 | ||
152 | 279 | @Callable(i) | |
153 | 280 | func booleanEntry (key,val) = if (onlyCalculator(i)) | |
154 | 281 | then $Tuple2([BooleanEntry(key, val)], key) | |
155 | 282 | else $Tuple2(nil, unit) | |
156 | 283 | ||
157 | 284 | ||
158 | 285 | ||
159 | 286 | @Callable(i) | |
160 | 287 | func binaryEntry (key,val) = if (onlyCalculator(i)) | |
161 | 288 | then $Tuple2([BinaryEntry(key, val)], key) | |
162 | 289 | else $Tuple2(nil, unit) | |
163 | 290 | ||
164 | 291 | ||
165 | 292 | ||
166 | 293 | @Callable(i) | |
167 | 294 | func deleteEntry (key) = if (onlyCalculator(i)) | |
168 | 295 | then $Tuple2([DeleteEntry(key)], key) | |
169 | 296 | else $Tuple2(nil, unit) | |
170 | 297 | ||
171 | 298 | ||
172 | 299 | ||
173 | 300 | @Callable(i) | |
174 | 301 | func reissue (amount) = if (onlyCalculator(i)) | |
175 | 302 | then $Tuple2([Reissue(lpAssetIdOrFail, amount, true)], amount) | |
176 | 303 | else $Tuple2(nil, unit) | |
177 | 304 | ||
178 | 305 | ||
179 | 306 | ||
180 | 307 | @Callable(i) | |
181 | 308 | func burn (amount) = if (onlyCalculator(i)) | |
182 | 309 | then $Tuple2([Burn(lpAssetIdOrFail, amount)], amount) | |
183 | 310 | else $Tuple2(nil, unit) | |
184 | 311 | ||
185 | 312 | ||
186 | 313 | ||
187 | 314 | @Callable(i) | |
188 | 315 | func transferAsset (recepientBytes,amount,assetId) = if (onlyCalculator(i)) | |
189 | 316 | then $Tuple2([ScriptTransfer(Address(recepientBytes), amount, assetId)], amount) | |
190 | 317 | else $Tuple2(nil, unit) | |
191 | 318 | ||
192 | 319 | ||
193 | 320 | ||
194 | 321 | @Callable(i) | |
195 | 322 | func transferWaves (recepientBytes,amount) = if (onlyCalculator(i)) | |
196 | 323 | then $Tuple2([ScriptTransfer(Address(recepientBytes), amount, unit)], amount) | |
197 | 324 | else $Tuple2(nil, unit) | |
198 | 325 | ||
199 | 326 | ||
200 | 327 | ||
201 | 328 | @Callable(i) | |
202 | 329 | func transferFromProxyTreasury (recipientBytes,rewardsAmount) = if (onlyCalculator(i)) | |
203 | 330 | then $Tuple2(nil, invoke(proxyTreasuryAddressOrFail, "transferWaves", [recipientBytes, rewardsAmount], nil)) | |
204 | 331 | else $Tuple2(nil, unit) | |
205 | 332 | ||
206 | 333 | ||
207 | 334 | ||
208 | 335 | @Callable(i) | |
209 | 336 | func finalize (newTreasuryVolumeInWaves,pwrManagersBonusInWaves,treasuryVolumeDiffAllocationCoef) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "finalize", [i.caller.bytes, newTreasuryVolumeInWaves, pwrManagersBonusInWaves, treasuryVolumeDiffAllocationCoef], i.payments)) | |
210 | 337 | ||
211 | 338 | ||
212 | 339 | ||
213 | 340 | @Callable(i) | |
214 | 341 | func claimLP () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "claimLP", [i.caller.bytes], i.payments)) | |
215 | 342 | ||
216 | 343 | ||
217 | 344 | ||
218 | 345 | @Callable(i) | |
219 | 346 | func claimWaves (txIdStr) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "claimWaves", [i.caller.bytes, fromBase58String(txIdStr)], i.payments)) | |
220 | 347 | ||
221 | 348 | ||
222 | 349 | ||
223 | 350 | @Callable(i) | |
224 | 351 | func invest () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "invest", [i.caller.bytes], i.payments)) | |
225 | 352 | ||
226 | 353 | ||
227 | 354 | ||
228 | 355 | @Callable(i) | |
229 | 356 | func withdraw () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "withdraw", [i.caller.bytes], i.payments)) | |
230 | 357 | ||
231 | 358 | ||
232 | 359 | ||
233 | 360 | @Callable(i) | |
234 | 361 | func cancelWithdraw (txIdStr) = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "cancelWithdraw", [i.caller.bytes, fromBase58String(txIdStr)], i.payments)) | |
235 | 362 | ||
236 | 363 | ||
237 | 364 | ||
238 | 365 | @Callable(i) | |
239 | 366 | func processBlocks () = $Tuple2(nil, reentrantInvoke(calculatorAddressOrFail, "processBlocks", [i.caller.bytes], i.payments)) | |
240 | 367 | ||
241 | 368 | ||
369 | + | ||
370 | + | @Callable(i) | |
371 | + | func voteForTxId (txId) = { | |
372 | + | let callerAddressString = toBase58String(i.caller.bytes) | |
373 | + | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
374 | + | let result = [StringEntry(keyAllowedTxId(), txId)] | |
375 | + | let allowedTxIdOption = getString(this, keyAllowedTxId()) | |
376 | + | let err = [if ((size(fromBase58String(txId)) == TXID_BYTES_LENGTH)) | |
377 | + | then true | |
378 | + | else throwErr((txId + " is not valid txId")), if (if ((allowedTxIdOption == unit)) | |
379 | + | then true | |
380 | + | else (value(allowedTxIdOption) != txId)) | |
381 | + | then true | |
382 | + | else throwErr((txId + " is already allowed"))] | |
383 | + | if ((err == err)) | |
384 | + | then voteINTERNAL(callerAddressString, keyPrefix, QUORUM, result) | |
385 | + | else throw("Strict value is not equal to itself.") | |
386 | + | } | |
387 | + | ||
388 | + | ||
242 | 389 | @Verifier(tx) | |
243 | 390 | func verify () = { | |
244 | - | let byProposal = valueOrElse(getBoolean(votingResultAddressOrFail, keyProposalAllowBroadcast(this, tx.id)), false) | |
245 | - | let byOwner = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
246 | - | if ((votingResultAddressOption != unit)) | |
247 | - | then if (byProposal) | |
248 | - | then true | |
249 | - | else byOwner | |
391 | + | let byProposal = match votingResultAddressOption { | |
392 | + | case proposalAddress: Address => | |
393 | + | valueOrElse(getBoolean(proposalAddress, keyProposalAllowBroadcast(this, tx.id)), false) | |
394 | + | case _ => | |
395 | + | false | |
396 | + | } | |
397 | + | let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(this, keyAllowedTxId()), ""))) | |
398 | + | let byOwner = if ((size(getAdminsList()) >= QUORUM)) | |
399 | + | then false | |
400 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
401 | + | if (if (byProposal) | |
402 | + | then true | |
403 | + | else byAdmins) | |
404 | + | then true | |
250 | 405 | else byOwner | |
251 | 406 | } | |
252 | 407 |
github/deemru/w8io/026f985 49.52 ms ◑