tx · CN8pxEUGxWwQTBLb5JpN4huLZfzWk5tU6no8RX71duEP 3N1BEXuoepNEwqkbeZYKviaLQfvBQV3ibYE: -0.02400000 Waves 2024.08.19 13:56 [3245611] smart account 3N1BEXuoepNEwqkbeZYKviaLQfvBQV3ibYE > SELF 0.00000000 Waves
{ "type": 13, "id": "CN8pxEUGxWwQTBLb5JpN4huLZfzWk5tU6no8RX71duEP", "fee": 2400000, "feeAssetId": null, "timestamp": 1724065030303, "version": 2, "chainId": 84, "sender": "3N1BEXuoepNEwqkbeZYKviaLQfvBQV3ibYE", "senderPublicKey": "6t3vrhP1jCmG7CeKBmL8hUibtdP3cMXGC2XtPYEPPC5w", "proofs": [ "4iTTfs5ZVo3xus2ZbVffWVWK5HfqAit4xRRNnB3eRhw4Ak96JjxoJK293FNfiKYhHNdJCQyeAPGvtcH8nRqRr1nt" ], "script": "base64:BgIrCAISBQoDCAEIEgMKAQgSBAoCCAQSAwoBCBIDCgEIEgUKAwgBCBIECgIIATYACXNlcGFyYXRvcgICX18ABU1VTFQ4AIDC1y8AC3dhdmVzU3RyaW5nAgVXQVZFUwAQc3RhdHVzSW5Qcm9ncmVzcwIKaW5Qcm9ncmVzcwAOc3RhdHVzQWNjZXB0ZWQCCGFjY2VwdGVkAA5zdGF0dXNSZWplY3RlZAIIcmVqZWN0ZWQBB3dyYXBFcnIBA21zZwkAuQkCCQDMCAICGHZvdGluZ192ZXJpZmllZF92Mi5yaWRlOgkAzAgCBQNtc2cFA25pbAIBIAEIdGhyb3dFcnIBA21zZwkAAgEJAQd3cmFwRXJyAQUDbXNnAQVhc0ludAEDdmFsBAckbWF0Y2gwBQN2YWwDCQABAgUHJG1hdGNoMAIDSW50BAZ2YWxJbnQFByRtYXRjaDAFBnZhbEludAkAAgECG0ZhaWxlZCB0byBjYXN0IGludG8gSW50ZWdlcgEMcGFyc2VBc3NldElkAQVpbnB1dAMJAAACBQVpbnB1dAULd2F2ZXNTdHJpbmcFBHVuaXQJANkEAQUFaW5w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vm90aW5nUmV3YXJkAwUNY2FsbGVyQWRkcmVzcwUHYXNzZXRJZAUFaW5kZXgFA25pbAkBCHRocm93RXJyAQIQbm90aGluZyB0byBjbGFpbQUMcmV3YXJkQWN0aW9uCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJ0eAEGdmVyaWZ5AAQPdGFyZ2V0UHVibGljS2V5BAckbWF0Y2gwCQEWbWFuYWdlclB1YmxpY0tleU9yVW5pdAADCQABAgUHJG1hdGNoMAIKQnl0ZVZlY3RvcgQCcGsFByRtYXRjaDAFAnBrAwkAAQIFByRtYXRjaDACBFVuaXQIBQJ0eA9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUPdGFyZ2V0UHVibGljS2V5DVDsWQ==", "height": 3245611, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AD1yy84NgB3UNpyKryCJTDD6pqGyKCm22BovMbXr8F5j Next: none Diff:
Old | New | Differences | |
---|---|---|---|
65 | 65 | ||
66 | 66 | let wxAssetIdStr = split(getStringOrFail(emissionContract, keyEmissionConfig), separator)[1] | |
67 | 67 | ||
68 | - | let wxAssetId = | |
68 | + | let wxAssetId = parseAssetId(wxAssetIdStr) | |
69 | 69 | ||
70 | 70 | let keyVotingThresholdAdd = makeString(["%s%s", "votingThreshold", "add"], separator) | |
71 | 71 | ||
230 | 230 | then true | |
231 | 231 | else throwErr("invalid periodLength"), if ((tokenIsVerified == false)) | |
232 | 232 | then true | |
233 | - | else throwErr("token already verified"), if ((wxPaymentAmount >= (periodLength * feePerBlock))) | |
233 | + | else throwErr("token already verified"), if ((wxPaymentAssetId == wxAssetId)) | |
234 | + | then true | |
235 | + | else throwErr("payment[0] should be in wx"), if ((wxPaymentAmount >= (periodLength * feePerBlock))) | |
234 | 236 | then true | |
235 | 237 | else throwErr("not enough wx for given period"), if ((wxPaymentAmount >= getIntegerValue(keyMinWxMinForSuggestAddAmountRequired))) | |
236 | 238 | then true | |
242 | 244 | let newIndex = if (isDefined(currentIndex)) | |
243 | 245 | then (value(currentIndex) + 1) | |
244 | 246 | else 0 | |
245 | - | let $ | |
247 | + | let $t093339966 = if ((size(i.payments) > 1)) | |
246 | 248 | then { | |
247 | 249 | let votingRewardPayment = i.payments[1] | |
248 | - | let votingRewardPaymentAssetId = | |
250 | + | let votingRewardPaymentAssetId = assetIdToString(votingRewardPayment.assetId) | |
249 | 251 | let votingRewardPaymentAmount = value(votingRewardPayment.amount) | |
250 | 252 | $Tuple4(true, votingRewardPaymentAssetId, votingRewardPaymentAmount, [StringEntry(keyVotingRewardAssetId(assetId, newIndex), votingRewardPaymentAssetId), IntegerEntry(keyTotalVotingReward(assetId, newIndex), votingRewardPaymentAmount)]) | |
251 | 253 | } | |
252 | 254 | else $Tuple4(false, "EMPTY", 0, nil) | |
253 | - | let isRewardExist = $ | |
254 | - | let rewardAssetId = $ | |
255 | - | let rewardAmount = $ | |
256 | - | let votingRewardActions = $ | |
255 | + | let isRewardExist = $t093339966._1 | |
256 | + | let rewardAssetId = $t093339966._2 | |
257 | + | let rewardAmount = $t093339966._3 | |
258 | + | let votingRewardActions = $t093339966._4 | |
257 | 259 | let votesQuorum = valueOrErrorMessage(getInteger(keyVotingThresholdAdd), wrapErr("votingThresholdAdd not set")) | |
258 | 260 | let votingInfo = votingInfoValue(isRewardExist, rewardAssetId, rewardAmount, "verification", statusInProgress, height, (height + periodLength), votesQuorum, 0, 0) | |
259 | 261 | let finalizeCallRewardAmount = getIntegerValue(keyFinalizeCallRewardAmount) | |
282 | 284 | then true | |
283 | 285 | else throwErr("token not verified"), if ((gwxAmountAtNow >= minSuggestRemoveBalance)) | |
284 | 286 | then true | |
285 | - | else throwErr("not enough gWXes"), if ((wxPaymentAmount >= getIntegerValue(keyWxForSuggestRemoveAmountRequired))) | |
287 | + | else throwErr("not enough gWXes"), if ((wxPaymentAssetId == wxAssetId)) | |
288 | + | then true | |
289 | + | else throwErr("payment should be in wx"), if ((wxPaymentAmount >= getIntegerValue(keyWxForSuggestRemoveAmountRequired))) | |
286 | 290 | then true | |
287 | 291 | else throwErr("payment less then min for suggest")] | |
288 | 292 | if ((checks == checks)) | |
338 | 342 | let votingInfoParts = getVotingInfoParts(votingInfoStr) | |
339 | 343 | let votesFor = votingInfoParts._9 | |
340 | 344 | let votesAgainst = votingInfoParts._10 | |
341 | - | let $ | |
345 | + | let $t01370513866 = if (inFavor) | |
342 | 346 | then $Tuple2((votesFor + gwxAmountAtEnd), votesAgainst) | |
343 | 347 | else $Tuple2(votesFor, (votesAgainst + gwxAmountAtEnd)) | |
344 | - | let newVotesFor = $ | |
345 | - | let newVotesAgainst = $ | |
348 | + | let newVotesFor = $t01370513866._1 | |
349 | + | let newVotesAgainst = $t01370513866._2 | |
346 | 350 | let newVotingInfoValue = votingInfoValue(votingInfoParts._1, votingInfoParts._2, votingInfoParts._3, votingInfoParts._4, votingInfoParts._5, votingInfoParts._6, votingInfoParts._7, votingInfoParts._8, newVotesFor, newVotesAgainst) | |
347 | 351 | let votingRewardAction = match getString(keyVotingRewardAssetId(assetId, currentIndex)) { | |
348 | 352 | case pk: String => | |
384 | 388 | let votingInfoParts = getVotingInfoParts(votingInfoStr) | |
385 | 389 | let votesFor = votingInfoParts._9 | |
386 | 390 | let votesAgainst = votingInfoParts._10 | |
387 | - | let $ | |
391 | + | let $t01549115652 = if ((inFavor == "true")) | |
388 | 392 | then $Tuple2((votesFor - gwxAmount), votesAgainst) | |
389 | 393 | else $Tuple2(votesFor, (votesAgainst - gwxAmount)) | |
390 | - | let newVotesFor = $ | |
391 | - | let newVotesAgainst = $ | |
394 | + | let newVotesFor = $t01549115652._1 | |
395 | + | let newVotesAgainst = $t01549115652._2 | |
392 | 396 | let newVotingInfoValue = votingInfoValue(votingInfoParts._1, votingInfoParts._2, votingInfoParts._3, votingInfoParts._4, votingInfoParts._5, votingInfoParts._6, votingInfoParts._7, votingInfoParts._8, newVotesFor, newVotesAgainst) | |
393 | 397 | [StringEntry(keyVotingInfo(assetId, currentIndex), newVotingInfoValue), DeleteEntry(voteKey), DeleteEntry(keyVotingReward(i.caller, assetId, currentIndex))] | |
394 | 398 | } | |
484 | 488 | else throwErr("already claimed")] | |
485 | 489 | if ((checks == checks)) | |
486 | 490 | then { | |
487 | - | let $ | |
488 | - | let rewardAmount = $ | |
489 | - | let canClaim = $ | |
491 | + | let $t01974219819 = calculateReward(callerAddress, assetId, index) | |
492 | + | let rewardAmount = $t01974219819._1 | |
493 | + | let canClaim = $t01974219819._2 | |
490 | 494 | if (!(canClaim)) | |
491 | 495 | then throwErr("nothing to claim") | |
492 | 496 | else { | |
493 | 497 | let votingRewardAssetIdStr = getString(keyVotingRewardAssetId(assetId, index)) | |
494 | 498 | let rewardAction = if (isDefined(votingRewardAssetIdStr)) | |
495 | 499 | then { | |
496 | - | let votingRewardAssetId = | |
500 | + | let votingRewardAssetId = parseAssetId(value(votingRewardAssetIdStr)) | |
497 | 501 | [ScriptTransfer(callerAddress, rewardAmount, votingRewardAssetId), IntegerEntry(claimHistoryKey, rewardAmount), DeleteEntry(keyVotingReward(callerAddress, assetId, index))] | |
498 | 502 | } | |
499 | 503 | else throwErr("nothing to claim") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let MULT8 = 100000000 | |
7 | 7 | ||
8 | 8 | let wavesString = "WAVES" | |
9 | 9 | ||
10 | 10 | let statusInProgress = "inProgress" | |
11 | 11 | ||
12 | 12 | let statusAccepted = "accepted" | |
13 | 13 | ||
14 | 14 | let statusRejected = "rejected" | |
15 | 15 | ||
16 | 16 | func wrapErr (msg) = makeString(["voting_verified_v2.ride:", msg], " ") | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func throwErr (msg) = throw(wrapErr(msg)) | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func asInt (val) = match val { | |
23 | 23 | case valInt: Int => | |
24 | 24 | valInt | |
25 | 25 | case _ => | |
26 | 26 | throw("Failed to cast into Integer") | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func parseAssetId (input) = if ((input == wavesString)) | |
31 | 31 | then unit | |
32 | 32 | else fromBase58String(input) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func assetIdToString (input) = if ((input == unit)) | |
36 | 36 | then wavesString | |
37 | 37 | else toBase58String(value(input)) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func getIntegerOrZero (address,key) = valueOrElse(getInteger(address, key), 0) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func getIntegerOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), wrapErr((key + " is not defined"))) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func getStringOrEmpty (address,key) = valueOrElse(getString(address, key), "") | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((key + " is not defined"))) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | let keyBoostingContract = makeString(["%s", "boostingContract"], separator) | |
53 | 53 | ||
54 | 54 | let keyEmissionContract = makeString(["%s", "emissionContract"], separator) | |
55 | 55 | ||
56 | 56 | let keyAssetsStoreContract = makeString(["%s", "assetsStoreContract"], separator) | |
57 | 57 | ||
58 | 58 | let boostingContract = addressFromStringValue(getStringValue(keyBoostingContract)) | |
59 | 59 | ||
60 | 60 | let emissionContract = addressFromStringValue(getStringValue(keyEmissionContract)) | |
61 | 61 | ||
62 | 62 | let assetsStoreContract = addressFromStringValue(getStringValue(keyAssetsStoreContract)) | |
63 | 63 | ||
64 | 64 | let keyEmissionConfig = makeString(["%s", "config"], separator) | |
65 | 65 | ||
66 | 66 | let wxAssetIdStr = split(getStringOrFail(emissionContract, keyEmissionConfig), separator)[1] | |
67 | 67 | ||
68 | - | let wxAssetId = | |
68 | + | let wxAssetId = parseAssetId(wxAssetIdStr) | |
69 | 69 | ||
70 | 70 | let keyVotingThresholdAdd = makeString(["%s%s", "votingThreshold", "add"], separator) | |
71 | 71 | ||
72 | 72 | let keyVotingThresholdRemove = makeString(["%s%s", "votingThreshold", "remove"], separator) | |
73 | 73 | ||
74 | 74 | let keyPeriodLengthRemove = makeString(["%s", "periodLengthRemove"], separator) | |
75 | 75 | ||
76 | 76 | let keyMaxPeriodLength = makeString(["%s", "maxPeriodLength"], separator) | |
77 | 77 | ||
78 | 78 | let keyMinPeriodLength = makeString(["%s", "minPeriodLength"], separator) | |
79 | 79 | ||
80 | 80 | func keyVotingRewardAssetId (assetId,index) = makeString(["%s%s%d", "votingRewardAssetId", assetId, toString(index)], separator) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func keyVotingReward (userAddress,assetId,index) = makeString(["%s%s%s%d", "votingReward", toString(userAddress), assetId, toString(index)], separator) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func keyTotalVotingReward (assetId,index) = makeString(["%s%s%d", "totalVotingReward", assetId, toString(index)], separator) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | let keyFinalizeCallRewardAmount = makeString(["%s", "finalizeCallRewardAmount"], separator) | |
90 | 90 | ||
91 | 91 | let keyMinSuggestRemoveBalance = makeString(["%s", "minSuggestRemoveBalance"], separator) | |
92 | 92 | ||
93 | 93 | func keyCurrentIndex (assetId) = makeString(["%s%s", "currentIndex", assetId], separator) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func keyVote (assetId,index,caller) = makeString(["%s%s%d%s", "vote", assetId, toString(index), toString(caller)], separator) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func voteValue (inFavor,gwxAmount) = makeString(["%s%d", toString(inFavor), toString(gwxAmount)], separator) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func keySuggestIssuer (assetId,index) = makeString(["%s%s%d", "suggestIssuer", assetId, toString(index)], separator) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func keyClaimHistory (userAddress,assetId,index) = makeString(["%s%s%s%d", "history", toString(userAddress), assetId, toString(index)], separator) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | let keyFeePerBlock = makeString(["%s", "feePerBlock"], separator) | |
109 | 109 | ||
110 | 110 | let feePerBlock = getIntegerOrFail(this, keyFeePerBlock) | |
111 | 111 | ||
112 | 112 | let keyMinWxMinForSuggestAddAmountRequired = makeString(["%s", "wxMinForSuggestAddAmountRequired"], separator) | |
113 | 113 | ||
114 | 114 | let keyWxForSuggestRemoveAmountRequired = makeString(["%s", "wxForSuggestRemoveAmountRequired"], separator) | |
115 | 115 | ||
116 | 116 | func keyVotingInfo (assetId,index) = makeString(["%s%s%d", "votingInfo", assetId, toString(index)], separator) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func votingInfoValue (isRewardExist,rewardAssetId,rewardAmount,votingType,status,votingStartHeight,votingEndHeight,votesQuorum,votesFor,votesAgainst) = makeString(["%s%s%d%s%s%d%d%d%d%d", toString(isRewardExist), rewardAssetId, toString(rewardAmount), votingType, status, toString(votingStartHeight), toString(votingEndHeight), toString(votesQuorum), toString(votesFor), toString(votesAgainst)], separator) | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func keyAssetImage (assetId) = makeString(["%s%s", "assetImage", assetId], separator) | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func getUserGwxAmountAtHeight (userAddress,targetHeight) = { | |
126 | 126 | let gwxAmount = invoke(boostingContract, "getUserGwxAmountAtHeightREADONLY", [userAddress, targetHeight], nil) | |
127 | 127 | asInt(gwxAmount) | |
128 | 128 | } | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
138 | 138 | case s: String => | |
139 | 139 | addressFromStringValue(s) | |
140 | 140 | case _ => | |
141 | 141 | this | |
142 | 142 | } | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func managerPublicKeyOrUnit () = { | |
146 | 146 | let managerVaultAddress = getManagerVaultAddressOrThis() | |
147 | 147 | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
148 | 148 | case s: String => | |
149 | 149 | fromBase58String(s) | |
150 | 150 | case _: Unit => | |
151 | 151 | unit | |
152 | 152 | case _ => | |
153 | 153 | throw("Match error") | |
154 | 154 | } | |
155 | 155 | } | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | func getVotingInfoParts (votingInfo) = { | |
159 | 159 | let votingInfoParts = split(votingInfo, separator) | |
160 | 160 | let isRewardExistStr = votingInfoParts[1] | |
161 | 161 | let isRewardExist = if ((isRewardExistStr == "true")) | |
162 | 162 | then true | |
163 | 163 | else false | |
164 | 164 | let rewardAssetId = votingInfoParts[2] | |
165 | 165 | let rewardAmount = parseIntValue(votingInfoParts[3]) | |
166 | 166 | let votingType = votingInfoParts[4] | |
167 | 167 | let status = votingInfoParts[5] | |
168 | 168 | let votingStartHeight = parseIntValue(votingInfoParts[6]) | |
169 | 169 | let votingEndHeight = parseIntValue(votingInfoParts[7]) | |
170 | 170 | let votesQuorum = parseIntValue(votingInfoParts[8]) | |
171 | 171 | let votesFor = parseIntValue(votingInfoParts[9]) | |
172 | 172 | let votesAgainst = parseIntValue(votingInfoParts[10]) | |
173 | 173 | $Tuple10(isRewardExist, rewardAssetId, rewardAmount, votingType, status, votingStartHeight, votingEndHeight, votesQuorum, votesFor, votesAgainst) | |
174 | 174 | } | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func votingExistChecks (assetId,currentIndex) = { | |
178 | 178 | let votingInfo = valueOrErrorMessage(getString(keyVotingInfo(assetId, currentIndex)), wrapErr("voting info not found")) | |
179 | 179 | let votingInfoArray = split(votingInfo, separator) | |
180 | 180 | let status = votingInfoArray[5] | |
181 | 181 | let votingEndHeight = valueOrErrorMessage(parseIntValue(votingInfoArray[7]), wrapErr("voting start height not found")) | |
182 | 182 | let suggestIssuer = valueOrErrorMessage(getString(keySuggestIssuer(assetId, currentIndex)), wrapErr("voting issuer not found")) | |
183 | 183 | let checks = [if ((status == statusInProgress)) | |
184 | 184 | then true | |
185 | 185 | else throwErr("no voting in progress"), if ((votingEndHeight > height)) | |
186 | 186 | then true | |
187 | 187 | else throwErr("voting expired")] | |
188 | 188 | if ((checks == checks)) | |
189 | 189 | then $Tuple3(status, votingEndHeight, suggestIssuer) | |
190 | 190 | else throw("Strict value is not equal to itself.") | |
191 | 191 | } | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func calculateReward (voter,assetId,index) = { | |
195 | 195 | let voteKey = keyVote(assetId, index, voter) | |
196 | 196 | let lastVote = valueOrErrorMessage(getString(voteKey), wrapErr("you have not voted")) | |
197 | 197 | let lastVoteParts = split(lastVote, separator) | |
198 | 198 | let gwxAmount = parseIntValue(lastVoteParts[2]) | |
199 | 199 | let votingInfoStr = valueOrErrorMessage(getString(keyVotingInfo(assetId, index)), wrapErr("voting info not found")) | |
200 | 200 | let votingParts = getVotingInfoParts(votingInfoStr) | |
201 | 201 | let status = votingParts._5 | |
202 | 202 | let votesFor = votingParts._9 | |
203 | 203 | let votesAgainst = votingParts._10 | |
204 | 204 | let partOfTheTotalVotesX8 = fraction(gwxAmount, MULT8, (votesFor + votesAgainst)) | |
205 | 205 | let totalVotingReward = valueOrElse(getInteger(keyTotalVotingReward(assetId, index)), 0) | |
206 | 206 | let voterRewardAmount = fraction(partOfTheTotalVotesX8, totalVotingReward, MULT8, FLOOR) | |
207 | 207 | let canClaim = if ((status == statusAccepted)) | |
208 | 208 | then (voterRewardAmount > 0) | |
209 | 209 | else false | |
210 | 210 | $Tuple2(voterRewardAmount, canClaim) | |
211 | 211 | } | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | @Callable(i) | |
215 | 215 | func suggestAdd (assetId,periodLength,assetImage) = { | |
216 | 216 | let wxPayment = i.payments[0] | |
217 | 217 | let wxPaymentAssetId = value(wxPayment.assetId) | |
218 | 218 | let wxPaymentAmount = value(wxPayment.amount) | |
219 | 219 | let minPeriodLength = getIntegerValue(keyMinPeriodLength) | |
220 | 220 | let maxPeriodLength = getIntegerValue(keyMaxPeriodLength) | |
221 | 221 | let tokenIsVerified = { | |
222 | 222 | let @ = invoke(assetsStoreContract, "isVerifiedREADONLY", [assetId], nil) | |
223 | 223 | if ($isInstanceOf(@, "Boolean")) | |
224 | 224 | then @ | |
225 | 225 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
226 | 226 | } | |
227 | 227 | let checks = [if (if ((periodLength >= minPeriodLength)) | |
228 | 228 | then (maxPeriodLength >= periodLength) | |
229 | 229 | else false) | |
230 | 230 | then true | |
231 | 231 | else throwErr("invalid periodLength"), if ((tokenIsVerified == false)) | |
232 | 232 | then true | |
233 | - | else throwErr("token already verified"), if ((wxPaymentAmount >= (periodLength * feePerBlock))) | |
233 | + | else throwErr("token already verified"), if ((wxPaymentAssetId == wxAssetId)) | |
234 | + | then true | |
235 | + | else throwErr("payment[0] should be in wx"), if ((wxPaymentAmount >= (periodLength * feePerBlock))) | |
234 | 236 | then true | |
235 | 237 | else throwErr("not enough wx for given period"), if ((wxPaymentAmount >= getIntegerValue(keyMinWxMinForSuggestAddAmountRequired))) | |
236 | 238 | then true | |
237 | 239 | else throwErr("payment less then min for suggest")] | |
238 | 240 | if ((checks == checks)) | |
239 | 241 | then { | |
240 | 242 | let currentIndexKey = keyCurrentIndex(assetId) | |
241 | 243 | let currentIndex = getInteger(currentIndexKey) | |
242 | 244 | let newIndex = if (isDefined(currentIndex)) | |
243 | 245 | then (value(currentIndex) + 1) | |
244 | 246 | else 0 | |
245 | - | let $ | |
247 | + | let $t093339966 = if ((size(i.payments) > 1)) | |
246 | 248 | then { | |
247 | 249 | let votingRewardPayment = i.payments[1] | |
248 | - | let votingRewardPaymentAssetId = | |
250 | + | let votingRewardPaymentAssetId = assetIdToString(votingRewardPayment.assetId) | |
249 | 251 | let votingRewardPaymentAmount = value(votingRewardPayment.amount) | |
250 | 252 | $Tuple4(true, votingRewardPaymentAssetId, votingRewardPaymentAmount, [StringEntry(keyVotingRewardAssetId(assetId, newIndex), votingRewardPaymentAssetId), IntegerEntry(keyTotalVotingReward(assetId, newIndex), votingRewardPaymentAmount)]) | |
251 | 253 | } | |
252 | 254 | else $Tuple4(false, "EMPTY", 0, nil) | |
253 | - | let isRewardExist = $ | |
254 | - | let rewardAssetId = $ | |
255 | - | let rewardAmount = $ | |
256 | - | let votingRewardActions = $ | |
255 | + | let isRewardExist = $t093339966._1 | |
256 | + | let rewardAssetId = $t093339966._2 | |
257 | + | let rewardAmount = $t093339966._3 | |
258 | + | let votingRewardActions = $t093339966._4 | |
257 | 259 | let votesQuorum = valueOrErrorMessage(getInteger(keyVotingThresholdAdd), wrapErr("votingThresholdAdd not set")) | |
258 | 260 | let votingInfo = votingInfoValue(isRewardExist, rewardAssetId, rewardAmount, "verification", statusInProgress, height, (height + periodLength), votesQuorum, 0, 0) | |
259 | 261 | let finalizeCallRewardAmount = getIntegerValue(keyFinalizeCallRewardAmount) | |
260 | 262 | let burnWxAmount = (wxPaymentAmount - finalizeCallRewardAmount) | |
261 | 263 | ([IntegerEntry(currentIndexKey, newIndex), StringEntry(keySuggestIssuer(assetId, newIndex), toString(i.caller)), StringEntry(keyVotingInfo(assetId, newIndex), votingInfo), StringEntry(keyAssetImage(assetId), assetImage), Burn(wxPaymentAssetId, burnWxAmount)] ++ votingRewardActions) | |
262 | 264 | } | |
263 | 265 | else throw("Strict value is not equal to itself.") | |
264 | 266 | } | |
265 | 267 | ||
266 | 268 | ||
267 | 269 | ||
268 | 270 | @Callable(i) | |
269 | 271 | func suggestRemove (assetId) = { | |
270 | 272 | let gwxAmountAtNow = getUserGwxAmountAtHeight(toString(i.caller), height) | |
271 | 273 | let minSuggestRemoveBalance = getIntegerValue(keyMinSuggestRemoveBalance) | |
272 | 274 | let wxPayment = i.payments[0] | |
273 | 275 | let wxPaymentAssetId = value(wxPayment.assetId) | |
274 | 276 | let wxPaymentAmount = value(wxPayment.amount) | |
275 | 277 | let tokenIsVerified = { | |
276 | 278 | let @ = invoke(assetsStoreContract, "isVerifiedREADONLY", [assetId], nil) | |
277 | 279 | if ($isInstanceOf(@, "Boolean")) | |
278 | 280 | then @ | |
279 | 281 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
280 | 282 | } | |
281 | 283 | let checks = [if (tokenIsVerified) | |
282 | 284 | then true | |
283 | 285 | else throwErr("token not verified"), if ((gwxAmountAtNow >= minSuggestRemoveBalance)) | |
284 | 286 | then true | |
285 | - | else throwErr("not enough gWXes"), if ((wxPaymentAmount >= getIntegerValue(keyWxForSuggestRemoveAmountRequired))) | |
287 | + | else throwErr("not enough gWXes"), if ((wxPaymentAssetId == wxAssetId)) | |
288 | + | then true | |
289 | + | else throwErr("payment should be in wx"), if ((wxPaymentAmount >= getIntegerValue(keyWxForSuggestRemoveAmountRequired))) | |
286 | 290 | then true | |
287 | 291 | else throwErr("payment less then min for suggest")] | |
288 | 292 | if ((checks == checks)) | |
289 | 293 | then { | |
290 | 294 | let currentIndexKey = keyCurrentIndex(assetId) | |
291 | 295 | let currentIndex = getInteger(currentIndexKey) | |
292 | 296 | let newIndex = if (isDefined(currentIndex)) | |
293 | 297 | then (value(currentIndex) + 1) | |
294 | 298 | else 0 | |
295 | 299 | let periodLength = valueOrErrorMessage(getInteger(keyPeriodLengthRemove), wrapErr("periodLengthRemove not set")) | |
296 | 300 | let votingEndHeight = (height + periodLength) | |
297 | 301 | let votesQuorum = valueOrErrorMessage(getInteger(keyVotingThresholdRemove), wrapErr("votingThresholdRemove not set")) | |
298 | 302 | let votingInfo = votingInfoValue(false, "EMPTY", 0, "deverification", statusInProgress, height, (height + periodLength), votesQuorum, 0, 0) | |
299 | 303 | let setAssetImageAction = match getString(keyAssetImage(assetId)) { | |
300 | 304 | case s: String => | |
301 | 305 | nil | |
302 | 306 | case _: Unit => | |
303 | 307 | let assetsStoreAssetImage = { | |
304 | 308 | let @ = invoke(assetsStoreContract, "getAssetLogoREADONLY", [assetId], nil) | |
305 | 309 | if ($isInstanceOf(@, "String")) | |
306 | 310 | then @ | |
307 | 311 | else throw(($getType(@) + " couldn't be cast to String")) | |
308 | 312 | } | |
309 | 313 | [StringEntry(keyAssetImage(assetId), assetsStoreAssetImage)] | |
310 | 314 | case _ => | |
311 | 315 | throw("Match error") | |
312 | 316 | } | |
313 | 317 | ([IntegerEntry(currentIndexKey, newIndex), StringEntry(keySuggestIssuer(assetId, newIndex), toString(i.caller)), StringEntry(keyVotingInfo(assetId, newIndex), votingInfo)] ++ setAssetImageAction) | |
314 | 318 | } | |
315 | 319 | else throw("Strict value is not equal to itself.") | |
316 | 320 | } | |
317 | 321 | ||
318 | 322 | ||
319 | 323 | ||
320 | 324 | @Callable(i) | |
321 | 325 | func vote (assetId,inFavor) = { | |
322 | 326 | let currentIndexKey = keyCurrentIndex(assetId) | |
323 | 327 | let currentIndex = valueOrErrorMessage(getInteger(currentIndexKey), wrapErr("voting does not exist")) | |
324 | 328 | let votingInfo = votingExistChecks(assetId, currentIndex) | |
325 | 329 | if ((votingInfo == votingInfo)) | |
326 | 330 | then { | |
327 | 331 | let currentVotingEndHeight = votingInfo._2 | |
328 | 332 | let gwxAmountAtEnd = getUserGwxAmountAtHeight(toString(i.caller), currentVotingEndHeight) | |
329 | 333 | let voteKey = keyVote(assetId, currentIndex, i.caller) | |
330 | 334 | let checks = [if ((getString(voteKey) == unit)) | |
331 | 335 | then true | |
332 | 336 | else throwErr("You have already voted"), if ((gwxAmountAtEnd > 0)) | |
333 | 337 | then true | |
334 | 338 | else throw("You'll not have gWX at the end of voting")] | |
335 | 339 | if ((checks == checks)) | |
336 | 340 | then { | |
337 | 341 | let votingInfoStr = valueOrErrorMessage(getString(keyVotingInfo(assetId, currentIndex)), wrapErr("voting info not found")) | |
338 | 342 | let votingInfoParts = getVotingInfoParts(votingInfoStr) | |
339 | 343 | let votesFor = votingInfoParts._9 | |
340 | 344 | let votesAgainst = votingInfoParts._10 | |
341 | - | let $ | |
345 | + | let $t01370513866 = if (inFavor) | |
342 | 346 | then $Tuple2((votesFor + gwxAmountAtEnd), votesAgainst) | |
343 | 347 | else $Tuple2(votesFor, (votesAgainst + gwxAmountAtEnd)) | |
344 | - | let newVotesFor = $ | |
345 | - | let newVotesAgainst = $ | |
348 | + | let newVotesFor = $t01370513866._1 | |
349 | + | let newVotesAgainst = $t01370513866._2 | |
346 | 350 | let newVotingInfoValue = votingInfoValue(votingInfoParts._1, votingInfoParts._2, votingInfoParts._3, votingInfoParts._4, votingInfoParts._5, votingInfoParts._6, votingInfoParts._7, votingInfoParts._8, newVotesFor, newVotesAgainst) | |
347 | 351 | let votingRewardAction = match getString(keyVotingRewardAssetId(assetId, currentIndex)) { | |
348 | 352 | case pk: String => | |
349 | 353 | [StringEntry(keyVotingReward(i.caller, assetId, currentIndex), voteValue(inFavor, gwxAmountAtEnd))] | |
350 | 354 | case _: Unit => | |
351 | 355 | nil | |
352 | 356 | case _ => | |
353 | 357 | throw("Match error") | |
354 | 358 | } | |
355 | 359 | ([StringEntry(voteKey, voteValue(inFavor, gwxAmountAtEnd)), StringEntry(keyVotingInfo(assetId, currentIndex), newVotingInfoValue)] ++ votingRewardAction) | |
356 | 360 | } | |
357 | 361 | else throw("Strict value is not equal to itself.") | |
358 | 362 | } | |
359 | 363 | else throw("Strict value is not equal to itself.") | |
360 | 364 | } | |
361 | 365 | ||
362 | 366 | ||
363 | 367 | ||
364 | 368 | @Callable(i) | |
365 | 369 | func cancelVote (assetId) = { | |
366 | 370 | let currentIndexKey = keyCurrentIndex(assetId) | |
367 | 371 | let currentIndex = valueOrErrorMessage(getInteger(currentIndexKey), wrapErr("voting does not exist")) | |
368 | 372 | let voteKey = keyVote(assetId, currentIndex, i.caller) | |
369 | 373 | let lastVote = valueOrErrorMessage(getString(voteKey), wrapErr("you have not voted")) | |
370 | 374 | let lastVoteParts = split(lastVote, separator) | |
371 | 375 | let inFavor = lastVoteParts[1] | |
372 | 376 | let gwxAmount = parseIntValue(lastVoteParts[2]) | |
373 | 377 | let votingInfo = votingExistChecks(assetId, currentIndex) | |
374 | 378 | if ((votingInfo == votingInfo)) | |
375 | 379 | then { | |
376 | 380 | let checks = [if (if ((inFavor == "true")) | |
377 | 381 | then true | |
378 | 382 | else (inFavor == "false")) | |
379 | 383 | then true | |
380 | 384 | else throwErr("invalid vote")] | |
381 | 385 | if ((checks == checks)) | |
382 | 386 | then { | |
383 | 387 | let votingInfoStr = valueOrErrorMessage(getString(keyVotingInfo(assetId, currentIndex)), wrapErr("voting info not found")) | |
384 | 388 | let votingInfoParts = getVotingInfoParts(votingInfoStr) | |
385 | 389 | let votesFor = votingInfoParts._9 | |
386 | 390 | let votesAgainst = votingInfoParts._10 | |
387 | - | let $ | |
391 | + | let $t01549115652 = if ((inFavor == "true")) | |
388 | 392 | then $Tuple2((votesFor - gwxAmount), votesAgainst) | |
389 | 393 | else $Tuple2(votesFor, (votesAgainst - gwxAmount)) | |
390 | - | let newVotesFor = $ | |
391 | - | let newVotesAgainst = $ | |
394 | + | let newVotesFor = $t01549115652._1 | |
395 | + | let newVotesAgainst = $t01549115652._2 | |
392 | 396 | let newVotingInfoValue = votingInfoValue(votingInfoParts._1, votingInfoParts._2, votingInfoParts._3, votingInfoParts._4, votingInfoParts._5, votingInfoParts._6, votingInfoParts._7, votingInfoParts._8, newVotesFor, newVotesAgainst) | |
393 | 397 | [StringEntry(keyVotingInfo(assetId, currentIndex), newVotingInfoValue), DeleteEntry(voteKey), DeleteEntry(keyVotingReward(i.caller, assetId, currentIndex))] | |
394 | 398 | } | |
395 | 399 | else throw("Strict value is not equal to itself.") | |
396 | 400 | } | |
397 | 401 | else throw("Strict value is not equal to itself.") | |
398 | 402 | } | |
399 | 403 | ||
400 | 404 | ||
401 | 405 | ||
402 | 406 | @Callable(i) | |
403 | 407 | func finalize (assetId) = { | |
404 | 408 | let currentIndexKey = keyCurrentIndex(assetId) | |
405 | 409 | let currentIndex = valueOrElse(getInteger(currentIndexKey), 0) | |
406 | 410 | let votingThresholdAdd = valueOrErrorMessage(getInteger(keyVotingThresholdAdd), wrapErr("votingThresholdAdd not set")) | |
407 | 411 | let votingThresholdRemove = valueOrErrorMessage(getInteger(keyVotingThresholdRemove), wrapErr("votingThresholdRemove not set")) | |
408 | 412 | let votingInfoStr = valueOrErrorMessage(getString(keyVotingInfo(assetId, currentIndex)), wrapErr("voting info not found")) | |
409 | 413 | let votingInfoParts = getVotingInfoParts(votingInfoStr) | |
410 | 414 | let votingType = votingInfoParts._4 | |
411 | 415 | let status = votingInfoParts._5 | |
412 | 416 | let votingEndHeight = votingInfoParts._7 | |
413 | 417 | let votingQuorum = votingInfoParts._8 | |
414 | 418 | let votesFor = votingInfoParts._9 | |
415 | 419 | let votesAgainst = votingInfoParts._10 | |
416 | 420 | let checks = [if ((status == statusInProgress)) | |
417 | 421 | then true | |
418 | 422 | else throwErr("voting not in progress"), if ((height >= votingEndHeight)) | |
419 | 423 | then true | |
420 | 424 | else throwErr("voting not finished"), if (isDefined(getString(keyAssetImage(assetId)))) | |
421 | 425 | then true | |
422 | 426 | else throwErr("asset image not set")] | |
423 | 427 | if ((checks == checks)) | |
424 | 428 | then { | |
425 | 429 | let votingAccepted = if (if (((votesFor + votesAgainst) >= votingQuorum)) | |
426 | 430 | then (votesFor > votesAgainst) | |
427 | 431 | else false) | |
428 | 432 | then true | |
429 | 433 | else false | |
430 | 434 | let newStatus = if (votingAccepted) | |
431 | 435 | then statusAccepted | |
432 | 436 | else statusRejected | |
433 | 437 | let assetImage = getStringValue(keyAssetImage(assetId)) | |
434 | 438 | let isVotingAccepted = if (votingAccepted) | |
435 | 439 | then { | |
436 | 440 | let votingAcceptedInvokes = if ((votingType == "verification")) | |
437 | 441 | then invoke(assetsStoreContract, "createOrUpdate", [assetId, assetImage, true], nil) | |
438 | 442 | else [invoke(assetsStoreContract, "setVerified", [assetId, false], nil), invoke(assetsStoreContract, "onEliminate", [assetId], nil)] | |
439 | 443 | votingAcceptedInvokes | |
440 | 444 | } | |
441 | 445 | else nil | |
442 | 446 | if ((isVotingAccepted == isVotingAccepted)) | |
443 | 447 | then { | |
444 | 448 | let newVotingInfoValue = votingInfoValue(votingInfoParts._1, votingInfoParts._2, votingInfoParts._3, votingInfoParts._4, newStatus, votingInfoParts._6, votingInfoParts._7, votingInfoParts._8, votingInfoParts._9, votingInfoParts._10) | |
445 | 449 | let finalizeCallRewardAmount = getIntegerValue(keyFinalizeCallRewardAmount) | |
446 | 450 | let suggestIssuerAddress = addressFromStringValue(getStringValue(keySuggestIssuer(assetId, currentIndex))) | |
447 | 451 | let votingRewardAssetIdOption = getString(keyVotingRewardAssetId(assetId, currentIndex)) | |
448 | 452 | let totalVotingRewardOption = getInteger(keyTotalVotingReward(assetId, currentIndex)) | |
449 | 453 | let returnRewardActions = if (if (if (votingAccepted) | |
450 | 454 | then true | |
451 | 455 | else (votingRewardAssetIdOption == unit)) | |
452 | 456 | then true | |
453 | 457 | else (totalVotingRewardOption == unit)) | |
454 | 458 | then nil | |
455 | 459 | else [ScriptTransfer(suggestIssuerAddress, value(totalVotingRewardOption), parseAssetId(value(votingRewardAssetIdOption)))] | |
456 | 460 | ([StringEntry(keyVotingInfo(assetId, currentIndex), newVotingInfoValue), ScriptTransfer(i.caller, finalizeCallRewardAmount, wxAssetId)] ++ returnRewardActions) | |
457 | 461 | } | |
458 | 462 | else throw("Strict value is not equal to itself.") | |
459 | 463 | } | |
460 | 464 | else throw("Strict value is not equal to itself.") | |
461 | 465 | } | |
462 | 466 | ||
463 | 467 | ||
464 | 468 | ||
465 | 469 | @Callable(i) | |
466 | 470 | func claimREADONLY (assetId,index,userAddressStr) = { | |
467 | 471 | let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid address")) | |
468 | 472 | let votingRewardAssetIdStr = getString(keyVotingRewardAssetId(assetId, index)) | |
469 | 473 | let rewardAmount = if (isDefined(votingRewardAssetIdStr)) | |
470 | 474 | then calculateReward(userAddress, assetId, index)._1 | |
471 | 475 | else 0 | |
472 | 476 | $Tuple2(nil, rewardAmount) | |
473 | 477 | } | |
474 | 478 | ||
475 | 479 | ||
476 | 480 | ||
477 | 481 | @Callable(i) | |
478 | 482 | func claim (assetId,index) = { | |
479 | 483 | let callerAddress = i.caller | |
480 | 484 | let claimHistoryKey = keyClaimHistory(callerAddress, assetId, index) | |
481 | 485 | let claimHistory = getInteger(claimHistoryKey) | |
482 | 486 | let checks = [if ((claimHistory == unit)) | |
483 | 487 | then true | |
484 | 488 | else throwErr("already claimed")] | |
485 | 489 | if ((checks == checks)) | |
486 | 490 | then { | |
487 | - | let $ | |
488 | - | let rewardAmount = $ | |
489 | - | let canClaim = $ | |
491 | + | let $t01974219819 = calculateReward(callerAddress, assetId, index) | |
492 | + | let rewardAmount = $t01974219819._1 | |
493 | + | let canClaim = $t01974219819._2 | |
490 | 494 | if (!(canClaim)) | |
491 | 495 | then throwErr("nothing to claim") | |
492 | 496 | else { | |
493 | 497 | let votingRewardAssetIdStr = getString(keyVotingRewardAssetId(assetId, index)) | |
494 | 498 | let rewardAction = if (isDefined(votingRewardAssetIdStr)) | |
495 | 499 | then { | |
496 | - | let votingRewardAssetId = | |
500 | + | let votingRewardAssetId = parseAssetId(value(votingRewardAssetIdStr)) | |
497 | 501 | [ScriptTransfer(callerAddress, rewardAmount, votingRewardAssetId), IntegerEntry(claimHistoryKey, rewardAmount), DeleteEntry(keyVotingReward(callerAddress, assetId, index))] | |
498 | 502 | } | |
499 | 503 | else throwErr("nothing to claim") | |
500 | 504 | rewardAction | |
501 | 505 | } | |
502 | 506 | } | |
503 | 507 | else throw("Strict value is not equal to itself.") | |
504 | 508 | } | |
505 | 509 | ||
506 | 510 | ||
507 | 511 | @Verifier(tx) | |
508 | 512 | func verify () = { | |
509 | 513 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
510 | 514 | case pk: ByteVector => | |
511 | 515 | pk | |
512 | 516 | case _: Unit => | |
513 | 517 | tx.senderPublicKey | |
514 | 518 | case _ => | |
515 | 519 | throw("Match error") | |
516 | 520 | } | |
517 | 521 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
518 | 522 | } | |
519 | 523 |
github/deemru/w8io/169f3d6 84.89 ms ◑