tx · EMY3noiCERkeoHPvN2aneYMCDo5RXpxNNbLDchkTnzxr

3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T:  -0.01400000 Waves

2022.05.11 17:07 [2047104] smart account 3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T > SELF 0.00000000 Waves

{ "type": 13, "id": "EMY3noiCERkeoHPvN2aneYMCDo5RXpxNNbLDchkTnzxr", "fee": 1400000, "feeAssetId": null, "timestamp": 1652278145350, "version": 1, "sender": "3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T", "senderPublicKey": "7iXEgsFNsnbLZ3ca4tmz8jffnyxMu9keuBV6CuQPJLuA", "proofs": [ "4dKeDfmLeLCmnXe3bHn6gVJbrUnWeRwX6Wsqh8GNFAW5th3VcDbhhBTwhAnYGPBSGhA7aFTaYpCLYy4QoBNT4VXT" ], "script": "base64:AAIFAAAAAAAAADQIAhILCgkICAgIAQgBCAESBAoCCAgSBQoDCAgEEgQKAggIEgMKAQESBAoCCAgSAwoBCBIAAAAAGwAAAAAJc2VwYXJhdG9yAgAAAAJfXwAAAAAMa2V5RmVlQW1vdW50CQAEuQAAAAIJAARMAAAAAgIAAAACJXMJAARMAAAAAgIAAAADZmVlBQAAAANuaWwFAAAACXNlcGFyYXRvcgAAAAAOa2V5VXNkbkFzc2V0SWQJAAS5AAAAAgkABEwAAAACAgAAAAIlcwkABEwAAAACAgAAAAt1c2RuQXNzZXRJZAUAAAADbmlsBQAAAAlzZXBhcmF0b3IAAAAAEWtleVZvdGluZ0R1cmF0aW9uCQAEuQAAAAIJAARMAAAAAgIAAAACJXMJAARMAAAAAgIAAAALZXBvY2hMZW5ndGgFAAAAA25pbAUAAAAJc2VwYXJhdG9yAAAAABFrZXlGaW5hbGl6ZVJld2FyZAkABLkAAAACCQAETAAAAAICAAAAAiVzCQAETAAAAAICAAAADmZpbmFsaXplUmV3YXJkBQAAAANuaWwFAAAACXNlcGFyYXRvcgAAAAAMa2V5V3hBc3NldElkCQ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y2gwCQEAAAAWbWFuYWdlclB1YmxpY0tleU9yVW5pdAAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAnBrBQAAAAckbWF0Y2gwBQAAAAJwawMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAD3RhcmdldFB1YmxpY0tleX4Wfg0=", "chainId": 84, "height": 2047104, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8APS9VxBw6m1H6xQeAc3s8qDVJTJiCVearEBF6RY37dS Next: DpKsZzT4vJhy2oahk5SHHU4LYS24oVaVRkrTdz6sKHLG Diff:
OldNewDifferences
188188 @Callable(i)
189189 func vote (amountAssetId,priceAssetId,inFavor) = {
190190 let votingFinishHeight = (value(getInteger(keyStartHeight(amountAssetId, priceAssetId))) + value(getInteger(keyVotingDuration)))
191- let checks = [if ((getString(keyVote(amountAssetId, priceAssetId, toString(i.caller))) != unit))
191+ let checks = [if ((getString(keyVote(amountAssetId, priceAssetId, toString(i.caller))) == unit))
192192 then true
193193 else throw("you already voted"), if (valueOrElse(getBoolean(keyInListAssetId(amountAssetId, priceAssetId)), false))
194194 then true
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "__"
55
66 let keyFeeAmount = makeString(["%s", "fee"], separator)
77
88 let keyUsdnAssetId = makeString(["%s", "usdnAssetId"], separator)
99
1010 let keyVotingDuration = makeString(["%s", "epochLength"], separator)
1111
1212 let keyFinalizeReward = makeString(["%s", "finalizeReward"], separator)
1313
1414 let keyWxAssetId = makeString(["%s", "wxAssetId"], separator)
1515
1616 let keyAssetsStoreContract = makeString(["%s", "assetsStoreContract"], separator)
1717
1818 let keyuserPoolContract = makeString(["%s", "userPoolContract"], separator)
1919
2020 let keyEmissionContract = makeString(["%s", "emissionContract"], separator)
2121
2222 let keyBoostingContract = makeString(["%s", "boostingContract"], separator)
2323
2424 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
2525
2626
2727 func keyInListAssetId (amountAssetId,priceAssetId) = makeString(["%s%s%s", "inList", amountAssetId, priceAssetId], separator)
2828
2929
3030 func keyStartHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "startHeight", amountAssetId, priceAssetId], separator)
3131
3232
3333 func keyVotingResult (amountAssetId,priceAssetId) = makeString(["%s%s%s", "votingResult", amountAssetId, priceAssetId], separator)
3434
3535
3636 func totalVotes (totalYes,totalNo) = makeString(["%d%d", totalYes, totalNo], separator)
3737
3838
3939 func keyVote (amountAssetId,priceAssetId,voterAddress) = makeString(["%s%s%s%s", "vote", amountAssetId, priceAssetId, voterAddress], separator)
4040
4141
4242 func keyVoteValue (gwxAmount,vote) = {
4343 let key = if (vote)
4444 then makeString(["%d%s", gwxAmount, "yes"], separator)
4545 else makeString(["%d%s", gwxAmount, "no"], separator)
4646 key
4747 }
4848
4949
5050 func keyManagerPublicKey () = "%s__managerPublicKey"
5151
5252
5353 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
5454
5555
5656 let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract))
5757
5858 let userPoolContract = addressFromStringValue(getStringOrFail(keyuserPoolContract))
5959
6060 let boostingContract = addressFromStringValue(getStringOrFail(keyBoostingContract))
6161
6262 let assetStoreContract = addressFromStringValue(getStringOrFail(keyAssetsStoreContract))
6363
6464 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
6565 case s: String =>
6666 fromBase58String(s)
6767 case _: Unit =>
6868 unit
6969 case _ =>
7070 throw("Match error")
7171 }
7272
7373
7474 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
7575 case s: String =>
7676 fromBase58String(s)
7777 case _: Unit =>
7878 unit
7979 case _ =>
8080 throw("Match error")
8181 }
8282
8383
8484 func mustManager (i) = {
8585 let pd = throw("permission denied")
8686 match managerPublicKeyOrUnit() {
8787 case pk: ByteVector =>
8888 if ((i.callerPublicKey == pk))
8989 then true
9090 else pd
9191 case _: Unit =>
9292 if ((i.caller == this))
9393 then true
9494 else pd
9595 case _ =>
9696 throw("Match error")
9797 }
9898 }
9999
100100
101101 func asInt (val) = match val {
102102 case valInt: Int =>
103103 valInt
104104 case _ =>
105105 throw("failed to cast into Integer")
106106 }
107107
108108
109109 @Callable(i)
110110 func constructor (assetsStoreContractPrm,userPoolContractPrm,boostingContractPrm,emissionContractPrm,feeAmountPrm,wxAssetIdPrm,votingDurationPrm,usdnAssetIdPrm,finalizeRewardPrm) = {
111111 let checks = [mustManager(i), if (isDefined(addressFromString(assetsStoreContractPrm)))
112112 then true
113113 else throw("Invalid asset_store contract address"), if (isDefined(addressFromString(boostingContractPrm)))
114114 then true
115115 else throw("Invalid boosting contract address"), if (isDefined(addressFromString(userPoolContractPrm)))
116116 then true
117117 else throw("Invalid user_pools contract address"), if (isDefined(addressFromString(emissionContractPrm)))
118118 then true
119119 else throw("Invalid emission contract address"), if ((feeAmountPrm >= 0))
120120 then true
121121 else throw("Invalid fee amount"), if ((votingDurationPrm > 0))
122122 then true
123123 else throw("Invalid voting duration"), if ((finalizeRewardPrm > 0))
124124 then true
125125 else throw("Invalid finalize reward"), if (isDefined(assetInfo(fromBase58String(wxAssetIdPrm))))
126126 then true
127127 else throw("Invalid WX asset ID"), if (isDefined(assetInfo(fromBase58String(usdnAssetIdPrm))))
128128 then true
129129 else throw("Invalid USDN asset ID")]
130130 if ((checks == checks))
131131 then $Tuple2([StringEntry(keyAssetsStoreContract, assetsStoreContractPrm), StringEntry(keyuserPoolContract, userPoolContractPrm), StringEntry(keyEmissionContract, emissionContractPrm), IntegerEntry(keyFeeAmount, feeAmountPrm), IntegerEntry(keyVotingDuration, votingDurationPrm), IntegerEntry(keyFinalizeReward, finalizeRewardPrm), StringEntry(keyWxAssetId, wxAssetIdPrm), StringEntry(keyUsdnAssetId, usdnAssetIdPrm), StringEntry(keyBoostingContract, boostingContractPrm)], unit)
132132 else throw("Strict value is not equal to itself.")
133133 }
134134
135135
136136
137137 @Callable(i)
138138 func suggest (amountAssetId,priceAssetId) = {
139139 let payment = value(i.payments[0])
140140 let info = valueOrErrorMessage(assetInfo(fromBase58String(amountAssetId)), "invalid amountAssetId ID")
141141 let checks = [if ((info.issuer == i.caller))
142142 then true
143143 else throw("asset can only be suggested by its issuer"), if ((info.scripted == false))
144144 then true
145145 else throw("asset is smart"), if ((toBase58String(value(payment.assetId)) == value(getString(keyWxAssetId))))
146146 then true
147147 else throw("invalid fee asset"), if ((payment.amount == value(getInteger(keyFeeAmount))))
148148 then true
149149 else throw("invalid fee amount"), if ((priceAssetId == value(getString(keyUsdnAssetId))))
150150 then true
151151 else throw("priceAssetId is not USDN"), if ((getBoolean(keyInListAssetId(amountAssetId, priceAssetId)) == unit))
152152 then true
153153 else throw("already in voting list")]
154154 if ((checks == checks))
155155 then {
156156 let ensureActive = match invoke(userPoolContract, "statusREADONLY", [amountAssetId, priceAssetId], nil) {
157157 case s: String =>
158158 if ((s == "active"))
159159 then true
160160 else throw("user pool is not active")
161161 case _ =>
162162 throw("user pool is not active")
163163 }
164164 if ((ensureActive == ensureActive))
165165 then {
166166 let ensureAmountAssetVerified = match invoke(assetStoreContract, "isVerifiedREADONLY", [amountAssetId], nil) {
167167 case b: Boolean =>
168168 b
169169 case _ =>
170170 throw("asset is not verified")
171171 }
172172 if ((ensureAmountAssetVerified == ensureAmountAssetVerified))
173173 then {
174174 let burnFeeInv = invoke(emissionContract, "burn", nil, [AttachedPayment(payment.assetId, payment.amount)])
175175 if ((burnFeeInv == burnFeeInv))
176176 then [BooleanEntry(keyInListAssetId(amountAssetId, priceAssetId), true), IntegerEntry(keyStartHeight(amountAssetId, priceAssetId), height), StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes("0", "0"))]
177177 else throw("Strict value is not equal to itself.")
178178 }
179179 else throw("Strict value is not equal to itself.")
180180 }
181181 else throw("Strict value is not equal to itself.")
182182 }
183183 else throw("Strict value is not equal to itself.")
184184 }
185185
186186
187187
188188 @Callable(i)
189189 func vote (amountAssetId,priceAssetId,inFavor) = {
190190 let votingFinishHeight = (value(getInteger(keyStartHeight(amountAssetId, priceAssetId))) + value(getInteger(keyVotingDuration)))
191- let checks = [if ((getString(keyVote(amountAssetId, priceAssetId, toString(i.caller))) != unit))
191+ let checks = [if ((getString(keyVote(amountAssetId, priceAssetId, toString(i.caller))) == unit))
192192 then true
193193 else throw("you already voted"), if (valueOrElse(getBoolean(keyInListAssetId(amountAssetId, priceAssetId)), false))
194194 then true
195195 else throw("the token isn't on the voting list"), if ((votingFinishHeight > height))
196196 then true
197197 else throw("too late to vote")]
198198 if ((checks == checks))
199199 then {
200200 let votingResult = split(value(getString(keyVotingResult(amountAssetId, priceAssetId))), separator)
201201 let positiveVotes = votingResult[1]
202202 let negativeVotes = votingResult[2]
203203 let gwxAmount = invoke(boostingContract, "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), votingFinishHeight], nil)
204204 let notZero = if ((asInt(gwxAmount) > 0))
205205 then true
206206 else throw("you don't have gwx")
207207 if ((notZero == notZero))
208208 then {
209209 let entries = if (inFavor)
210210 then {
211211 let newPositiveVotes = (parseIntValue(positiveVotes) + asInt(gwxAmount))
212212 let yesVoteKey = keyVote(amountAssetId, priceAssetId, toString(i.caller))
213213 let yesVoteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor)
214214 $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(toString(newPositiveVotes), negativeVotes)), StringEntry(yesVoteKey, yesVoteValue)], unit)
215215 }
216216 else {
217217 let newNegativeVotes = (parseIntValue(negativeVotes) + asInt(gwxAmount))
218218 let noVoteKey = keyVote(amountAssetId, priceAssetId, toString(i.caller))
219219 let noVoteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor)
220220 $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(positiveVotes, toString(newNegativeVotes))), StringEntry(noVoteKey, noVoteValue)], unit)
221221 }
222222 entries
223223 }
224224 else throw("Strict value is not equal to itself.")
225225 }
226226 else throw("Strict value is not equal to itself.")
227227 }
228228
229229
230230
231231 @Callable(i)
232232 func cancelVote (amountAssetId,priceAssetId) = {
233233 let checks = [if (isDefined(getString(keyVotingResult(amountAssetId, priceAssetId))))
234234 then true
235235 else throw("no vote for assets pair")]
236236 if ((checks == checks))
237237 then {
238238 let vote = split(value(getString(keyVote(amountAssetId, priceAssetId, toString(i.caller)))), separator)
239239 let voteValue = vote[1]
240240 let voteType = vote[2]
241241 let votingResult = split(value(getString(keyVotingResult(amountAssetId, priceAssetId))), separator)
242242 let positiveVotes = votingResult[1]
243243 let negativeVotes = votingResult[2]
244244 let actions = if ((voteType == "yes"))
245245 then {
246246 let newPositiveVotes = (parseIntValue(positiveVotes) - parseIntValue(voteValue))
247247 $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(toString(newPositiveVotes), negativeVotes)), DeleteEntry(keyVote(amountAssetId, priceAssetId, toString(i.caller)))], unit)
248248 }
249249 else {
250250 let newNegativeVotes = (parseIntValue(negativeVotes) - parseIntValue(voteValue))
251251 $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(positiveVotes, toString(newNegativeVotes))), DeleteEntry(keyVote(amountAssetId, priceAssetId, toString(i.caller)))], unit)
252252 }
253253 actions
254254 }
255255 else throw("Strict value is not equal to itself.")
256256 }
257257
258258
259259
260260 @Callable(i)
261261 func setFee (newFee) = {
262262 let checks = [mustManager(i)]
263263 if ((checks == checks))
264264 then [IntegerEntry(keyFeeAmount, newFee)]
265265 else throw("Strict value is not equal to itself.")
266266 }
267267
268268
269269
270270 @Callable(i)
271271 func finalize (amountAssetId,priceAssetId) = {
272272 let votingFinishHeight = (value(getInteger(keyStartHeight(amountAssetId, priceAssetId))) + value(getInteger(keyVotingDuration)))
273273 let checks = [if (isDefined(getBoolean(keyInListAssetId(amountAssetId, priceAssetId))))
274274 then true
275275 else throw("no assets pair"), if ((height >= votingFinishHeight))
276276 then true
277277 else throw("insufficient height for completion")]
278278 if ((checks == checks))
279279 then {
280280 let votingResult = split(value(getString(keyVotingResult(amountAssetId, priceAssetId))), separator)
281281 let positiveVotes = parseIntValue(votingResult[1])
282282 let negativeVotes = parseIntValue(votingResult[2])
283283 let actions = if ((positiveVotes > negativeVotes))
284284 then {
285285 let res = invoke(assetStoreContract, "setPoolLabels", [amountAssetId, priceAssetId, "WX_EMISSION"], nil)
286286 if ((res == res))
287287 then $Tuple2([DeleteEntry(keyInListAssetId(amountAssetId, priceAssetId))], unit)
288288 else throw("Strict value is not equal to itself.")
289289 }
290290 else $Tuple2([DeleteEntry(keyInListAssetId(amountAssetId, priceAssetId))], unit)
291291 actions
292292 }
293293 else throw("Strict value is not equal to itself.")
294294 }
295295
296296
297297
298298 @Callable(i)
299299 func setManager (pendingManagerPublicKey) = {
300300 let checkCaller = mustManager(i)
301301 if ((checkCaller == checkCaller))
302302 then {
303303 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
304304 if ((checkManagerPublicKey == checkManagerPublicKey))
305305 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
306306 else throw("Strict value is not equal to itself.")
307307 }
308308 else throw("Strict value is not equal to itself.")
309309 }
310310
311311
312312
313313 @Callable(i)
314314 func confirmManager () = {
315315 let pm = pendingManagerPublicKeyOrUnit()
316316 let hasPM = if (isDefined(pm))
317317 then true
318318 else throw("no pending manager")
319319 if ((hasPM == hasPM))
320320 then {
321321 let checkPM = if ((i.callerPublicKey == value(pm)))
322322 then true
323323 else throw("you are not pending manager")
324324 if ((checkPM == checkPM))
325325 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
326326 else throw("Strict value is not equal to itself.")
327327 }
328328 else throw("Strict value is not equal to itself.")
329329 }
330330
331331
332332 @Verifier(tx)
333333 func verify () = {
334334 let targetPublicKey = match managerPublicKeyOrUnit() {
335335 case pk: ByteVector =>
336336 pk
337337 case _: Unit =>
338338 tx.senderPublicKey
339339 case _ =>
340340 throw("Match error")
341341 }
342342 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
343343 }
344344

github/deemru/w8io/169f3d6 
67.97 ms