tx · EfH64ov9Pc8YTaE9prTQihx791knnLjqfEkZdejRVdLT

3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T:  -0.01400000 Waves

2022.05.11 16:06 [2047047] smart account 3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T > SELF 0.00000000 Waves

{ "type": 13, "id": "EfH64ov9Pc8YTaE9prTQihx791knnLjqfEkZdejRVdLT", "fee": 1400000, "feeAssetId": null, "timestamp": 1652274411699, "version": 1, "sender": "3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T", "senderPublicKey": "7iXEgsFNsnbLZ3ca4tmz8jffnyxMu9keuBV6CuQPJLuA", "proofs": [ "ryeYZEqDCmNKvhQXikxMGYn7TdB6Z3jVAvxFhn15az5MPzEuTAnAdCRLafKaVunjGRXt7Z5d8RwUDfhyrNEJJwM" ], "script": "base64:AAIFAAAAAAAAADQIAhILCgkICAgIAQgBCAESBAoCCAgSBQoDCAgEEgQKAggIEgMKAQESBAoCCAgSAwoBCBIAAAAAHAAAAAAJc2VwYXJhdG9yAgAAAAJfXwAAAAAMa2V5RmVlQW1vdW50CQAEuQAAAAIJAARMAAAAAgIAAAACJXMJAARMAAAAAgIAAAADZmVlBQAAAANuaWwFAAAACXNlcGFyYXRvcgAAAAAOa2V5VXNkbkFzc2V0SWQJAAS5AAAAAgkABEwAAAACAgAAAAIlcwkABEwAAAACAgAAAAt1c2RuQXNzZXRJZAUAAAADbmlsBQAAAAlzZXBhcmF0b3IAAAAAEWtleVZvdGluZ0R1cmF0aW9uCQAEuQAAAAIJAARMAAAAAgIAAAACJXMJAARMAAAAAgIAAAALZXBvY2hMZW5ndGgFAAAAA25pbAUAAAAJc2VwYXJhdG9yAAAAABFrZXlGaW5hbGl6ZVJld2FyZAkABLkAAAACCQAETAAAAAICAAAAAiVzCQAETAAAAAICAAAADmZpbmFsaXplUmV3YXJkBQAAAANuaWwFAAAACXNlcGFyYXRvcgAAAAASa2V5Vm90aW5nVGhyZXNob2xkCQ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AAAV2YWx1ZQAAAAEFAAAAAnBtBgkAAAIAAAABAgAAABtZb3UgYXJlIG5vdCBwZW5kaW5nIG1hbmFnZXIDCQAAAAAAAAIFAAAAB2NoZWNrUE0FAAAAB2NoZWNrUE0JAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAAE2tleU1hbmFnZXJQdWJsaWNLZXkAAAAACQACWAAAAAEJAQAAAAV2YWx1ZQAAAAEFAAAAAnBtCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAQAAABprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAAAAAFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAPdGFyZ2V0UHVibGljS2V5BAAAAAckbWF0Y2gwCQEAAAAWbWFuYWdlclB1YmxpY0tleU9yVW5pdAAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAnBrBQAAAAckbWF0Y2gwBQAAAAJwawMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAD3RhcmdldFB1YmxpY0tleYhkO+Q=", "chainId": 84, "height": 2047047, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: H1SUpEXa863ijp7fS86XeAnKSBvesHBgjmEZLvG1kLAe Next: 7yXFtrVdX8up8moYTCL1Sqa2A4vs5uJPBjwGh28GWdj3 Diff:
OldNewDifferences
3333
3434
3535 func keyVotingResult (amountAssetId,priceAssetId) = makeString(["%s%s%s", "votingResult", amountAssetId, priceAssetId], separator)
36+
37+
38+func totalVotes (totalYes,totalNo) = makeString(["%d%d", totalYes, totalNo], separator)
3639
3740
3841 func keyVote (amountAssetId,priceAssetId,voterAddress) = makeString(["%s%s%s%s", "vote", amountAssetId, priceAssetId, voterAddress], separator)
189192 let votingFinishHeight = (value(getInteger(keyStartHeight(amountAssetId, priceAssetId))) + value(getInteger(keyVotingDuration)))
190193 let checks = [if (valueOrElse(getBoolean(keyInListAssetId(amountAssetId, priceAssetId)), false))
191194 then true
192- else throw("The token isn't on the voting list"), if ((height >= votingFinishHeight))
195+ else throw("The token isn't on the voting list"), if ((votingFinishHeight > height))
193196 then true
194197 else throw("too late to vote")]
195198 if ((checks == checks))
201204 let entries = if (inFavor)
202205 then {
203206 let newPositiveVotes = (parseIntValue(positiveVotes) + asInt(gwxAmount))
204- let totalVotes = makeString(["%d%d", toString(newPositiveVotes), negativeVotes], separator)
205207 let yesVoteKey = keyVote(amountAssetId, priceAssetId, toString(i.caller))
206208 let yesVoteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor)
207- $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes), StringEntry(yesVoteKey, yesVoteValue)], unit)
209+ $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(toString(newPositiveVotes), negativeVotes)), StringEntry(yesVoteKey, yesVoteValue)], unit)
208210 }
209211 else {
210212 let newNegativeVotes = (parseIntValue(negativeVotes) + asInt(gwxAmount))
211- let totalVotes = makeString(["%d%d", positiveVotes, toString(newNegativeVotes)], separator)
212213 let noVoteKey = keyVote(amountAssetId, priceAssetId, toString(i.caller))
213214 let noVoteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor)
214- $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes), StringEntry(noVoteKey, noVoteValue)], unit)
215+ $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(positiveVotes, toString(newNegativeVotes))), StringEntry(noVoteKey, noVoteValue)], unit)
215216 }
216217 entries
217218 }
222223
223224 @Callable(i)
224225 func cancelVote (amountAssetId,priceAssetId) = {
225- let checks = [if (isDefined(keyVotingResult(amountAssetId, priceAssetId)))
226+ let checks = [if (isDefined(getString(keyVotingResult(amountAssetId, priceAssetId))))
226227 then true
227228 else throw("No vote for assets pair")]
228229 if ((checks == checks))
236237 let actions = if ((voteType == "yes"))
237238 then {
238239 let newPositiveVotes = (parseIntValue(positiveVotes) - parseIntValue(voteValue))
239- let totalVotes = makeString(["%d%d", toString(newPositiveVotes), negativeVotes], separator)
240- $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes), DeleteEntry(keyVote(amountAssetId, priceAssetId, toString(i.caller)))], unit)
240+ $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(toString(newPositiveVotes), negativeVotes)), DeleteEntry(keyVote(amountAssetId, priceAssetId, toString(i.caller)))], unit)
241241 }
242242 else {
243243 let newNegativeVotes = (parseIntValue(negativeVotes) - parseIntValue(voteValue))
244- let totalVotes = makeString(["%d%d", toString(newNegativeVotes), negativeVotes], separator)
245- $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes), DeleteEntry(keyVote(amountAssetId, priceAssetId, toString(i.caller)))], unit)
244+ $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(positiveVotes, toString(newNegativeVotes))), DeleteEntry(keyVote(amountAssetId, priceAssetId, toString(i.caller)))], unit)
246245 }
247246 actions
248247 }
264263 @Callable(i)
265264 func finalize (amountAssetId,priceAssetId) = {
266265 let votingFinishHeight = (value(getInteger(keyStartHeight(amountAssetId, priceAssetId))) + value(getInteger(keyVotingDuration)))
267- let checks = [if (isDefined(keyInListAssetId(amountAssetId, priceAssetId)))
266+ let checks = [if (isDefined(getBoolean(keyInListAssetId(amountAssetId, priceAssetId))))
268267 then true
269- else throw("No assets pair"), if ((votingFinishHeight > height))
268+ else throw("No assets pair"), if ((height >= votingFinishHeight))
270269 then true
271270 else throw("insufficient height for completion")]
272271 if ((checks == checks))
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 keyVotingThreshold = makeString(["%s", "votingThreshold"], separator)
1515
1616 let keyWxAssetId = makeString(["%s", "wxAssetId"], separator)
1717
1818 let keyAssetsStoreContract = makeString(["%s", "assetsStoreContract"], separator)
1919
2020 let keyuserPoolContract = makeString(["%s", "userPoolContract"], separator)
2121
2222 let keyEmissionContract = makeString(["%s", "emissionContract"], separator)
2323
2424 let keyBoostingContract = makeString(["%s", "boostingContract"], separator)
2525
2626 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
2727
2828
2929 func keyInListAssetId (amountAssetId,priceAssetId) = makeString(["%s%s%s", "inList", amountAssetId, priceAssetId], separator)
3030
3131
3232 func keyStartHeight (amountAssetId,priceAssetId) = makeString(["%s%s%s", "startHeight", amountAssetId, priceAssetId], separator)
3333
3434
3535 func keyVotingResult (amountAssetId,priceAssetId) = makeString(["%s%s%s", "votingResult", amountAssetId, priceAssetId], separator)
36+
37+
38+func totalVotes (totalYes,totalNo) = makeString(["%d%d", totalYes, totalNo], separator)
3639
3740
3841 func keyVote (amountAssetId,priceAssetId,voterAddress) = makeString(["%s%s%s%s", "vote", amountAssetId, priceAssetId, voterAddress], separator)
3942
4043
4144 func keyVoteValue (gwxAmount,vote) = {
4245 let key = if (vote)
4346 then makeString(["%d%s", gwxAmount, "yes"], separator)
4447 else makeString(["%d%s", gwxAmount, "no"], separator)
4548 key
4649 }
4750
4851
4952 func keyManagerPublicKey () = "%s__managerPublicKey"
5053
5154
5255 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
5356
5457
5558 let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract))
5659
5760 let userPoolContract = addressFromStringValue(getStringOrFail(keyuserPoolContract))
5861
5962 let boostingContract = addressFromStringValue(getStringOrFail(keyBoostingContract))
6063
6164 let assetStoreContract = addressFromStringValue(getStringOrFail(keyAssetsStoreContract))
6265
6366 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
6467 case s: String =>
6568 fromBase58String(s)
6669 case _: Unit =>
6770 unit
6871 case _ =>
6972 throw("Match error")
7073 }
7174
7275
7376 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
7477 case s: String =>
7578 fromBase58String(s)
7679 case _: Unit =>
7780 unit
7881 case _ =>
7982 throw("Match error")
8083 }
8184
8285
8386 func mustManager (i) = {
8487 let pd = throw("Permission denied")
8588 match managerPublicKeyOrUnit() {
8689 case pk: ByteVector =>
8790 if ((i.callerPublicKey == pk))
8891 then true
8992 else pd
9093 case _: Unit =>
9194 if ((i.caller == this))
9295 then true
9396 else pd
9497 case _ =>
9598 throw("Match error")
9699 }
97100 }
98101
99102
100103 func asInt (val) = match val {
101104 case valInt: Int =>
102105 valInt
103106 case _ =>
104107 throw("Failed to cast into Integer")
105108 }
106109
107110
108111 @Callable(i)
109112 func constructor (assetsStoreContractPrm,userPoolContractPrm,boostingContractPrm,emissionContractPrm,feeAmountPrm,wxAssetIdPrm,votingDurationPrm,usdnAssetIdPrm,finalizeRewardPrm) = {
110113 let checks = [mustManager(i), if (isDefined(addressFromString(assetsStoreContractPrm)))
111114 then true
112115 else throw("Invalid asset_store contract address"), if (isDefined(addressFromString(boostingContractPrm)))
113116 then true
114117 else throw("Invalid boosting contract address"), if (isDefined(addressFromString(userPoolContractPrm)))
115118 then true
116119 else throw("Invalid user_pools contract address"), if (isDefined(addressFromString(emissionContractPrm)))
117120 then true
118121 else throw("Invalid emission contract address"), if ((feeAmountPrm >= 0))
119122 then true
120123 else throw("Invalid fee amount"), if ((votingDurationPrm > 0))
121124 then true
122125 else throw("Invalid voting duration"), if ((finalizeRewardPrm > 0))
123126 then true
124127 else throw("Invalid finalize reward"), if (isDefined(assetInfo(fromBase58String(wxAssetIdPrm))))
125128 then true
126129 else throw("Invalid WX asset ID"), if (isDefined(assetInfo(fromBase58String(usdnAssetIdPrm))))
127130 then true
128131 else throw("Invalid USDN asset ID")]
129132 if ((checks == checks))
130133 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)], unit)
131134 else throw("Strict value is not equal to itself.")
132135 }
133136
134137
135138
136139 @Callable(i)
137140 func suggest (amountAssetId,priceAssetId) = {
138141 let payment = value(i.payments[0])
139142 let info = valueOrErrorMessage(assetInfo(fromBase58String(amountAssetId)), "Invalid amountAssetId ID")
140143 let checks = [if ((info.issuer == i.caller))
141144 then true
142145 else throw("Asset can only be suggested by its issuer"), if ((info.scripted == false))
143146 then true
144147 else throw("Asset is smart"), if ((toBase58String(value(payment.assetId)) == value(getString(keyWxAssetId))))
145148 then true
146149 else throw("Invalid fee asset"), if ((payment.amount == value(getInteger(keyFeeAmount))))
147150 then true
148151 else throw("Invalid fee amount"), if ((priceAssetId == value(getString(keyUsdnAssetId))))
149152 then true
150153 else throw("priceAssetId is not USDN"), if ((getBoolean(keyInListAssetId(amountAssetId, priceAssetId)) == unit))
151154 then true
152155 else throw("Already in voting list")]
153156 if ((checks == checks))
154157 then {
155158 let ensureActive = match invoke(userPoolContract, "statusREADONLY", [amountAssetId, priceAssetId], nil) {
156159 case s: String =>
157160 if ((s == "active"))
158161 then true
159162 else throw("User pool is not active")
160163 case _ =>
161164 throw("User pool is not active")
162165 }
163166 if ((ensureActive == ensureActive))
164167 then {
165168 let ensureAmountAssetVerified = match invoke(assetStoreContract, "isVerifiedREADONLY", [amountAssetId], nil) {
166169 case b: Boolean =>
167170 b
168171 case _ =>
169172 throw("Asset is not verified")
170173 }
171174 if ((ensureAmountAssetVerified == ensureAmountAssetVerified))
172175 then {
173176 let burnFeeInv = invoke(emissionContract, "burn", nil, [AttachedPayment(payment.assetId, payment.amount)])
174177 if ((burnFeeInv == burnFeeInv))
175178 then [BooleanEntry(keyInListAssetId(amountAssetId, priceAssetId), true), IntegerEntry(keyStartHeight(amountAssetId, priceAssetId), height)]
176179 else throw("Strict value is not equal to itself.")
177180 }
178181 else throw("Strict value is not equal to itself.")
179182 }
180183 else throw("Strict value is not equal to itself.")
181184 }
182185 else throw("Strict value is not equal to itself.")
183186 }
184187
185188
186189
187190 @Callable(i)
188191 func vote (amountAssetId,priceAssetId,inFavor) = {
189192 let votingFinishHeight = (value(getInteger(keyStartHeight(amountAssetId, priceAssetId))) + value(getInteger(keyVotingDuration)))
190193 let checks = [if (valueOrElse(getBoolean(keyInListAssetId(amountAssetId, priceAssetId)), false))
191194 then true
192- else throw("The token isn't on the voting list"), if ((height >= votingFinishHeight))
195+ else throw("The token isn't on the voting list"), if ((votingFinishHeight > height))
193196 then true
194197 else throw("too late to vote")]
195198 if ((checks == checks))
196199 then {
197200 let votingResult = split(value(getString(keyVotingResult(amountAssetId, priceAssetId))), separator)
198201 let positiveVotes = votingResult[1]
199202 let negativeVotes = votingResult[2]
200203 let gwxAmount = invoke(boostingContract, "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), votingFinishHeight], nil)
201204 let entries = if (inFavor)
202205 then {
203206 let newPositiveVotes = (parseIntValue(positiveVotes) + asInt(gwxAmount))
204- let totalVotes = makeString(["%d%d", toString(newPositiveVotes), negativeVotes], separator)
205207 let yesVoteKey = keyVote(amountAssetId, priceAssetId, toString(i.caller))
206208 let yesVoteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor)
207- $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes), StringEntry(yesVoteKey, yesVoteValue)], unit)
209+ $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(toString(newPositiveVotes), negativeVotes)), StringEntry(yesVoteKey, yesVoteValue)], unit)
208210 }
209211 else {
210212 let newNegativeVotes = (parseIntValue(negativeVotes) + asInt(gwxAmount))
211- let totalVotes = makeString(["%d%d", positiveVotes, toString(newNegativeVotes)], separator)
212213 let noVoteKey = keyVote(amountAssetId, priceAssetId, toString(i.caller))
213214 let noVoteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor)
214- $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes), StringEntry(noVoteKey, noVoteValue)], unit)
215+ $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(positiveVotes, toString(newNegativeVotes))), StringEntry(noVoteKey, noVoteValue)], unit)
215216 }
216217 entries
217218 }
218219 else throw("Strict value is not equal to itself.")
219220 }
220221
221222
222223
223224 @Callable(i)
224225 func cancelVote (amountAssetId,priceAssetId) = {
225- let checks = [if (isDefined(keyVotingResult(amountAssetId, priceAssetId)))
226+ let checks = [if (isDefined(getString(keyVotingResult(amountAssetId, priceAssetId))))
226227 then true
227228 else throw("No vote for assets pair")]
228229 if ((checks == checks))
229230 then {
230231 let vote = split(value(getString(keyVote(amountAssetId, priceAssetId, toString(i.caller)))), separator)
231232 let voteValue = vote[1]
232233 let voteType = vote[2]
233234 let votingResult = split(value(getString(keyVotingResult(amountAssetId, priceAssetId))), separator)
234235 let positiveVotes = votingResult[1]
235236 let negativeVotes = votingResult[2]
236237 let actions = if ((voteType == "yes"))
237238 then {
238239 let newPositiveVotes = (parseIntValue(positiveVotes) - parseIntValue(voteValue))
239- let totalVotes = makeString(["%d%d", toString(newPositiveVotes), negativeVotes], separator)
240- $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes), DeleteEntry(keyVote(amountAssetId, priceAssetId, toString(i.caller)))], unit)
240+ $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(toString(newPositiveVotes), negativeVotes)), DeleteEntry(keyVote(amountAssetId, priceAssetId, toString(i.caller)))], unit)
241241 }
242242 else {
243243 let newNegativeVotes = (parseIntValue(negativeVotes) - parseIntValue(voteValue))
244- let totalVotes = makeString(["%d%d", toString(newNegativeVotes), negativeVotes], separator)
245- $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes), DeleteEntry(keyVote(amountAssetId, priceAssetId, toString(i.caller)))], unit)
244+ $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId), totalVotes(positiveVotes, toString(newNegativeVotes))), DeleteEntry(keyVote(amountAssetId, priceAssetId, toString(i.caller)))], unit)
246245 }
247246 actions
248247 }
249248 else throw("Strict value is not equal to itself.")
250249 }
251250
252251
253252
254253 @Callable(i)
255254 func setFee (newFee) = {
256255 let checks = [mustManager(i)]
257256 if ((checks == checks))
258257 then [IntegerEntry(keyFeeAmount, newFee)]
259258 else throw("Strict value is not equal to itself.")
260259 }
261260
262261
263262
264263 @Callable(i)
265264 func finalize (amountAssetId,priceAssetId) = {
266265 let votingFinishHeight = (value(getInteger(keyStartHeight(amountAssetId, priceAssetId))) + value(getInteger(keyVotingDuration)))
267- let checks = [if (isDefined(keyInListAssetId(amountAssetId, priceAssetId)))
266+ let checks = [if (isDefined(getBoolean(keyInListAssetId(amountAssetId, priceAssetId))))
268267 then true
269- else throw("No assets pair"), if ((votingFinishHeight > height))
268+ else throw("No assets pair"), if ((height >= votingFinishHeight))
270269 then true
271270 else throw("insufficient height for completion")]
272271 if ((checks == checks))
273272 then {
274273 let votingResult = split(value(getString(keyVotingResult(amountAssetId, priceAssetId))), separator)
275274 let positiveVotes = parseIntValue(votingResult[1])
276275 let negativeVotes = parseIntValue(votingResult[2])
277276 let actions = if ((positiveVotes > negativeVotes))
278277 then {
279278 let res = invoke(assetStoreContract, "setPoolLabels", [amountAssetId, priceAssetId, "WX_EMISSION"], nil)
280279 if ((res == res))
281280 then $Tuple2([DeleteEntry(keyInListAssetId(amountAssetId, priceAssetId))], unit)
282281 else throw("Strict value is not equal to itself.")
283282 }
284283 else $Tuple2([DeleteEntry(keyInListAssetId(amountAssetId, priceAssetId))], unit)
285284 actions
286285 }
287286 else throw("Strict value is not equal to itself.")
288287 }
289288
290289
291290
292291 @Callable(i)
293292 func setManager (pendingManagerPublicKey) = {
294293 let checkCaller = mustManager(i)
295294 if ((checkCaller == checkCaller))
296295 then {
297296 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
298297 if ((checkManagerPublicKey == checkManagerPublicKey))
299298 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
300299 else throw("Strict value is not equal to itself.")
301300 }
302301 else throw("Strict value is not equal to itself.")
303302 }
304303
305304
306305
307306 @Callable(i)
308307 func confirmManager () = {
309308 let pm = pendingManagerPublicKeyOrUnit()
310309 let hasPM = if (isDefined(pm))
311310 then true
312311 else throw("No pending manager")
313312 if ((hasPM == hasPM))
314313 then {
315314 let checkPM = if ((i.callerPublicKey == value(pm)))
316315 then true
317316 else throw("You are not pending manager")
318317 if ((checkPM == checkPM))
319318 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
320319 else throw("Strict value is not equal to itself.")
321320 }
322321 else throw("Strict value is not equal to itself.")
323322 }
324323
325324
326325 @Verifier(tx)
327326 func verify () = {
328327 let targetPublicKey = match managerPublicKeyOrUnit() {
329328 case pk: ByteVector =>
330329 pk
331330 case _: Unit =>
332331 tx.senderPublicKey
333332 case _ =>
334333 throw("Match error")
335334 }
336335 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
337336 }
338337

github/deemru/w8io/169f3d6 
49.74 ms