tx · AbKzGgoyXD78oYVqqA8tzZ8HChnQzyoDg9V168np9vLL

3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T:  -0.01400000 Waves

2023.05.10 13:18 [2571658] smart account 3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T > SELF 0.00000000 Waves

{ "type": 13, "id": "AbKzGgoyXD78oYVqqA8tzZ8HChnQzyoDg9V168np9vLL", "fee": 1400000, "feeAssetId": null, "timestamp": 1683713888978, "version": 2, "chainId": 84, "sender": "3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T", "senderPublicKey": "7iXEgsFNsnbLZ3ca4tmz8jffnyxMu9keuBV6CuQPJLuA", "proofs": [ "3kEos3gpx3oWZcG6WUZesSHjboNCPKAFjyWSs52U8f1EporDV9KngRujWL9RcAzRbeC6EVwTiiPjX6LTqjs9dkU3" ], "script": "base64:BgKiDAgCEg0KCwgICAgICAEIAQgBEgMKAQESBAoCCAgSBQoDCAgEEgQKAggIEgMKAQESAwoBARIECgIICBIECgIICCIJc2VwYXJhdG9yIgxrZXlGZWVBbW91bnQiDmtleVVzZG5Bc3NldElkIg5rZXlFcG9jaExlbmd0aCIRa2V5RmluYWxpemVSZXdhcmQiDGtleVd4QXNzZXRJZCIWa2V5QXNzZXRzU3RvcmVDb250cmFjdCITa2V5VXNlclBvb2xDb250cmFjdCITa2V5RW1pc3Npb25Db250cmFjdCITa2V5Qm9vc3RpbmdDb250cmFjdCISa2V5RmFjdG9yeUNvbnRyYWN0IhlrZXlWb3RpbmdFbWlzc2lvbkNvbnRyYWN0IgxrZXlUaHJlc2hvbGQiD2dldFN0cmluZ09yRmFpbCIDa2V5IgxnZXRJbnRPckZhaWwiEGtleUluTGlzdEFzc2V0SWQiDWFtb3VudEFzc2V0SWQiDHByaWNlQXNzZXRJZCIPa2V5U3VnZ2VzdEluZGV4Ig5rZXlTdGFydEhlaWdodCIMc3VnZ2VzdEluZGV4Ig9rZXlWb3RpbmdSZXN1bHQiCnRvdG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bml0BQJhUQkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFXAQdhcHByb3ZlAgFyAXMEAmFXAwkAAAIIBQFXBmNhbGxlcgUBUgYJAQFZAQUBVwMJAAACBQJhVwUCYVcEAmFVCQDMCAIJAPwHBAUBUQIWc2V0V3hFbWlzc2lvblBvb2xMYWJlbAkAzAgCBQFyCQDMCAIFAXMFA25pbAUDbmlsCQDMCAIJAPwHBAUBUwIGY3JlYXRlCQDMCAIFAXIJAMwIAgUBcwUDbmlsBQNuaWwFA25pbAMJAAACBQJhVQUCYVUJAJQKAgUDbmlsBQR1bml0CQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJhWAECYVkABAJhWgQBTAkBAVQAAwkAAQIFAUwCCkJ5dGVWZWN0b3IEAVgFAUwFAVgDCQABAgUBTAIEVW5pdAgFAmFYD3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJhWAlib2R5Qnl0ZXMJAJEDAggFAmFYBnByb29mcwAABQJhWlVPg14=", "height": 2571658, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6mJoi84NMtLPsVKujuiyDpB2TUDHx7qcAZE9KoSqQSZj Next: none Diff:
OldNewDifferences
7070 func keyManagerPublicKey () = "%s__managerPublicKey"
7171
7272
73-func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
73+func keyManagerVaultAddress () = "%s__managerVaultAddress"
74+
75+
76+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
77+ case s: String =>
78+ addressFromStringValue(s)
79+ case _ =>
80+ this
81+}
7482
7583
7684 let assetsStoreContract = addressFromStringValue(getStringOrFail(keyAssetsStoreContract))
8593
8694 let votingEmissionContract = addressFromStringValue(getStringOrFail(keyVotingEmissionContract))
8795
88-func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
89- case s: String =>
90- fromBase58String(s)
91- case _: Unit =>
92- unit
93- case _ =>
94- throw("Match error")
95-}
96-
97-
98-func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
99- case s: String =>
100- fromBase58String(s)
101- case _: Unit =>
102- unit
103- case _ =>
104- throw("Match error")
105-}
96+func managerPublicKeyOrUnit () = {
97+ let managerVaultAddress = getManagerVaultAddressOrThis()
98+ match getString(managerVaultAddress, keyManagerPublicKey()) {
99+ case s: String =>
100+ fromBase58String(s)
101+ case _: Unit =>
102+ unit
103+ case _ =>
104+ throw("Match error")
105+ }
106+ }
106107
107108
108109 func isManager (i) = match managerPublicKeyOrUnit() {
425426 }
426427
427428
428-
429-@Callable(i)
430-func setManager (pendingManagerPublicKey) = {
431- let checkCaller = mustManager(i)
432- if ((checkCaller == checkCaller))
433- then {
434- let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
435- if ((checkManagerPublicKey == checkManagerPublicKey))
436- then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
437- else throw("Strict value is not equal to itself.")
438- }
439- else throw("Strict value is not equal to itself.")
440- }
441-
442-
443-
444-@Callable(i)
445-func confirmManager () = {
446- let pm = pendingManagerPublicKeyOrUnit()
447- let hasPM = if (isDefined(pm))
448- then true
449- else throw("no pending manager")
450- if ((hasPM == hasPM))
451- then {
452- let checkPM = if ((i.callerPublicKey == value(pm)))
453- then true
454- else throw("you are not pending manager")
455- if ((checkPM == checkPM))
456- then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
457- else throw("Strict value is not equal to itself.")
458- }
459- else throw("Strict value is not equal to itself.")
460- }
461-
462-
463429 @Verifier(tx)
464430 func verify () = {
465431 let targetPublicKey = match managerPublicKeyOrUnit() {
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
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 keyEpochLength = 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 let keyFactoryContract = makeString(["%s", "factoryContract"], separator)
2525
2626 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], separator)
2727
2828 let keyThreshold = makeString(["%s", "votingThreshold"], separator)
2929
3030 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
3131
3232
3333 func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (key + " is not defined"))
3434
3535
3636 func keyInListAssetId (amountAssetId,priceAssetId) = makeString(["%s%s%s", "inList", amountAssetId, priceAssetId], separator)
3737
3838
3939 func keySuggestIndex (amountAssetId,priceAssetId) = makeString(["%s%s%s", "suggestIndex", amountAssetId, priceAssetId], separator)
4040
4141
4242 func keyStartHeight (amountAssetId,priceAssetId,suggestIndex) = makeString(["%s%s%s%d", "startHeight", amountAssetId, priceAssetId, toString(suggestIndex)], separator)
4343
4444
4545 func keyVotingResult (amountAssetId,priceAssetId,suggestIndex) = makeString(["%s%s%s%d", "votingResult", amountAssetId, priceAssetId, toString(suggestIndex)], separator)
4646
4747
4848 func totalVotes (totalYes,totalNo) = makeString(["%d%d", totalYes, totalNo], separator)
4949
5050
5151 func keyVote (amountAssetId,priceAssetId,suggestIndex,voterAddress) = makeString(["%s%s%s%d%s", "vote", amountAssetId, priceAssetId, toString(suggestIndex), voterAddress], separator)
5252
5353
5454 func keyVoteValue (gwxAmount,vote) = {
5555 let key = if (vote)
5656 then makeString(["%d%s", gwxAmount, "yes"], separator)
5757 else makeString(["%d%s", gwxAmount, "no"], separator)
5858 key
5959 }
6060
6161
6262 func keyInList (pool) = {
6363 let $t024632503 = pool
6464 let amountAssetId = $t024632503._1
6565 let priceAssetId = $t024632503._2
6666 makeString(["%s%s%s", "inList", amountAssetId, priceAssetId], separator)
6767 }
6868
6969
7070 func keyManagerPublicKey () = "%s__managerPublicKey"
7171
7272
73-func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
73+func keyManagerVaultAddress () = "%s__managerVaultAddress"
74+
75+
76+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
77+ case s: String =>
78+ addressFromStringValue(s)
79+ case _ =>
80+ this
81+}
7482
7583
7684 let assetsStoreContract = addressFromStringValue(getStringOrFail(keyAssetsStoreContract))
7785
7886 let boostingContract = addressFromStringValue(getStringOrFail(keyBoostingContract))
7987
8088 let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract))
8189
8290 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract))
8391
8492 let userPoolContract = addressFromStringValue(getStringOrFail(keyUserPoolContract))
8593
8694 let votingEmissionContract = addressFromStringValue(getStringOrFail(keyVotingEmissionContract))
8795
88-func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
89- case s: String =>
90- fromBase58String(s)
91- case _: Unit =>
92- unit
93- case _ =>
94- throw("Match error")
95-}
96-
97-
98-func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
99- case s: String =>
100- fromBase58String(s)
101- case _: Unit =>
102- unit
103- case _ =>
104- throw("Match error")
105-}
96+func managerPublicKeyOrUnit () = {
97+ let managerVaultAddress = getManagerVaultAddressOrThis()
98+ match getString(managerVaultAddress, keyManagerPublicKey()) {
99+ case s: String =>
100+ fromBase58String(s)
101+ case _: Unit =>
102+ unit
103+ case _ =>
104+ throw("Match error")
105+ }
106+ }
106107
107108
108109 func isManager (i) = match managerPublicKeyOrUnit() {
109110 case pk: ByteVector =>
110111 (i.callerPublicKey == pk)
111112 case _: Unit =>
112113 (i.caller == this)
113114 case _ =>
114115 throw("Match error")
115116 }
116117
117118
118119 func mustManager (i) = if (isManager(i))
119120 then true
120121 else throw("permission denied")
121122
122123
123124 func asInt (val) = match val {
124125 case valInt: Int =>
125126 valInt
126127 case _ =>
127128 throw("failed to cast into Integer")
128129 }
129130
130131
131132 @Callable(i)
132133 func constructor (assetsStoreContractPrm,boostingContractPrm,emissionContractPrm,factoryContractPrm,userPoolContractPrm,votingEmissionContractPrm,feeAmountPrm,wxAssetIdPrm,votingDurationPrm,usdnAssetIdPrm,finalizeRewardPrm) = {
133134 let checks = [mustManager(i), if (isDefined(addressFromString(assetsStoreContractPrm)))
134135 then true
135136 else throw("Invalid asset_store contract address"), if (isDefined(addressFromString(boostingContractPrm)))
136137 then true
137138 else throw("Invalid boosting contract address"), if (isDefined(addressFromString(userPoolContractPrm)))
138139 then true
139140 else throw("Invalid user_pools contract address"), if (isDefined(addressFromString(emissionContractPrm)))
140141 then true
141142 else throw("Invalid emission contract address"), if (isDefined(addressFromString(factoryContractPrm)))
142143 then true
143144 else throw("Invalid factory contract address"), if ((feeAmountPrm >= 0))
144145 then true
145146 else throw("Invalid fee amount"), if ((votingDurationPrm > 0))
146147 then true
147148 else throw("Invalid voting duration"), if ((finalizeRewardPrm >= 0))
148149 then true
149150 else throw("Invalid finalize reward"), if (isDefined(assetInfo(fromBase58String(wxAssetIdPrm))))
150151 then true
151152 else throw("Invalid WX asset ID"), if (isDefined(assetInfo(fromBase58String(usdnAssetIdPrm))))
152153 then true
153154 else throw("Invalid USDN asset ID")]
154155 if ((checks == checks))
155156 then $Tuple2([StringEntry(keyAssetsStoreContract, assetsStoreContractPrm), StringEntry(keyBoostingContract, boostingContractPrm), StringEntry(keyEmissionContract, emissionContractPrm), StringEntry(keyFactoryContract, factoryContractPrm), StringEntry(keyUserPoolContract, userPoolContractPrm), StringEntry(keyVotingEmissionContract, votingEmissionContractPrm), IntegerEntry(keyFeeAmount, feeAmountPrm), IntegerEntry(keyEpochLength, votingDurationPrm), IntegerEntry(keyFinalizeReward, finalizeRewardPrm), StringEntry(keyWxAssetId, wxAssetIdPrm), StringEntry(keyUsdnAssetId, usdnAssetIdPrm)], unit)
156157 else throw("Strict value is not equal to itself.")
157158 }
158159
159160
160161
161162 @Callable(i)
162163 func constructorV2 (threshold) = {
163164 let checks = [mustManager(i), if ((threshold > 0))
164165 then true
165166 else throw("invalid threshold")]
166167 if ((checks == checks))
167168 then $Tuple2([IntegerEntry(keyThreshold, threshold)], unit)
168169 else throw("Strict value is not equal to itself.")
169170 }
170171
171172
172173
173174 @Callable(i)
174175 func suggest (amountAssetId,priceAssetId) = {
175176 let pool = $Tuple2(amountAssetId, priceAssetId)
176177 let payment = value(i.payments[0])
177178 let checkAmountAsset = if ((amountAssetId == "WAVES"))
178179 then unit
179180 else {
180181 let info = valueOrErrorMessage(assetInfo(fromBase58String(amountAssetId)), "invalid amountAssetId ID")
181182 if ((info.scripted == false))
182183 then true
183184 else throw("asset is smart")
184185 }
185186 if ((checkAmountAsset == checkAmountAsset))
186187 then {
187188 let checks = [if ((toBase58String(value(payment.assetId)) == value(getString(keyWxAssetId))))
188189 then true
189190 else throw("invalid fee asset"), if ((payment.amount == value(getInteger(keyFeeAmount))))
190191 then true
191192 else throw("invalid fee amount"), if ((getInteger(keyInListAssetId(amountAssetId, priceAssetId)) == unit))
192193 then true
193194 else throw("already in voting list"), if (!(valueOrElse(getBoolean(votingEmissionContract, keyInList(pool)), false)))
194195 then true
195196 else throw("pool is in emission voting list")]
196197 if ((checks == checks))
197198 then {
198199 let ensureActive = match invoke(userPoolContract, "statusREADONLY", [amountAssetId, priceAssetId], nil) {
199200 case s: String =>
200201 if ((s == "active"))
201202 then true
202203 else throw("user pool is not active")
203204 case _ =>
204205 throw("user pool is not active")
205206 }
206207 if ((ensureActive == ensureActive))
207208 then {
208209 let ensureAmountAssetVerified = if (isManager(i))
209210 then unit
210211 else {
211212 let inv = match invoke(assetsStoreContract, "isVerifiedREADONLY", [amountAssetId], nil) {
212213 case b: Boolean =>
213214 if (b)
214215 then true
215216 else throw("asset is not verified")
216217 case _ =>
217218 throw("asset is not verified")
218219 }
219220 if ((inv == inv))
220221 then unit
221222 else throw("Strict value is not equal to itself.")
222223 }
223224 if ((ensureAmountAssetVerified == ensureAmountAssetVerified))
224225 then {
225226 let burnFeeInv = invoke(emissionContract, "burn", nil, [AttachedPayment(payment.assetId, payment.amount)])
226227 if ((burnFeeInv == burnFeeInv))
227228 then {
228229 let newSuggestIndex = match getInteger(keySuggestIndex(amountAssetId, priceAssetId)) {
229230 case int: Int =>
230231 (int + 1)
231232 case _ =>
232233 0
233234 }
234235 $Tuple2([IntegerEntry(keyInListAssetId(amountAssetId, priceAssetId), newSuggestIndex), IntegerEntry(keyStartHeight(amountAssetId, priceAssetId, newSuggestIndex), height), StringEntry(keyVotingResult(amountAssetId, priceAssetId, newSuggestIndex), totalVotes("0", "0")), IntegerEntry(keySuggestIndex(amountAssetId, priceAssetId), newSuggestIndex)], unit)
235236 }
236237 else throw("Strict value is not equal to itself.")
237238 }
238239 else throw("Strict value is not equal to itself.")
239240 }
240241 else throw("Strict value is not equal to itself.")
241242 }
242243 else throw("Strict value is not equal to itself.")
243244 }
244245 else throw("Strict value is not equal to itself.")
245246 }
246247
247248
248249
249250 @Callable(i)
250251 func vote (amountAssetId,priceAssetId,inFavor) = {
251252 let suggestIndex = value(getInteger(keyInListAssetId(amountAssetId, priceAssetId)))
252253 let votingFinishHeight = (value(getInteger(keyStartHeight(amountAssetId, priceAssetId, suggestIndex))) + value(getInteger(keyEpochLength)))
253254 let checks = [if (isDefined(getInteger(keyInListAssetId(amountAssetId, priceAssetId))))
254255 then true
255256 else throw("the token isn't on the voting list"), if ((votingFinishHeight > height))
256257 then true
257258 else throw("too late to vote")]
258259 if ((checks == checks))
259260 then {
260261 let gwxAmount = invoke(boostingContract, "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), votingFinishHeight], nil)
261262 let notZero = if ((asInt(gwxAmount) > 0))
262263 then true
263264 else throw("you don't have gwx")
264265 if ((notZero == notZero))
265266 then {
266267 let vote = match getString(keyVote(amountAssetId, priceAssetId, suggestIndex, toString(i.caller))) {
267268 case s: String =>
268269 let vote = split(s, separator)
269270 let voteValue = vote[1]
270271 let voteType = vote[2]
271272 let isVoteTypeSimilar = if (if ((voteType == "yes"))
272273 then (inFavor == true)
273274 else false)
274275 then true
275276 else if ((voteType == "no"))
276277 then (inFavor == false)
277278 else false
278279 let isVoteValueSimilar = if (isVoteTypeSimilar)
279280 then (asInt(gwxAmount) == parseIntValue(voteValue))
280281 else false
281282 let isNewVoteSimilar = if (if (isVoteTypeSimilar)
282283 then isVoteValueSimilar
283284 else false)
284285 then throw("you already voted")
285286 else invoke(this, "cancelVote", [amountAssetId, priceAssetId], nil)
286287 isNewVoteSimilar
287288 case u: Unit =>
288289 u
289290 case _ =>
290291 throw("Match error")
291292 }
292293 if ((vote == vote))
293294 then {
294295 let votingResult = split(value(getString(keyVotingResult(amountAssetId, priceAssetId, suggestIndex))), separator)
295296 let positiveVotes = votingResult[1]
296297 let negativeVotes = votingResult[2]
297298 let newPositiveAndNegativeVotes = if (inFavor)
298299 then {
299300 let newPositiveVotes = (parseIntValue(positiveVotes) + asInt(gwxAmount))
300301 [toString(newPositiveVotes), negativeVotes]
301302 }
302303 else {
303304 let newNegativeVotes = (parseIntValue(negativeVotes) + asInt(gwxAmount))
304305 [positiveVotes, toString(newNegativeVotes)]
305306 }
306307 let voteKey = keyVote(amountAssetId, priceAssetId, suggestIndex, toString(i.caller))
307308 let voteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor)
308309 $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId, suggestIndex), totalVotes(newPositiveAndNegativeVotes[0], newPositiveAndNegativeVotes[1])), StringEntry(voteKey, voteValue)], unit)
309310 }
310311 else throw("Strict value is not equal to itself.")
311312 }
312313 else throw("Strict value is not equal to itself.")
313314 }
314315 else throw("Strict value is not equal to itself.")
315316 }
316317
317318
318319
319320 @Callable(i)
320321 func cancelVote (amountAssetId,priceAssetId) = {
321322 let userAddress = if ((i.caller == this))
322323 then toString(i.originCaller)
323324 else toString(i.caller)
324325 let suggestIndex = value(getInteger(keyInListAssetId(amountAssetId, priceAssetId)))
325326 let checks = [if (isDefined(getString(keyVotingResult(amountAssetId, priceAssetId, suggestIndex))))
326327 then true
327328 else throw("no vote for assets pair")]
328329 if ((checks == checks))
329330 then {
330331 let vote = split(value(getString(keyVote(amountAssetId, priceAssetId, suggestIndex, userAddress))), separator)
331332 let voteValue = vote[1]
332333 let voteType = vote[2]
333334 let votingResult = split(value(getString(keyVotingResult(amountAssetId, priceAssetId, suggestIndex))), separator)
334335 let positiveVotes = votingResult[1]
335336 let negativeVotes = votingResult[2]
336337 let actions = if ((voteType == "yes"))
337338 then {
338339 let newPositiveVotes = (parseIntValue(positiveVotes) - parseIntValue(voteValue))
339340 $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId, suggestIndex), totalVotes(toString(newPositiveVotes), negativeVotes)), DeleteEntry(keyVote(amountAssetId, priceAssetId, suggestIndex, userAddress))], unit)
340341 }
341342 else {
342343 let newNegativeVotes = (parseIntValue(negativeVotes) - parseIntValue(voteValue))
343344 $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId, suggestIndex), totalVotes(positiveVotes, toString(newNegativeVotes))), DeleteEntry(keyVote(amountAssetId, priceAssetId, suggestIndex, userAddress))], unit)
344345 }
345346 actions
346347 }
347348 else throw("Strict value is not equal to itself.")
348349 }
349350
350351
351352
352353 @Callable(i)
353354 func setFee (newFee) = {
354355 let checks = [mustManager(i)]
355356 if ((checks == checks))
356357 then [IntegerEntry(keyFeeAmount, newFee)]
357358 else throw("Strict value is not equal to itself.")
358359 }
359360
360361
361362
362363 @Callable(i)
363364 func setThreshold (newThreshold) = {
364365 let checks = [mustManager(i), if ((newThreshold > 0))
365366 then true
366367 else throw("invalid threshold")]
367368 if ((checks == checks))
368369 then $Tuple2([IntegerEntry(keyThreshold, newThreshold)], unit)
369370 else throw("Strict value is not equal to itself.")
370371 }
371372
372373
373374
374375 @Callable(i)
375376 func finalize (amountAssetId,priceAssetId) = {
376377 let suggestIndex = value(getInteger(keyInListAssetId(amountAssetId, priceAssetId)))
377378 let votingFinishHeight = (value(getInteger(keyStartHeight(amountAssetId, priceAssetId, suggestIndex))) + value(getInteger(keyEpochLength)))
378379 let checks = [if (isDefined(getInteger(keyInListAssetId(amountAssetId, priceAssetId))))
379380 then true
380381 else throw("no assets pair"), if ((height >= votingFinishHeight))
381382 then true
382383 else throw("insufficient height for completion")]
383384 if ((checks == checks))
384385 then {
385386 let votingResult = split(value(getString(keyVotingResult(amountAssetId, priceAssetId, suggestIndex))), separator)
386387 let positiveVotes = parseIntValue(votingResult[1])
387388 let negativeVotes = parseIntValue(votingResult[2])
388389 let allVotes = (positiveVotes + negativeVotes)
389390 let threshold = getIntOrFail(keyThreshold)
390391 let actions = if (if ((allVotes >= threshold))
391392 then (positiveVotes > negativeVotes)
392393 else false)
393394 then {
394395 let res = invoke(factoryContract, "setWxEmissionPoolLabel", [amountAssetId, priceAssetId], nil)
395396 if ((res == res))
396397 then {
397398 let votingEmissionInv = invoke(votingEmissionContract, "create", [amountAssetId, priceAssetId], nil)
398399 if ((votingEmissionInv == votingEmissionInv))
399400 then $Tuple2([DeleteEntry(keyInListAssetId(amountAssetId, priceAssetId))], unit)
400401 else throw("Strict value is not equal to itself.")
401402 }
402403 else throw("Strict value is not equal to itself.")
403404 }
404405 else $Tuple2([DeleteEntry(keyInListAssetId(amountAssetId, priceAssetId))], unit)
405406 actions
406407 }
407408 else throw("Strict value is not equal to itself.")
408409 }
409410
410411
411412
412413 @Callable(i)
413414 func approve (amountAssetId,priceAssetId) = {
414415 let checkCaller = if ((i.caller == userPoolContract))
415416 then true
416417 else mustManager(i)
417418 if ((checkCaller == checkCaller))
418419 then {
419420 let res = [invoke(factoryContract, "setWxEmissionPoolLabel", [amountAssetId, priceAssetId], nil), invoke(votingEmissionContract, "create", [amountAssetId, priceAssetId], nil)]
420421 if ((res == res))
421422 then $Tuple2(nil, unit)
422423 else throw("Strict value is not equal to itself.")
423424 }
424425 else throw("Strict value is not equal to itself.")
425426 }
426427
427428
428-
429-@Callable(i)
430-func setManager (pendingManagerPublicKey) = {
431- let checkCaller = mustManager(i)
432- if ((checkCaller == checkCaller))
433- then {
434- let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
435- if ((checkManagerPublicKey == checkManagerPublicKey))
436- then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
437- else throw("Strict value is not equal to itself.")
438- }
439- else throw("Strict value is not equal to itself.")
440- }
441-
442-
443-
444-@Callable(i)
445-func confirmManager () = {
446- let pm = pendingManagerPublicKeyOrUnit()
447- let hasPM = if (isDefined(pm))
448- then true
449- else throw("no pending manager")
450- if ((hasPM == hasPM))
451- then {
452- let checkPM = if ((i.callerPublicKey == value(pm)))
453- then true
454- else throw("you are not pending manager")
455- if ((checkPM == checkPM))
456- then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
457- else throw("Strict value is not equal to itself.")
458- }
459- else throw("Strict value is not equal to itself.")
460- }
461-
462-
463429 @Verifier(tx)
464430 func verify () = {
465431 let targetPublicKey = match managerPublicKeyOrUnit() {
466432 case pk: ByteVector =>
467433 pk
468434 case _: Unit =>
469435 tx.senderPublicKey
470436 case _ =>
471437 throw("Match error")
472438 }
473439 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
474440 }
475441

github/deemru/w8io/169f3d6 
112.32 ms