tx · 9mtHfAgaGN7N91fkPGmPhsUBTh3D6wTaYQWxY2A7hnSX 3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T: -0.01400000 Waves 2022.04.29 18:49 [2029966] smart account 3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T > SELF 0.00000000 Waves
{ "type": 13, "id": "9mtHfAgaGN7N91fkPGmPhsUBTh3D6wTaYQWxY2A7hnSX", "fee": 1400000, "feeAssetId": null, "timestamp": 1651247392618, "version": 1, "sender": "3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T", "senderPublicKey": "7iXEgsFNsnbLZ3ca4tmz8jffnyxMu9keuBV6CuQPJLuA", "proofs": [ "qvt8cRpPZaDnMwuwcDiNxMjQsoSuSAcuKNgFkWhTWLtqtL9pFiXPzFqzsytDToqG3j1xJPEwUBK2rJxJKPyyxfn" ], "script": "base64:AAIFAAAAAAAAACMIAhILCgkICAgIAQgBAQgSBAoCCAgSBQoDCAgEEgMKAQgSAAAAABgAAAAACXNlcGFyYXRvcgIAAAACX18AAAAADGtleUZlZUFtb3VudAkABLkAAAACCQAETAAAAAICAAAAAiVzCQAETAAAAAICAAAAA2ZlZQUAAAADbmlsBQAAAAlzZXBhcmF0b3IAAAAADmtleVVzZG5Bc3NldElkCQAEuQAAAAIJAARMAAAAAgIAAAACJXMJAARMAAAAAgIAAAALdXNkbkFzc2V0SWQFAAAAA25pbAUAAAAJc2VwYXJhdG9yAAAAABFrZXlWb3RpbmdEdXJhdGlvbgkABLkAAAACCQAETAAAAAICAAAAAiVzCQAETAAAAAICAAAAC2Vwb2NoTGVuZ3RoBQAAAANuaWwFAAAACXNlcGFyYXRvcgAAAAASa2V5Vm90aW5nVGhyZXNob2xkCQAEuQAAAAIJAARMAAAAAgIAAAACJXMJAARMAAAAAgIAAAAPdm90aW5nVGhyZXNob2xkBQAAAANuaWwFAAAACXNlcGFyYXRvcgAAAAAMa2V5V3hBc3NldElkCQAEuQAAAAIJAARMAAAAAgIAA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SBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAA90YXJnZXRQdWJsaWNLZXkEAAAAByRtYXRjaDAJAQAAABZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAAAAAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAACcGsFAAAAByRtYXRjaDAFAAAAAnBrAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0CAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5CQAAAgAAAAECAAAAC01hdGNoIGVycm9yCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAPdGFyZ2V0UHVibGljS2V5+oW66g==", "chainId": 84, "height": 2029966, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J7CtRfvmR6nxAmVpGH798a1n9V3WL4HU17ZVEzPLqXak Next: 9vHL7r6M9ndfd8VKh1tFWGn3LPm3pCoMpHG6mo8JoZy5 Diff:
Old | New | Differences | |
---|---|---|---|
139 | 139 | then true | |
140 | 140 | else throw("priceAssetId is not USDN"), if ((getBoolean(keyInListAssetId(amountAssetId, priceAssetId)) == unit)) | |
141 | 141 | then true | |
142 | - | else throw("Already in voting list"), if (valueOrElse(invoke(userPoolContract, "keyStatus", [amountAssetId, priceAssetId], nil), false)) | |
143 | - | then true | |
144 | - | else throw("User pool is not active")] | |
142 | + | else throw("Already in voting list")] | |
145 | 143 | if ((checks == checks)) | |
146 | 144 | then { | |
147 | - | let isAmountAssetVerified = match invoke(value(addressFromString(keyAssetsStoreContract)), "isVerifiedREADONLY", [amountAssetId], nil) { | |
148 | - | case b: Boolean => | |
149 | - | b | |
145 | + | let ensureActive = match invoke(userPoolContract, "statusREADONLY", [amountAssetId, priceAssetId], nil) { | |
146 | + | case s: String => | |
147 | + | if ((s == "active")) | |
148 | + | then true | |
149 | + | else throw("User pool is not active") | |
150 | 150 | case _ => | |
151 | - | throw(" | |
151 | + | throw("User pool is not active") | |
152 | 152 | } | |
153 | - | let burnFeeInv = invoke(emissionContract, "burn", nil, [AttachedPayment(payment.assetId, payment.amount)]) | |
154 | - | if ((burnFeeInv == burnFeeInv)) | |
155 | - | then [BooleanEntry(keyInListAssetId(amountAssetId, priceAssetId), true), IntegerEntry(keyStartHeight(amountAssetId, priceAssetId), height)] | |
153 | + | if ((ensureActive == ensureActive)) | |
154 | + | then { | |
155 | + | let ensureAmountAssetVerified = match invoke(value(addressFromString(keyAssetsStoreContract)), "isVerifiedREADONLY", [amountAssetId], nil) { | |
156 | + | case b: Boolean => | |
157 | + | b | |
158 | + | case _ => | |
159 | + | throw("Asset is not verified") | |
160 | + | } | |
161 | + | if ((ensureAmountAssetVerified == ensureAmountAssetVerified)) | |
162 | + | then { | |
163 | + | let burnFeeInv = invoke(emissionContract, "burn", nil, [AttachedPayment(payment.assetId, payment.amount)]) | |
164 | + | if ((burnFeeInv == burnFeeInv)) | |
165 | + | then [BooleanEntry(keyInListAssetId(amountAssetId, priceAssetId), true), IntegerEntry(keyStartHeight(amountAssetId, priceAssetId), height)] | |
166 | + | else throw("Strict value is not equal to itself.") | |
167 | + | } | |
168 | + | else throw("Strict value is not equal to itself.") | |
169 | + | } | |
156 | 170 | else throw("Strict value is not equal to itself.") | |
157 | 171 | } | |
158 | 172 | else throw("Strict value is not equal to itself.") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let keyFeeAmount = makeString(["%s", "fee"], separator) | |
7 | 7 | ||
8 | 8 | let keyUsdnAssetId = makeString(["%s", "usdnAssetId"], separator) | |
9 | 9 | ||
10 | 10 | let keyVotingDuration = makeString(["%s", "epochLength"], separator) | |
11 | 11 | ||
12 | 12 | let keyVotingThreshold = makeString(["%s", "votingThreshold"], separator) | |
13 | 13 | ||
14 | 14 | let keyWxAssetId = makeString(["%s", "wxAssetId"], separator) | |
15 | 15 | ||
16 | 16 | let keyAssetsStoreContract = makeString(["%s", "assetsStoreContract"], separator) | |
17 | 17 | ||
18 | 18 | let keyuserPoolContract = makeString(["%s", "userPoolContract"], separator) | |
19 | 19 | ||
20 | 20 | let keyEmissionContract = makeString(["%s", "emissionContract"], separator) | |
21 | 21 | ||
22 | 22 | let keyBoostingContract = makeString(["%s", "boostingContract"], separator) | |
23 | 23 | ||
24 | 24 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined")) | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func keyInListAssetId (amountAssetId,priceAssetId) = makeString([("%s%s%s" + "inList"), amountAssetId, priceAssetId], separator) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func keyStartHeight (amountAssetId,priceAssetId) = makeString([("%s%s%s" + "startHeight"), amountAssetId, priceAssetId], separator) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func keyVotingResult (amountAssetId,priceAssetId) = makeString(["%s%s%s", "votingResult", amountAssetId, priceAssetId], separator) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func keyVote (amountAssetId,priceAssetId,voterAddress) = makeString(["%s%s%s%s", "vote", amountAssetId, priceAssetId, voterAddress], separator) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract)) | |
46 | 46 | ||
47 | 47 | let userPoolContract = addressFromStringValue(getStringOrFail(keyuserPoolContract)) | |
48 | 48 | ||
49 | 49 | let boostingContract = addressFromStringValue(getStringOrFail(keyBoostingContract)) | |
50 | 50 | ||
51 | 51 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
52 | 52 | case s: String => | |
53 | 53 | fromBase58String(s) | |
54 | 54 | case _: Unit => | |
55 | 55 | unit | |
56 | 56 | case _ => | |
57 | 57 | throw("Match error") | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
62 | 62 | case s: String => | |
63 | 63 | fromBase58String(s) | |
64 | 64 | case _: Unit => | |
65 | 65 | unit | |
66 | 66 | case _ => | |
67 | 67 | throw("Match error") | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func mustManager (i) = { | |
72 | 72 | let pd = throw("Permission denied") | |
73 | 73 | match managerPublicKeyOrUnit() { | |
74 | 74 | case pk: ByteVector => | |
75 | 75 | if ((i.callerPublicKey == pk)) | |
76 | 76 | then true | |
77 | 77 | else pd | |
78 | 78 | case _: Unit => | |
79 | 79 | if ((i.caller == this)) | |
80 | 80 | then true | |
81 | 81 | else pd | |
82 | 82 | case _ => | |
83 | 83 | throw("Match error") | |
84 | 84 | } | |
85 | 85 | } | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func asInt (val) = match val { | |
89 | 89 | case valInt: Int => | |
90 | 90 | valInt | |
91 | 91 | case _ => | |
92 | 92 | throw("Failed to cast into Integer") | |
93 | 93 | } | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | @Callable(i) | |
97 | 97 | func constructor (assetsStoreContractPrm,userPoolContractPrm,boostingContractPrm,emissionContractPrm,feeAmountPrm,wxAssetIdPrm,votingThresholdPrm,votingDurationPrm,usdnAssetIdPrm) = { | |
98 | 98 | let checks = [if (mustManager(i)) | |
99 | 99 | then true | |
100 | 100 | else throw("Must manager"), if (isDefined(addressFromString(assetsStoreContractPrm))) | |
101 | 101 | then true | |
102 | 102 | else throw("Invalid asset_store contract address"), if (isDefined(addressFromString(boostingContractPrm))) | |
103 | 103 | then true | |
104 | 104 | else throw("Invalid boosting contract address"), if (isDefined(addressFromString(userPoolContractPrm))) | |
105 | 105 | then true | |
106 | 106 | else throw("Invalid user_pools contract address"), if (isDefined(addressFromString(emissionContractPrm))) | |
107 | 107 | then true | |
108 | 108 | else throw("Invalid emission contract address"), if ((feeAmountPrm >= 0)) | |
109 | 109 | then true | |
110 | 110 | else throw("Invalid fee amount"), if ((votingDurationPrm > 0)) | |
111 | 111 | then true | |
112 | 112 | else throw("Invalid voting duration"), if ((votingThresholdPrm >= 0)) | |
113 | 113 | then true | |
114 | 114 | else throw("Invalid voting threshold"), if (isDefined(assetInfo(fromBase58String(wxAssetIdPrm)))) | |
115 | 115 | then true | |
116 | 116 | else throw("Invalid WX asset ID"), if (isDefined(assetInfo(fromBase58String(usdnAssetIdPrm)))) | |
117 | 117 | then true | |
118 | 118 | else throw("Invalid USDN asset ID")] | |
119 | 119 | if ((checks == checks)) | |
120 | 120 | then $Tuple2([StringEntry(keyAssetsStoreContract, assetsStoreContractPrm), StringEntry(keyuserPoolContract, userPoolContractPrm), StringEntry(keyEmissionContract, emissionContractPrm), IntegerEntry(keyFeeAmount, feeAmountPrm), IntegerEntry(keyVotingDuration, votingDurationPrm), IntegerEntry(keyVotingThreshold, votingThresholdPrm), StringEntry(keyWxAssetId, wxAssetIdPrm), StringEntry(keyUsdnAssetId, usdnAssetIdPrm)], unit) | |
121 | 121 | else throw("Strict value is not equal to itself.") | |
122 | 122 | } | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | ||
126 | 126 | @Callable(i) | |
127 | 127 | func suggest (amountAssetId,priceAssetId) = { | |
128 | 128 | let payment = value(i.payments[0]) | |
129 | 129 | let info = valueOrErrorMessage(assetInfo(fromBase58String(amountAssetId)), "Invalid amountAssetId ID") | |
130 | 130 | let checks = [if ((info.issuer == i.caller)) | |
131 | 131 | then true | |
132 | 132 | else throw("Asset can only be suggested by its issuer"), if ((info.scripted == false)) | |
133 | 133 | then true | |
134 | 134 | else throw("Asset is smart"), if ((toBase58String(value(payment.assetId)) == value(getString(keyWxAssetId)))) | |
135 | 135 | then true | |
136 | 136 | else throw("Invalid fee asset"), if ((payment.amount == value(getInteger(keyFeeAmount)))) | |
137 | 137 | then true | |
138 | 138 | else throw("Invalid fee amount"), if ((priceAssetId == value(getString(keyUsdnAssetId)))) | |
139 | 139 | then true | |
140 | 140 | else throw("priceAssetId is not USDN"), if ((getBoolean(keyInListAssetId(amountAssetId, priceAssetId)) == unit)) | |
141 | 141 | then true | |
142 | - | else throw("Already in voting list"), if (valueOrElse(invoke(userPoolContract, "keyStatus", [amountAssetId, priceAssetId], nil), false)) | |
143 | - | then true | |
144 | - | else throw("User pool is not active")] | |
142 | + | else throw("Already in voting list")] | |
145 | 143 | if ((checks == checks)) | |
146 | 144 | then { | |
147 | - | let isAmountAssetVerified = match invoke(value(addressFromString(keyAssetsStoreContract)), "isVerifiedREADONLY", [amountAssetId], nil) { | |
148 | - | case b: Boolean => | |
149 | - | b | |
145 | + | let ensureActive = match invoke(userPoolContract, "statusREADONLY", [amountAssetId, priceAssetId], nil) { | |
146 | + | case s: String => | |
147 | + | if ((s == "active")) | |
148 | + | then true | |
149 | + | else throw("User pool is not active") | |
150 | 150 | case _ => | |
151 | - | throw(" | |
151 | + | throw("User pool is not active") | |
152 | 152 | } | |
153 | - | let burnFeeInv = invoke(emissionContract, "burn", nil, [AttachedPayment(payment.assetId, payment.amount)]) | |
154 | - | if ((burnFeeInv == burnFeeInv)) | |
155 | - | then [BooleanEntry(keyInListAssetId(amountAssetId, priceAssetId), true), IntegerEntry(keyStartHeight(amountAssetId, priceAssetId), height)] | |
153 | + | if ((ensureActive == ensureActive)) | |
154 | + | then { | |
155 | + | let ensureAmountAssetVerified = match invoke(value(addressFromString(keyAssetsStoreContract)), "isVerifiedREADONLY", [amountAssetId], nil) { | |
156 | + | case b: Boolean => | |
157 | + | b | |
158 | + | case _ => | |
159 | + | throw("Asset is not verified") | |
160 | + | } | |
161 | + | if ((ensureAmountAssetVerified == ensureAmountAssetVerified)) | |
162 | + | then { | |
163 | + | let burnFeeInv = invoke(emissionContract, "burn", nil, [AttachedPayment(payment.assetId, payment.amount)]) | |
164 | + | if ((burnFeeInv == burnFeeInv)) | |
165 | + | then [BooleanEntry(keyInListAssetId(amountAssetId, priceAssetId), true), IntegerEntry(keyStartHeight(amountAssetId, priceAssetId), height)] | |
166 | + | else throw("Strict value is not equal to itself.") | |
167 | + | } | |
168 | + | else throw("Strict value is not equal to itself.") | |
169 | + | } | |
156 | 170 | else throw("Strict value is not equal to itself.") | |
157 | 171 | } | |
158 | 172 | else throw("Strict value is not equal to itself.") | |
159 | 173 | } | |
160 | 174 | ||
161 | 175 | ||
162 | 176 | ||
163 | 177 | @Callable(i) | |
164 | 178 | func vote (amountAssetId,priceAssetId,inFavor) = { | |
165 | 179 | let checks = [if (valueOrElse(getBoolean(keyInListAssetId(amountAssetId, priceAssetId)), false)) | |
166 | 180 | then true | |
167 | 181 | else throw("The token isn't on the voting list"), (height >= (value(getInteger(keyStartHeight(amountAssetId, priceAssetId))) + value(getInteger(keyVotingDuration))))] | |
168 | 182 | if ((checks == checks)) | |
169 | 183 | then { | |
170 | 184 | let votingResult = split(value(getString(keyVotingResult(amountAssetId, priceAssetId))), separator) | |
171 | 185 | let positiveVotes = votingResult[1] | |
172 | 186 | let negativeVotes = votingResult[2] | |
173 | 187 | let gwxAmount = invoke(boostingContract, "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), height], nil) | |
174 | 188 | let entries = if (inFavor) | |
175 | 189 | then { | |
176 | 190 | let newPositiveVotes = (parseIntValue(positiveVotes) + asInt(gwxAmount)) | |
177 | 191 | let totalVotes = makeString(["%d%d", toString(newPositiveVotes), negativeVotes], separator) | |
178 | 192 | let yesVoteKey = keyVote(amountAssetId, priceAssetId, toString(i.caller)) | |
179 | 193 | let yesVoteValue = makeString([keyVotingResult(amountAssetId, priceAssetId), "yes"], separator) | |
180 | 194 | $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes), StringEntry(yesVoteKey, yesVoteValue)], unit) | |
181 | 195 | } | |
182 | 196 | else { | |
183 | 197 | let newNegativeVotes = (parseIntValue(negativeVotes) + asInt(gwxAmount)) | |
184 | 198 | let totalVotes = makeString(["%d%d", positiveVotes, toString(newNegativeVotes)], separator) | |
185 | 199 | let noVoteKey = keyVote(amountAssetId, priceAssetId, toString(i.caller)) | |
186 | 200 | let noVoteValue = makeString([keyVotingResult(amountAssetId, priceAssetId), "no"], separator) | |
187 | 201 | $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes), StringEntry(noVoteKey, noVoteValue)], unit) | |
188 | 202 | } | |
189 | 203 | entries | |
190 | 204 | } | |
191 | 205 | else throw("Strict value is not equal to itself.") | |
192 | 206 | } | |
193 | 207 | ||
194 | 208 | ||
195 | 209 | ||
196 | 210 | @Callable(i) | |
197 | 211 | func setManager (pendingManagerPublicKey) = { | |
198 | 212 | let checkCaller = mustManager(i) | |
199 | 213 | if ((checkCaller == checkCaller)) | |
200 | 214 | then { | |
201 | 215 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
202 | 216 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
203 | 217 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
204 | 218 | else throw("Strict value is not equal to itself.") | |
205 | 219 | } | |
206 | 220 | else throw("Strict value is not equal to itself.") | |
207 | 221 | } | |
208 | 222 | ||
209 | 223 | ||
210 | 224 | ||
211 | 225 | @Callable(i) | |
212 | 226 | func confirmManager () = { | |
213 | 227 | let pm = pendingManagerPublicKeyOrUnit() | |
214 | 228 | let hasPM = if (isDefined(pm)) | |
215 | 229 | then true | |
216 | 230 | else throw("No pending manager") | |
217 | 231 | if ((hasPM == hasPM)) | |
218 | 232 | then { | |
219 | 233 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
220 | 234 | then true | |
221 | 235 | else throw("You are not pending manager") | |
222 | 236 | if ((checkPM == checkPM)) | |
223 | 237 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
224 | 238 | else throw("Strict value is not equal to itself.") | |
225 | 239 | } | |
226 | 240 | else throw("Strict value is not equal to itself.") | |
227 | 241 | } | |
228 | 242 | ||
229 | 243 | ||
230 | 244 | @Verifier(tx) | |
231 | 245 | func verify () = { | |
232 | 246 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
233 | 247 | case pk: ByteVector => | |
234 | 248 | pk | |
235 | 249 | case _: Unit => | |
236 | 250 | tx.senderPublicKey | |
237 | 251 | case _ => | |
238 | 252 | throw("Match error") | |
239 | 253 | } | |
240 | 254 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
241 | 255 | } | |
242 | 256 |
github/deemru/w8io/169f3d6 38.79 ms ◑