tx · 6mJoi84NMtLPsVKujuiyDpB2TUDHx7qcAZE9KoSqQSZj

3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T:  -0.01500000 Waves

2023.04.24 13:30 [2548511] smart account 3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T > SELF 0.00000000 Waves

{ "type": 13, "id": "6mJoi84NMtLPsVKujuiyDpB2TUDHx7qcAZE9KoSqQSZj", "fee": 1500000, "feeAssetId": null, "timestamp": 1682332255891, "version": 2, "chainId": 84, "sender": "3N1Epwa6GQuTQr2K9WzeUcqSFCdERwuvL5T", "senderPublicKey": "7iXEgsFNsnbLZ3ca4tmz8jffnyxMu9keuBV6CuQPJLuA", "proofs": [ "4j94exFdT47GUX2w9i15kX8YXPmLnu9nSRbncmLqbs8S92YDaqX9C4UEKKpX2uspiufiQtM6EMGG2ckoT9XGra5h" ], "script": "base64:BgLdDAgCEg0KCwgICAgICAEIAQgBEgMKAQESBAoCCAgSBQoDCAgEEgQKAggIEgMKAQESAwoBARIECgIICBIECgIICBIDCgEIEgAiCXNlcGFyYXRvciIMa2V5RmVlQW1vdW50Ig5rZXlVc2RuQXNzZXRJZCIOa2V5RXBvY2hMZW5ndGgiEWtleUZpbmFsaXplUmV3YXJkIgxrZXlXeEFzc2V0SWQiFmtleUFzc2V0c1N0b3JlQ29udHJhY3QiE2tleVVzZXJQb29sQ29udHJhY3QiE2tleUVtaXNzaW9uQ29udHJhY3QiE2tleUJvb3N0aW5nQ29udHJhY3QiEmtleUZhY3RvcnlDb250cmFjdCIZa2V5Vm90aW5nRW1pc3Npb25Db250cmFjdCIMa2V5VGhyZXNob2xkIg9nZXRTdHJpbmdPckZhaWwiA2tleSIMZ2V0SW50T3JGYWlsIhBrZXlJbkxpc3RBc3NldElkIg1hbW91bnRBc3NldElkIgxwcmljZUFzc2V0SWQiD2tleVN1Z2dlc3RJbmRleCIOa2V5U3RhcnRIZWlnaHQiDHN1Z2dlc3RJbmRleCIPa2V5Vm90aW5nUmV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AQtTdHJpbmdFbnRyeQIJAQFJAAkA2AQBCQEFdmFsdWUBBQJhWQkAzAgCCQELRGVsZXRlRW50cnkBCQEBSgAFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECYmIBAmJjAAQCYmQEAVIJAQFRAAMJAAECBQFSAgpCeXRlVmVjdG9yBAFXBQFSBQFXAwkAAQIFAVICBFVuaXQIBQJiYg9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCYmIJYm9keUJ5dGVzCQCRAwIIBQJiYgZwcm9vZnMAAAUCYmQ2MC7v", "height": 2548511, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 71Ud8HWFhSJpMryN2zzM7x5MpCJM3L1n2uBZFScoB3wA Next: AbKzGgoyXD78oYVqqA8tzZ8HChnQzyoDg9V168np9vLL Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
1+{-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "__"
410410
411411
412412 @Callable(i)
413+func approve (amountAssetId,priceAssetId) = {
414+ let checkCaller = if ((i.caller == userPoolContract))
415+ then true
416+ else mustManager(i)
417+ if ((checkCaller == checkCaller))
418+ then {
419+ let res = [invoke(factoryContract, "setWxEmissionPoolLabel", [amountAssetId, priceAssetId], nil), invoke(votingEmissionContract, "create", [amountAssetId, priceAssetId], nil)]
420+ if ((res == res))
421+ then $Tuple2(nil, unit)
422+ else throw("Strict value is not equal to itself.")
423+ }
424+ else throw("Strict value is not equal to itself.")
425+ }
426+
427+
428+
429+@Callable(i)
413430 func setManager (pendingManagerPublicKey) = {
414431 let checkCaller = mustManager(i)
415432 if ((checkCaller == checkCaller))
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
1+{-# 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
7373 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
7474
7575
7676 let assetsStoreContract = addressFromStringValue(getStringOrFail(keyAssetsStoreContract))
7777
7878 let boostingContract = addressFromStringValue(getStringOrFail(keyBoostingContract))
7979
8080 let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract))
8181
8282 let factoryContract = addressFromStringValue(getStringOrFail(keyFactoryContract))
8383
8484 let userPoolContract = addressFromStringValue(getStringOrFail(keyUserPoolContract))
8585
8686 let votingEmissionContract = addressFromStringValue(getStringOrFail(keyVotingEmissionContract))
8787
8888 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
8989 case s: String =>
9090 fromBase58String(s)
9191 case _: Unit =>
9292 unit
9393 case _ =>
9494 throw("Match error")
9595 }
9696
9797
9898 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
9999 case s: String =>
100100 fromBase58String(s)
101101 case _: Unit =>
102102 unit
103103 case _ =>
104104 throw("Match error")
105105 }
106106
107107
108108 func isManager (i) = match managerPublicKeyOrUnit() {
109109 case pk: ByteVector =>
110110 (i.callerPublicKey == pk)
111111 case _: Unit =>
112112 (i.caller == this)
113113 case _ =>
114114 throw("Match error")
115115 }
116116
117117
118118 func mustManager (i) = if (isManager(i))
119119 then true
120120 else throw("permission denied")
121121
122122
123123 func asInt (val) = match val {
124124 case valInt: Int =>
125125 valInt
126126 case _ =>
127127 throw("failed to cast into Integer")
128128 }
129129
130130
131131 @Callable(i)
132132 func constructor (assetsStoreContractPrm,boostingContractPrm,emissionContractPrm,factoryContractPrm,userPoolContractPrm,votingEmissionContractPrm,feeAmountPrm,wxAssetIdPrm,votingDurationPrm,usdnAssetIdPrm,finalizeRewardPrm) = {
133133 let checks = [mustManager(i), if (isDefined(addressFromString(assetsStoreContractPrm)))
134134 then true
135135 else throw("Invalid asset_store contract address"), if (isDefined(addressFromString(boostingContractPrm)))
136136 then true
137137 else throw("Invalid boosting contract address"), if (isDefined(addressFromString(userPoolContractPrm)))
138138 then true
139139 else throw("Invalid user_pools contract address"), if (isDefined(addressFromString(emissionContractPrm)))
140140 then true
141141 else throw("Invalid emission contract address"), if (isDefined(addressFromString(factoryContractPrm)))
142142 then true
143143 else throw("Invalid factory contract address"), if ((feeAmountPrm >= 0))
144144 then true
145145 else throw("Invalid fee amount"), if ((votingDurationPrm > 0))
146146 then true
147147 else throw("Invalid voting duration"), if ((finalizeRewardPrm >= 0))
148148 then true
149149 else throw("Invalid finalize reward"), if (isDefined(assetInfo(fromBase58String(wxAssetIdPrm))))
150150 then true
151151 else throw("Invalid WX asset ID"), if (isDefined(assetInfo(fromBase58String(usdnAssetIdPrm))))
152152 then true
153153 else throw("Invalid USDN asset ID")]
154154 if ((checks == checks))
155155 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)
156156 else throw("Strict value is not equal to itself.")
157157 }
158158
159159
160160
161161 @Callable(i)
162162 func constructorV2 (threshold) = {
163163 let checks = [mustManager(i), if ((threshold > 0))
164164 then true
165165 else throw("invalid threshold")]
166166 if ((checks == checks))
167167 then $Tuple2([IntegerEntry(keyThreshold, threshold)], unit)
168168 else throw("Strict value is not equal to itself.")
169169 }
170170
171171
172172
173173 @Callable(i)
174174 func suggest (amountAssetId,priceAssetId) = {
175175 let pool = $Tuple2(amountAssetId, priceAssetId)
176176 let payment = value(i.payments[0])
177177 let checkAmountAsset = if ((amountAssetId == "WAVES"))
178178 then unit
179179 else {
180180 let info = valueOrErrorMessage(assetInfo(fromBase58String(amountAssetId)), "invalid amountAssetId ID")
181181 if ((info.scripted == false))
182182 then true
183183 else throw("asset is smart")
184184 }
185185 if ((checkAmountAsset == checkAmountAsset))
186186 then {
187187 let checks = [if ((toBase58String(value(payment.assetId)) == value(getString(keyWxAssetId))))
188188 then true
189189 else throw("invalid fee asset"), if ((payment.amount == value(getInteger(keyFeeAmount))))
190190 then true
191191 else throw("invalid fee amount"), if ((getInteger(keyInListAssetId(amountAssetId, priceAssetId)) == unit))
192192 then true
193193 else throw("already in voting list"), if (!(valueOrElse(getBoolean(votingEmissionContract, keyInList(pool)), false)))
194194 then true
195195 else throw("pool is in emission voting list")]
196196 if ((checks == checks))
197197 then {
198198 let ensureActive = match invoke(userPoolContract, "statusREADONLY", [amountAssetId, priceAssetId], nil) {
199199 case s: String =>
200200 if ((s == "active"))
201201 then true
202202 else throw("user pool is not active")
203203 case _ =>
204204 throw("user pool is not active")
205205 }
206206 if ((ensureActive == ensureActive))
207207 then {
208208 let ensureAmountAssetVerified = if (isManager(i))
209209 then unit
210210 else {
211211 let inv = match invoke(assetsStoreContract, "isVerifiedREADONLY", [amountAssetId], nil) {
212212 case b: Boolean =>
213213 if (b)
214214 then true
215215 else throw("asset is not verified")
216216 case _ =>
217217 throw("asset is not verified")
218218 }
219219 if ((inv == inv))
220220 then unit
221221 else throw("Strict value is not equal to itself.")
222222 }
223223 if ((ensureAmountAssetVerified == ensureAmountAssetVerified))
224224 then {
225225 let burnFeeInv = invoke(emissionContract, "burn", nil, [AttachedPayment(payment.assetId, payment.amount)])
226226 if ((burnFeeInv == burnFeeInv))
227227 then {
228228 let newSuggestIndex = match getInteger(keySuggestIndex(amountAssetId, priceAssetId)) {
229229 case int: Int =>
230230 (int + 1)
231231 case _ =>
232232 0
233233 }
234234 $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)
235235 }
236236 else throw("Strict value is not equal to itself.")
237237 }
238238 else throw("Strict value is not equal to itself.")
239239 }
240240 else throw("Strict value is not equal to itself.")
241241 }
242242 else throw("Strict value is not equal to itself.")
243243 }
244244 else throw("Strict value is not equal to itself.")
245245 }
246246
247247
248248
249249 @Callable(i)
250250 func vote (amountAssetId,priceAssetId,inFavor) = {
251251 let suggestIndex = value(getInteger(keyInListAssetId(amountAssetId, priceAssetId)))
252252 let votingFinishHeight = (value(getInteger(keyStartHeight(amountAssetId, priceAssetId, suggestIndex))) + value(getInteger(keyEpochLength)))
253253 let checks = [if (isDefined(getInteger(keyInListAssetId(amountAssetId, priceAssetId))))
254254 then true
255255 else throw("the token isn't on the voting list"), if ((votingFinishHeight > height))
256256 then true
257257 else throw("too late to vote")]
258258 if ((checks == checks))
259259 then {
260260 let gwxAmount = invoke(boostingContract, "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), votingFinishHeight], nil)
261261 let notZero = if ((asInt(gwxAmount) > 0))
262262 then true
263263 else throw("you don't have gwx")
264264 if ((notZero == notZero))
265265 then {
266266 let vote = match getString(keyVote(amountAssetId, priceAssetId, suggestIndex, toString(i.caller))) {
267267 case s: String =>
268268 let vote = split(s, separator)
269269 let voteValue = vote[1]
270270 let voteType = vote[2]
271271 let isVoteTypeSimilar = if (if ((voteType == "yes"))
272272 then (inFavor == true)
273273 else false)
274274 then true
275275 else if ((voteType == "no"))
276276 then (inFavor == false)
277277 else false
278278 let isVoteValueSimilar = if (isVoteTypeSimilar)
279279 then (asInt(gwxAmount) == parseIntValue(voteValue))
280280 else false
281281 let isNewVoteSimilar = if (if (isVoteTypeSimilar)
282282 then isVoteValueSimilar
283283 else false)
284284 then throw("you already voted")
285285 else invoke(this, "cancelVote", [amountAssetId, priceAssetId], nil)
286286 isNewVoteSimilar
287287 case u: Unit =>
288288 u
289289 case _ =>
290290 throw("Match error")
291291 }
292292 if ((vote == vote))
293293 then {
294294 let votingResult = split(value(getString(keyVotingResult(amountAssetId, priceAssetId, suggestIndex))), separator)
295295 let positiveVotes = votingResult[1]
296296 let negativeVotes = votingResult[2]
297297 let newPositiveAndNegativeVotes = if (inFavor)
298298 then {
299299 let newPositiveVotes = (parseIntValue(positiveVotes) + asInt(gwxAmount))
300300 [toString(newPositiveVotes), negativeVotes]
301301 }
302302 else {
303303 let newNegativeVotes = (parseIntValue(negativeVotes) + asInt(gwxAmount))
304304 [positiveVotes, toString(newNegativeVotes)]
305305 }
306306 let voteKey = keyVote(amountAssetId, priceAssetId, suggestIndex, toString(i.caller))
307307 let voteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor)
308308 $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId, suggestIndex), totalVotes(newPositiveAndNegativeVotes[0], newPositiveAndNegativeVotes[1])), StringEntry(voteKey, voteValue)], unit)
309309 }
310310 else throw("Strict value is not equal to itself.")
311311 }
312312 else throw("Strict value is not equal to itself.")
313313 }
314314 else throw("Strict value is not equal to itself.")
315315 }
316316
317317
318318
319319 @Callable(i)
320320 func cancelVote (amountAssetId,priceAssetId) = {
321321 let userAddress = if ((i.caller == this))
322322 then toString(i.originCaller)
323323 else toString(i.caller)
324324 let suggestIndex = value(getInteger(keyInListAssetId(amountAssetId, priceAssetId)))
325325 let checks = [if (isDefined(getString(keyVotingResult(amountAssetId, priceAssetId, suggestIndex))))
326326 then true
327327 else throw("no vote for assets pair")]
328328 if ((checks == checks))
329329 then {
330330 let vote = split(value(getString(keyVote(amountAssetId, priceAssetId, suggestIndex, userAddress))), separator)
331331 let voteValue = vote[1]
332332 let voteType = vote[2]
333333 let votingResult = split(value(getString(keyVotingResult(amountAssetId, priceAssetId, suggestIndex))), separator)
334334 let positiveVotes = votingResult[1]
335335 let negativeVotes = votingResult[2]
336336 let actions = if ((voteType == "yes"))
337337 then {
338338 let newPositiveVotes = (parseIntValue(positiveVotes) - parseIntValue(voteValue))
339339 $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId, suggestIndex), totalVotes(toString(newPositiveVotes), negativeVotes)), DeleteEntry(keyVote(amountAssetId, priceAssetId, suggestIndex, userAddress))], unit)
340340 }
341341 else {
342342 let newNegativeVotes = (parseIntValue(negativeVotes) - parseIntValue(voteValue))
343343 $Tuple2([StringEntry(keyVotingResult(amountAssetId, priceAssetId, suggestIndex), totalVotes(positiveVotes, toString(newNegativeVotes))), DeleteEntry(keyVote(amountAssetId, priceAssetId, suggestIndex, userAddress))], unit)
344344 }
345345 actions
346346 }
347347 else throw("Strict value is not equal to itself.")
348348 }
349349
350350
351351
352352 @Callable(i)
353353 func setFee (newFee) = {
354354 let checks = [mustManager(i)]
355355 if ((checks == checks))
356356 then [IntegerEntry(keyFeeAmount, newFee)]
357357 else throw("Strict value is not equal to itself.")
358358 }
359359
360360
361361
362362 @Callable(i)
363363 func setThreshold (newThreshold) = {
364364 let checks = [mustManager(i), if ((newThreshold > 0))
365365 then true
366366 else throw("invalid threshold")]
367367 if ((checks == checks))
368368 then $Tuple2([IntegerEntry(keyThreshold, newThreshold)], unit)
369369 else throw("Strict value is not equal to itself.")
370370 }
371371
372372
373373
374374 @Callable(i)
375375 func finalize (amountAssetId,priceAssetId) = {
376376 let suggestIndex = value(getInteger(keyInListAssetId(amountAssetId, priceAssetId)))
377377 let votingFinishHeight = (value(getInteger(keyStartHeight(amountAssetId, priceAssetId, suggestIndex))) + value(getInteger(keyEpochLength)))
378378 let checks = [if (isDefined(getInteger(keyInListAssetId(amountAssetId, priceAssetId))))
379379 then true
380380 else throw("no assets pair"), if ((height >= votingFinishHeight))
381381 then true
382382 else throw("insufficient height for completion")]
383383 if ((checks == checks))
384384 then {
385385 let votingResult = split(value(getString(keyVotingResult(amountAssetId, priceAssetId, suggestIndex))), separator)
386386 let positiveVotes = parseIntValue(votingResult[1])
387387 let negativeVotes = parseIntValue(votingResult[2])
388388 let allVotes = (positiveVotes + negativeVotes)
389389 let threshold = getIntOrFail(keyThreshold)
390390 let actions = if (if ((allVotes >= threshold))
391391 then (positiveVotes > negativeVotes)
392392 else false)
393393 then {
394394 let res = invoke(factoryContract, "setWxEmissionPoolLabel", [amountAssetId, priceAssetId], nil)
395395 if ((res == res))
396396 then {
397397 let votingEmissionInv = invoke(votingEmissionContract, "create", [amountAssetId, priceAssetId], nil)
398398 if ((votingEmissionInv == votingEmissionInv))
399399 then $Tuple2([DeleteEntry(keyInListAssetId(amountAssetId, priceAssetId))], unit)
400400 else throw("Strict value is not equal to itself.")
401401 }
402402 else throw("Strict value is not equal to itself.")
403403 }
404404 else $Tuple2([DeleteEntry(keyInListAssetId(amountAssetId, priceAssetId))], unit)
405405 actions
406406 }
407407 else throw("Strict value is not equal to itself.")
408408 }
409409
410410
411411
412412 @Callable(i)
413+func approve (amountAssetId,priceAssetId) = {
414+ let checkCaller = if ((i.caller == userPoolContract))
415+ then true
416+ else mustManager(i)
417+ if ((checkCaller == checkCaller))
418+ then {
419+ let res = [invoke(factoryContract, "setWxEmissionPoolLabel", [amountAssetId, priceAssetId], nil), invoke(votingEmissionContract, "create", [amountAssetId, priceAssetId], nil)]
420+ if ((res == res))
421+ then $Tuple2(nil, unit)
422+ else throw("Strict value is not equal to itself.")
423+ }
424+ else throw("Strict value is not equal to itself.")
425+ }
426+
427+
428+
429+@Callable(i)
413430 func setManager (pendingManagerPublicKey) = {
414431 let checkCaller = mustManager(i)
415432 if ((checkCaller == checkCaller))
416433 then {
417434 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
418435 if ((checkManagerPublicKey == checkManagerPublicKey))
419436 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
420437 else throw("Strict value is not equal to itself.")
421438 }
422439 else throw("Strict value is not equal to itself.")
423440 }
424441
425442
426443
427444 @Callable(i)
428445 func confirmManager () = {
429446 let pm = pendingManagerPublicKeyOrUnit()
430447 let hasPM = if (isDefined(pm))
431448 then true
432449 else throw("no pending manager")
433450 if ((hasPM == hasPM))
434451 then {
435452 let checkPM = if ((i.callerPublicKey == value(pm)))
436453 then true
437454 else throw("you are not pending manager")
438455 if ((checkPM == checkPM))
439456 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
440457 else throw("Strict value is not equal to itself.")
441458 }
442459 else throw("Strict value is not equal to itself.")
443460 }
444461
445462
446463 @Verifier(tx)
447464 func verify () = {
448465 let targetPublicKey = match managerPublicKeyOrUnit() {
449466 case pk: ByteVector =>
450467 pk
451468 case _: Unit =>
452469 tx.senderPublicKey
453470 case _ =>
454471 throw("Match error")
455472 }
456473 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
457474 }
458475

github/deemru/w8io/169f3d6 
53.32 ms