tx · FXnNxieuFemMQfuYW2JFe6qW1fhrKtFDxt5Rk5JLsihS

3MriZGLhQEu1jMDKDAbnsbh6TZuZueBAHSY:  -0.05000000 Waves

2021.03.17 17:40 [1441862] smart account 3MriZGLhQEu1jMDKDAbnsbh6TZuZueBAHSY > SELF 0.00000000 Waves

{ "type": 13, "id": "FXnNxieuFemMQfuYW2JFe6qW1fhrKtFDxt5Rk5JLsihS", "fee": 5000000, "feeAssetId": null, "timestamp": 1615991996607, "version": 2, "chainId": 84, "sender": "3MriZGLhQEu1jMDKDAbnsbh6TZuZueBAHSY", "senderPublicKey": "3idTJAmqkivFDf1EUKZ85Tt43Rp22pZb3RDiVXTWrgBq", "proofs": [ "ZKK19AxdeCzdZUMAmTKKRbGRFLDqo6uAqR4sU84tQo6wvBN7KPTfWzEdzDWMu8WQC5bCQNWYwL2xePMVExwZs7j" ], "script": "base64:AAIEAAAAAAAAAAsIAhIDCgEIEgASAAAAAAkAAAAAEXRhc2tTdGF0dXNEZWZhdWx0AgAAAAppbmNvbXBsZXRlAAAAABJ0YXNrU3RhdHVzQ29tcGxldGUCAAAACGNvbXBsZXRlAAAAAAd3YXZlc0lkBQAAAAR1bml0AAAAABJhc3NldE5mdEluaXRBbW91bnQAAAAAAAAAAAEAAAAAEGFzc2V0TmZ0RGVjaW1hbHMAAAAAAAAAAAAAAAAAEmFzc2V0TmZ0UmVpc3N1YWJsZQcAAAAAF2Fzc2V0QW1vdW50TWluVGhyZXNob2xkAAAAAAAAAAPoAAAAABJkZWNpbWFsc0Fzc2V0V2F2ZXMAAAAAAAAAAAgAAAAAD2xhYmVsVGFza0lkTGFzdAIAAAAKdGFza0lkTGFzdAAAAAMAAAABaQEAAAAHc2V0VGFzawAAAAEAAAAIdGFza05hbWUEAAAACnRhc2tMYXN0SWQDCQEAAAAJaXNEZWZpbmVkAAAAAQkABBoAAAACBQAAAAR0aGlzBQAAAA9sYWJlbFRhc2tJZExhc3QJAABkAAAAAgkBAAAAEUBleHRyTmF0a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XRPdXRwdXRJZEFtb3VudAUAAAAHd2F2ZXNJZAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAA9sYWJlbFRhc2tBbW91bnQJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAPbGFiZWxUYXNrU3RhdHVzCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAADWxhYmVsVGFza05hbWUFAAAAA25pbAMJAAAAAAAAAgUAAAAKdGFza1N0YXR1cwUAAAASdGFza1N0YXR1c0NvbXBsZXRlCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAAD2xhYmVsVGFza0Ftb3VudAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAA9sYWJlbFRhc2tTdGF0dXMJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAANbGFiZWxUYXNrTmFtZQUAAAADbmlsCQAAAgAAAAECAAAAGVRhc2sgaGF2ZSBhIGJyb2tlbiBzdGF0dXMJAAACAAAAAQIAAAAeQXR0YWNoZWQgYXNzZXQgaXMgbm90IGV4cGVjdGVkAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXlk7+Ap", "height": 1441862, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Fo4v8L2EFybJBcdJxykFUA7JujeTyFWMEtnhx3aXFKN3 Next: none Diff:
OldNewDifferences
2626 else 1
2727 let assetName = ("task #" + toString(taskLastId))
2828 let assetDescription = ("NFT-token of task manager from" + toString(this))
29- let lockAmount = i.payments[0].amount
29+ let pmtAmount = i.payments[0].amount
3030 let nftIssue = Issue(assetName, assetDescription, assetNftInitAmount, assetNftDecimals, assetNftReissuable)
3131 let nftIssueId = toBase58String(calculateAssetId(nftIssue))
3232 let labelTaskName = ("taskName_" + nftIssueId)
4040 then throw((("amount must be greater than the minimum threshold: " + toString(assetAmountMinThreshold)) + " WAVES"))
4141 else if ((i.caller == this))
4242 then throw("method may not be called from the contract")
43- else [StringEntry(labelTaskName, taskName), StringEntry(labelTaskStatus, taskStatusDefault), nftIssue, ScriptTransfer(i.caller, assetNftInitAmount, fromBase58String(nftIssueId)), IntegerEntry(labelTaskAmount, lockAmount), IntegerEntry(labelTaskIdLast, taskLastId)]
43+ else [StringEntry(labelTaskName, taskName), StringEntry(labelTaskStatus, taskStatusDefault), nftIssue, ScriptTransfer(i.caller, assetNftInitAmount, fromBase58String(nftIssueId)), IntegerEntry(labelTaskAmount, pmtAmount), IntegerEntry(labelTaskIdLast, taskLastId)]
4444 }
4545
4646
4747
4848 @Callable(i)
4949 func completeTask () = {
50- let $t019422068 = $Tuple2(i.payments[0].amount, valueOrErrorMessage(i.payments[0].assetId, "Attached asset is not expected"))
51- let lockAmount = $t019422068._1
52- let lockId = $t019422068._2
53- let labelTaskStatus = ("taskStatus_" + toBase58String(lockId))
54- let labelTaskAmount = ("taskAmount_" + toBase58String(lockId))
55- let stringLockId = toBase58String(value(i.payments[0].assetId))
56- let infoLock = valueOrErrorMessage(assetInfo(value(i.payments[0].assetId)), (("Asset " + stringLockId) + " doesn't exist"))
50+ let $t019402064 = $Tuple2(i.payments[0].amount, valueOrErrorMessage(i.payments[0].assetId, "Attached asset is not expected"))
51+ let pmtAmount = $t019402064._1
52+ let pmtId = $t019402064._2
53+ let labelTaskStatus = ("taskStatus_" + toBase58String(pmtId))
54+ let labelTaskAmount = ("taskAmount_" + toBase58String(pmtId))
55+ let stringPmtId = toBase58String(value(i.payments[0].assetId))
56+ let infoPmt = valueOrErrorMessage(assetInfo(value(i.payments[0].assetId)), (("Asset " + stringPmtId) + " doesn't exist"))
5757 let intAssetOutputIdAmount = getIntegerValue(this, labelTaskAmount)
5858 if ((size(i.payments) != 1))
5959 then throw("One attached assets expected")
6161 then throw("method may not be called from the contract")
6262 else if (!(isDefined(getString(this, labelTaskStatus))))
6363 then throw("Attached asset is not expected")
64- else [StringEntry(labelTaskStatus, taskStatusComplete), Burn(lockId, lockAmount), ScriptTransfer(i.caller, intAssetOutputIdAmount, wavesId)]
64+ else [StringEntry(labelTaskStatus, taskStatusComplete), Burn(pmtId, pmtAmount), ScriptTransfer(i.caller, intAssetOutputIdAmount, wavesId)]
6565 }
6666
6767
6868
6969 @Callable(i)
7070 func removeTask () = {
71- let $t030373148 = $Tuple2(i.payments[0].amount, value(i.payments[0].assetId))
72- let lockAmount = $t030373148._1
73- let lockId = $t030373148._2
74- let labelTaskAmount = ("taskAmount_" + toBase58String(lockId))
75- let labelTaskStatus = ("taskStatus_" + toBase58String(lockId))
76- let labelTaskName = ("taskName_" + toBase58String(lockId))
77- let stringLockId = toBase58String(value(i.payments[0].assetId))
78- let infoLock = valueOrErrorMessage(assetInfo(value(i.payments[0].assetId)), (("Asset " + stringLockId) + " doesn't exist"))
71+ let $t030213130 = $Tuple2(i.payments[0].amount, value(i.payments[0].assetId))
72+ let pmtAmount = $t030213130._1
73+ let pmtId = $t030213130._2
74+ let labelTaskAmount = ("taskAmount_" + toBase58String(pmtId))
75+ let labelTaskStatus = ("taskStatus_" + toBase58String(pmtId))
76+ let labelTaskName = ("taskName_" + toBase58String(pmtId))
77+ let stringPmtId = toBase58String(value(i.payments[0].assetId))
78+ let infoPmt = valueOrErrorMessage(assetInfo(value(i.payments[0].assetId)), (("Asset " + stringPmtId) + " doesn't exist"))
7979 if ((size(i.payments) != 1))
8080 then throw("One attached assets expected")
8181 else if ((i.caller == this))
8888 else false)
8989 then {
9090 let intAssetOutputIdAmount = (getIntegerValue(this, labelTaskAmount) / 2)
91-[Burn(lockId, lockAmount), ScriptTransfer(i.caller, intAssetOutputIdAmount, wavesId), DeleteEntry(labelTaskAmount), DeleteEntry(labelTaskStatus), DeleteEntry(labelTaskName)]
91+[Burn(pmtId, pmtAmount), ScriptTransfer(i.caller, intAssetOutputIdAmount, wavesId), DeleteEntry(labelTaskAmount), DeleteEntry(labelTaskStatus), DeleteEntry(labelTaskName)]
9292 }
9393 else if ((taskStatus == taskStatusComplete))
9494 then [DeleteEntry(labelTaskAmount), DeleteEntry(labelTaskStatus), DeleteEntry(labelTaskName)]
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let taskStatusDefault = "incomplete"
55
66 let taskStatusComplete = "complete"
77
88 let wavesId = unit
99
1010 let assetNftInitAmount = 1
1111
1212 let assetNftDecimals = 0
1313
1414 let assetNftReissuable = false
1515
1616 let assetAmountMinThreshold = 1000
1717
1818 let decimalsAssetWaves = 8
1919
2020 let labelTaskIdLast = "taskIdLast"
2121
2222 @Callable(i)
2323 func setTask (taskName) = {
2424 let taskLastId = if (isDefined(getInteger(this, labelTaskIdLast)))
2525 then (getIntegerValue(this, labelTaskIdLast) + 1)
2626 else 1
2727 let assetName = ("task #" + toString(taskLastId))
2828 let assetDescription = ("NFT-token of task manager from" + toString(this))
29- let lockAmount = i.payments[0].amount
29+ let pmtAmount = i.payments[0].amount
3030 let nftIssue = Issue(assetName, assetDescription, assetNftInitAmount, assetNftDecimals, assetNftReissuable)
3131 let nftIssueId = toBase58String(calculateAssetId(nftIssue))
3232 let labelTaskName = ("taskName_" + nftIssueId)
3333 let labelTaskStatus = ("taskStatus_" + nftIssueId)
3434 let labelTaskAmount = ("taskAmount_" + nftIssueId)
3535 if ((size(i.payments) != 1))
3636 then throw("One attached assets expected")
3737 else if ((i.payments[0].assetId != wavesId))
3838 then throw("must be attached asset: WAVES")
3939 else if ((assetAmountMinThreshold > i.payments[0].amount))
4040 then throw((("amount must be greater than the minimum threshold: " + toString(assetAmountMinThreshold)) + " WAVES"))
4141 else if ((i.caller == this))
4242 then throw("method may not be called from the contract")
43- else [StringEntry(labelTaskName, taskName), StringEntry(labelTaskStatus, taskStatusDefault), nftIssue, ScriptTransfer(i.caller, assetNftInitAmount, fromBase58String(nftIssueId)), IntegerEntry(labelTaskAmount, lockAmount), IntegerEntry(labelTaskIdLast, taskLastId)]
43+ else [StringEntry(labelTaskName, taskName), StringEntry(labelTaskStatus, taskStatusDefault), nftIssue, ScriptTransfer(i.caller, assetNftInitAmount, fromBase58String(nftIssueId)), IntegerEntry(labelTaskAmount, pmtAmount), IntegerEntry(labelTaskIdLast, taskLastId)]
4444 }
4545
4646
4747
4848 @Callable(i)
4949 func completeTask () = {
50- let $t019422068 = $Tuple2(i.payments[0].amount, valueOrErrorMessage(i.payments[0].assetId, "Attached asset is not expected"))
51- let lockAmount = $t019422068._1
52- let lockId = $t019422068._2
53- let labelTaskStatus = ("taskStatus_" + toBase58String(lockId))
54- let labelTaskAmount = ("taskAmount_" + toBase58String(lockId))
55- let stringLockId = toBase58String(value(i.payments[0].assetId))
56- let infoLock = valueOrErrorMessage(assetInfo(value(i.payments[0].assetId)), (("Asset " + stringLockId) + " doesn't exist"))
50+ let $t019402064 = $Tuple2(i.payments[0].amount, valueOrErrorMessage(i.payments[0].assetId, "Attached asset is not expected"))
51+ let pmtAmount = $t019402064._1
52+ let pmtId = $t019402064._2
53+ let labelTaskStatus = ("taskStatus_" + toBase58String(pmtId))
54+ let labelTaskAmount = ("taskAmount_" + toBase58String(pmtId))
55+ let stringPmtId = toBase58String(value(i.payments[0].assetId))
56+ let infoPmt = valueOrErrorMessage(assetInfo(value(i.payments[0].assetId)), (("Asset " + stringPmtId) + " doesn't exist"))
5757 let intAssetOutputIdAmount = getIntegerValue(this, labelTaskAmount)
5858 if ((size(i.payments) != 1))
5959 then throw("One attached assets expected")
6060 else if ((i.caller == this))
6161 then throw("method may not be called from the contract")
6262 else if (!(isDefined(getString(this, labelTaskStatus))))
6363 then throw("Attached asset is not expected")
64- else [StringEntry(labelTaskStatus, taskStatusComplete), Burn(lockId, lockAmount), ScriptTransfer(i.caller, intAssetOutputIdAmount, wavesId)]
64+ else [StringEntry(labelTaskStatus, taskStatusComplete), Burn(pmtId, pmtAmount), ScriptTransfer(i.caller, intAssetOutputIdAmount, wavesId)]
6565 }
6666
6767
6868
6969 @Callable(i)
7070 func removeTask () = {
71- let $t030373148 = $Tuple2(i.payments[0].amount, value(i.payments[0].assetId))
72- let lockAmount = $t030373148._1
73- let lockId = $t030373148._2
74- let labelTaskAmount = ("taskAmount_" + toBase58String(lockId))
75- let labelTaskStatus = ("taskStatus_" + toBase58String(lockId))
76- let labelTaskName = ("taskName_" + toBase58String(lockId))
77- let stringLockId = toBase58String(value(i.payments[0].assetId))
78- let infoLock = valueOrErrorMessage(assetInfo(value(i.payments[0].assetId)), (("Asset " + stringLockId) + " doesn't exist"))
71+ let $t030213130 = $Tuple2(i.payments[0].amount, value(i.payments[0].assetId))
72+ let pmtAmount = $t030213130._1
73+ let pmtId = $t030213130._2
74+ let labelTaskAmount = ("taskAmount_" + toBase58String(pmtId))
75+ let labelTaskStatus = ("taskStatus_" + toBase58String(pmtId))
76+ let labelTaskName = ("taskName_" + toBase58String(pmtId))
77+ let stringPmtId = toBase58String(value(i.payments[0].assetId))
78+ let infoPmt = valueOrErrorMessage(assetInfo(value(i.payments[0].assetId)), (("Asset " + stringPmtId) + " doesn't exist"))
7979 if ((size(i.payments) != 1))
8080 then throw("One attached assets expected")
8181 else if ((i.caller == this))
8282 then throw("method may not be called from the contract")
8383 else if (isDefined(getString(this, labelTaskStatus)))
8484 then {
8585 let taskStatus = getString(this, labelTaskStatus)
8686 if (if ((taskStatus == taskStatusDefault))
8787 then (value(i.payments[0].amount) == assetNftInitAmount)
8888 else false)
8989 then {
9090 let intAssetOutputIdAmount = (getIntegerValue(this, labelTaskAmount) / 2)
91-[Burn(lockId, lockAmount), ScriptTransfer(i.caller, intAssetOutputIdAmount, wavesId), DeleteEntry(labelTaskAmount), DeleteEntry(labelTaskStatus), DeleteEntry(labelTaskName)]
91+[Burn(pmtId, pmtAmount), ScriptTransfer(i.caller, intAssetOutputIdAmount, wavesId), DeleteEntry(labelTaskAmount), DeleteEntry(labelTaskStatus), DeleteEntry(labelTaskName)]
9292 }
9393 else if ((taskStatus == taskStatusComplete))
9494 then [DeleteEntry(labelTaskAmount), DeleteEntry(labelTaskStatus), DeleteEntry(labelTaskName)]
9595 else throw("Task have a broken status")
9696 }
9797 else throw("Attached asset is not expected")
9898 }
9999
100100
101101 @Verifier(tx)
102102 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
103103

github/deemru/w8io/026f985 
32.57 ms