tx · HbEhwsUffK8u5rpiqUdyj23U3kGXSTNmqRLHL3Y89GGb 3MriZGLhQEu1jMDKDAbnsbh6TZuZueBAHSY: -0.05000000 Waves 2021.03.16 10:45 [1439975] smart account 3MriZGLhQEu1jMDKDAbnsbh6TZuZueBAHSY > SELF 0.00000000 Waves
{ "type": 13, "id": "HbEhwsUffK8u5rpiqUdyj23U3kGXSTNmqRLHL3Y89GGb", "fee": 5000000, "feeAssetId": null, "timestamp": 1615880700424, "version": 2, "chainId": 84, "sender": "3MriZGLhQEu1jMDKDAbnsbh6TZuZueBAHSY", "senderPublicKey": "3idTJAmqkivFDf1EUKZ85Tt43Rp22pZb3RDiVXTWrgBq", "proofs": [ "66bYN9rHJtkssMk8LtPJdmkk3Foia6XoN5aDkpXqHMkRvK6LkWayLfkUCwQ7NqvR7u9iJA3fBjDHcmSiPaTwto6G" ], "script": "base64:AAIEAAAAAAAAAAsIAhIDCgEIEgASAAAAAAoAAAAAEXRhc2tTdGF0dXNEZWZhdWx0AgAAAAppbmNvbXBsZXRlAAAAABJ0YXNrU3RhdHVzQ29tcGxldGUCAAAACGNvbXBsZXRlAAAAAAxhZGRyQ29udHJhY3QJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVQeulVTb30gIatILq7oKevTQfmT23BHXzEAAAAADGFzc2V0V2F2ZXNJZAUAAAAEdW5pdAAAAAASYXNzZXROZnRJbml0QW1vdW50AAAAAAAAAAABAAAAABBhc3NldE5mdERlY2ltYWxzAAAAAAAAAAAAAAAAABJhc3NldE5mdFJlaXNzdWFibGUHAAAAABdhc3NldEFtb3VudE1pblRocmVzaG9sZAAAAAAAAAAD6AAAAAASZGVjaW1hbHNBc3NldFdhdmVzAAAAAAAAAAAIAAAAAA9sYWJlbFRhc2tJZExhc3QCAAAACnRhc2tJZExhc3QAAAADAAAAAWkBAAAAB3NldFRhc2sAAAABAAAACHRhc2tOYW1lBAAAAAp0YXNrTGFzdElkAwkBAAAACWlzRGVmaW5lZAAAAAEJAAQa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bGxlcgUAAAAWaW50QXNzZXRPdXRwdXRJZEFtb3VudAUAAAAMYXNzZXRXYXZlc0lkCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAAD2xhYmVsVGFza0Ftb3VudAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAA9sYWJlbFRhc2tTdGF0dXMJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAANbGFiZWxUYXNrTmFtZQUAAAADbmlsAwkAAAAAAAACBQAAABJ0YXNrU3RhdHVzQ29tcGxldGUFAAAACnRhc2tTdGF0dXMJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAPbGFiZWxUYXNrQW1vdW50CQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAAD2xhYmVsVGFza1N0YXR1cwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAA1sYWJlbFRhc2tOYW1lBQAAAANuaWwJAAACAAAAAQIAAAAZVGFzayBoYXZlIGEgYnJva2VuIHN0YXR1cwkAAAIAAAABAgAAAB5BdHRhY2hlZCBhc3NldCBpcyBub3QgZXhwZWN0ZWQAAAAAXRVUaQ==", "height": 1439975, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5b8jLEctJR1rknnbm34JeYmGnKJo26QytdtkkrzxTNfJ Next: Fo4v8L2EFybJBcdJxykFUA7JujeTyFWMEtnhx3aXFKN3 Diff:
Old | New | Differences | |
---|---|---|---|
29 | 29 | let assetName = ("task #" + toString(taskLastId)) | |
30 | 30 | let assetDescription = ("NFT-token of task manager from" + toString(this)) | |
31 | 31 | let intAssetinputIdAmount = i.payments[0].amount | |
32 | - | let | |
33 | - | let | |
34 | - | let labelTaskName = ("taskName_" + | |
35 | - | let labelTaskStatus = ("taskStatus_" + | |
36 | - | let labelTaskAmount = ("taskAmount_" + | |
32 | + | let nftIssue = Issue(assetName, assetDescription, assetNftInitAmount, assetNftDecimals, assetNftReissuable) | |
33 | + | let nftIssueId = toBase58String(calculateAssetId(nftIssue)) | |
34 | + | let labelTaskName = ("taskName_" + nftIssueId) | |
35 | + | let labelTaskStatus = ("taskStatus_" + nftIssueId) | |
36 | + | let labelTaskAmount = ("taskAmount_" + nftIssueId) | |
37 | 37 | if ((size(i.payments) > 1)) | |
38 | 38 | then throw("One attached assets expected") | |
39 | 39 | else if ((i.payments[0].assetId != assetWavesId)) | |
41 | 41 | else if (isDefined(getString(this, labelTaskName))) | |
42 | 42 | then throw("Task with a specified name is already exists") | |
43 | 43 | else if ((assetAmountMinThreshold > i.payments[0].amount)) | |
44 | - | then throw("amount must be greater than the minimum threshold: | |
44 | + | then throw((("amount must be greater than the minimum threshold: " + toString(assetAmountMinThreshold)) + " WAVES")) | |
45 | 45 | else if ((i.caller == addrContract)) | |
46 | 46 | then throw("method may not be called from the contract") | |
47 | - | else [StringEntry(labelTaskName, taskName), StringEntry(labelTaskStatus, taskStatusDefault), | |
47 | + | else [StringEntry(labelTaskName, taskName), StringEntry(labelTaskStatus, taskStatusDefault), nftIssue, ScriptTransfer(i.caller, assetNftInitAmount, fromBase58String(nftIssueId)), StringEntry(labelTaskStatus, taskStatusDefault), IntegerEntry(labelTaskAmount, intAssetinputIdAmount), IntegerEntry(labelTaskIdLast, taskLastId)] | |
48 | 48 | } | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | ||
52 | 52 | @Callable(i) | |
53 | 53 | func completeTask () = { | |
54 | - | let $ | |
55 | - | let assetInputAmount = $ | |
56 | - | let assetInputId = $ | |
54 | + | let $t024322524 = $Tuple2(i.payments[0].amount, value(i.payments[0].assetId)) | |
55 | + | let assetInputAmount = $t024322524._1 | |
56 | + | let assetInputId = $t024322524._2 | |
57 | 57 | let labelTaskStatus = ("taskStatus_" + toBase58String(assetInputId)) | |
58 | 58 | let labelTaskAmount = ("taskAmount_" + toBase58String(assetInputId)) | |
59 | 59 | let stringAssetInputId = toBase58String(value(i.payments[0].assetId)) | |
78 | 78 | ||
79 | 79 | @Callable(i) | |
80 | 80 | func removeTask () = { | |
81 | - | let $ | |
82 | - | let assetInputAmount = $ | |
83 | - | let assetInputId = $ | |
81 | + | let $t037313823 = $Tuple2(i.payments[0].amount, value(i.payments[0].assetId)) | |
82 | + | let assetInputAmount = $t037313823._1 | |
83 | + | let assetInputId = $t037313823._2 | |
84 | 84 | let labelTaskAmount = ("taskAmount_" + toBase58String(assetInputId)) | |
85 | 85 | let labelTaskStatus = ("taskStatus_" + toBase58String(assetInputId)) | |
86 | 86 | let labelTaskName = ("taskName_" + toBase58String(assetInputId)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let taskStatusDefault = "incomplete" | |
5 | 5 | ||
6 | 6 | let taskStatusComplete = "complete" | |
7 | 7 | ||
8 | 8 | let addrContract = Address(base58'3MriZGLhQEu1jMDKDAbnsbh6TZuZueBAHSY') | |
9 | 9 | ||
10 | 10 | let assetWavesId = unit | |
11 | 11 | ||
12 | 12 | let assetNftInitAmount = 1 | |
13 | 13 | ||
14 | 14 | let assetNftDecimals = 0 | |
15 | 15 | ||
16 | 16 | let assetNftReissuable = false | |
17 | 17 | ||
18 | 18 | let assetAmountMinThreshold = 1000 | |
19 | 19 | ||
20 | 20 | let decimalsAssetWaves = 8 | |
21 | 21 | ||
22 | 22 | let labelTaskIdLast = "taskIdLast" | |
23 | 23 | ||
24 | 24 | @Callable(i) | |
25 | 25 | func setTask (taskName) = { | |
26 | 26 | let taskLastId = if (isDefined(getInteger(this, labelTaskIdLast))) | |
27 | 27 | then (getIntegerValue(this, labelTaskIdLast) + 1) | |
28 | 28 | else 1 | |
29 | 29 | let assetName = ("task #" + toString(taskLastId)) | |
30 | 30 | let assetDescription = ("NFT-token of task manager from" + toString(this)) | |
31 | 31 | let intAssetinputIdAmount = i.payments[0].amount | |
32 | - | let | |
33 | - | let | |
34 | - | let labelTaskName = ("taskName_" + | |
35 | - | let labelTaskStatus = ("taskStatus_" + | |
36 | - | let labelTaskAmount = ("taskAmount_" + | |
32 | + | let nftIssue = Issue(assetName, assetDescription, assetNftInitAmount, assetNftDecimals, assetNftReissuable) | |
33 | + | let nftIssueId = toBase58String(calculateAssetId(nftIssue)) | |
34 | + | let labelTaskName = ("taskName_" + nftIssueId) | |
35 | + | let labelTaskStatus = ("taskStatus_" + nftIssueId) | |
36 | + | let labelTaskAmount = ("taskAmount_" + nftIssueId) | |
37 | 37 | if ((size(i.payments) > 1)) | |
38 | 38 | then throw("One attached assets expected") | |
39 | 39 | else if ((i.payments[0].assetId != assetWavesId)) | |
40 | 40 | then throw("must be attached asset: WAVES") | |
41 | 41 | else if (isDefined(getString(this, labelTaskName))) | |
42 | 42 | then throw("Task with a specified name is already exists") | |
43 | 43 | else if ((assetAmountMinThreshold > i.payments[0].amount)) | |
44 | - | then throw("amount must be greater than the minimum threshold: | |
44 | + | then throw((("amount must be greater than the minimum threshold: " + toString(assetAmountMinThreshold)) + " WAVES")) | |
45 | 45 | else if ((i.caller == addrContract)) | |
46 | 46 | then throw("method may not be called from the contract") | |
47 | - | else [StringEntry(labelTaskName, taskName), StringEntry(labelTaskStatus, taskStatusDefault), | |
47 | + | else [StringEntry(labelTaskName, taskName), StringEntry(labelTaskStatus, taskStatusDefault), nftIssue, ScriptTransfer(i.caller, assetNftInitAmount, fromBase58String(nftIssueId)), StringEntry(labelTaskStatus, taskStatusDefault), IntegerEntry(labelTaskAmount, intAssetinputIdAmount), IntegerEntry(labelTaskIdLast, taskLastId)] | |
48 | 48 | } | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | ||
52 | 52 | @Callable(i) | |
53 | 53 | func completeTask () = { | |
54 | - | let $ | |
55 | - | let assetInputAmount = $ | |
56 | - | let assetInputId = $ | |
54 | + | let $t024322524 = $Tuple2(i.payments[0].amount, value(i.payments[0].assetId)) | |
55 | + | let assetInputAmount = $t024322524._1 | |
56 | + | let assetInputId = $t024322524._2 | |
57 | 57 | let labelTaskStatus = ("taskStatus_" + toBase58String(assetInputId)) | |
58 | 58 | let labelTaskAmount = ("taskAmount_" + toBase58String(assetInputId)) | |
59 | 59 | let stringAssetInputId = toBase58String(value(i.payments[0].assetId)) | |
60 | 60 | let infoAssetInput = valueOrErrorMessage(assetInfo(value(i.payments[0].assetId)), (("Asset " + stringAssetInputId) + " doesn't exist")) | |
61 | 61 | let intAssetOutputIdAmount = getIntegerValue(this, labelTaskAmount) | |
62 | 62 | if ((size(i.payments) > 1)) | |
63 | 63 | then throw("One attached assets expected") | |
64 | 64 | else if ((i.caller == addrContract)) | |
65 | 65 | then throw("method may not be called from the contract") | |
66 | 66 | else if (if (if (if ((value(i.payments[0].amount) == assetNftInitAmount)) | |
67 | 67 | then (value(infoAssetInput.decimals) == assetNftDecimals) | |
68 | 68 | else false) | |
69 | 69 | then (value(infoAssetInput.reissuable) == assetNftReissuable) | |
70 | 70 | else false) | |
71 | 71 | then isDefined(getString(this, labelTaskStatus)) | |
72 | 72 | else false) | |
73 | 73 | then [StringEntry(labelTaskStatus, taskStatusComplete), Burn(assetInputId, assetInputAmount), ScriptTransfer(i.caller, intAssetOutputIdAmount, assetWavesId)] | |
74 | 74 | else throw("Attached asset is not expected") | |
75 | 75 | } | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | ||
79 | 79 | @Callable(i) | |
80 | 80 | func removeTask () = { | |
81 | - | let $ | |
82 | - | let assetInputAmount = $ | |
83 | - | let assetInputId = $ | |
81 | + | let $t037313823 = $Tuple2(i.payments[0].amount, value(i.payments[0].assetId)) | |
82 | + | let assetInputAmount = $t037313823._1 | |
83 | + | let assetInputId = $t037313823._2 | |
84 | 84 | let labelTaskAmount = ("taskAmount_" + toBase58String(assetInputId)) | |
85 | 85 | let labelTaskStatus = ("taskStatus_" + toBase58String(assetInputId)) | |
86 | 86 | let labelTaskName = ("taskName_" + toBase58String(assetInputId)) | |
87 | 87 | let stringAssetInputId = toBase58String(value(i.payments[0].assetId)) | |
88 | 88 | let infoAssetInput = valueOrErrorMessage(assetInfo(value(i.payments[0].assetId)), (("Asset " + stringAssetInputId) + " doesn't exist")) | |
89 | 89 | if ((size(i.payments) > 1)) | |
90 | 90 | then throw("One attached assets expected") | |
91 | 91 | else if ((i.caller == addrContract)) | |
92 | 92 | then throw("method may not be called from the contract") | |
93 | 93 | else if (if (if ((value(infoAssetInput.decimals) == assetNftDecimals)) | |
94 | 94 | then (value(infoAssetInput.reissuable) == assetNftReissuable) | |
95 | 95 | else false) | |
96 | 96 | then isDefined(getString(this, labelTaskStatus)) | |
97 | 97 | else false) | |
98 | 98 | then { | |
99 | 99 | let taskStatus = getString(this, labelTaskStatus) | |
100 | 100 | if (if ((taskStatus == taskStatusDefault)) | |
101 | 101 | then (value(i.payments[0].amount) == assetNftInitAmount) | |
102 | 102 | else false) | |
103 | 103 | then { | |
104 | 104 | let intAssetOutputIdAmount = pow(getIntegerValue(this, labelTaskAmount), 0, 1, 0, decimalsAssetWaves, DOWN) | |
105 | 105 | [Burn(assetInputId, assetInputAmount), ScriptTransfer(i.caller, intAssetOutputIdAmount, assetWavesId), DeleteEntry(labelTaskAmount), DeleteEntry(labelTaskStatus), DeleteEntry(labelTaskName)] | |
106 | 106 | } | |
107 | 107 | else if ((taskStatusComplete == taskStatus)) | |
108 | 108 | then [DeleteEntry(labelTaskAmount), DeleteEntry(labelTaskStatus), DeleteEntry(labelTaskName)] | |
109 | 109 | else throw("Task have a broken status") | |
110 | 110 | } | |
111 | 111 | else throw("Attached asset is not expected") | |
112 | 112 | } | |
113 | 113 | ||
114 | 114 |
github/deemru/w8io/026f985 33.76 ms ◑