tx · 4BEKofSW3htD5skc4QeF1jTXyJKNHJCo4vz6c6mp8cen 3MxbD7vwyGjwsRxT8fmMB9fngo59VfHcrea: -0.00900000 Waves 2022.08.18 20:52 [2190245] smart account 3MxbD7vwyGjwsRxT8fmMB9fngo59VfHcrea > SELF 0.00000000 Waves
{ "type": 13, "id": "4BEKofSW3htD5skc4QeF1jTXyJKNHJCo4vz6c6mp8cen", "fee": 900000, "feeAssetId": null, "timestamp": 1660845169483, "version": 2, "chainId": 84, "sender": "3MxbD7vwyGjwsRxT8fmMB9fngo59VfHcrea", "senderPublicKey": "7kBiESqWjiW6nNeStcbrVX9XRQkWmUM51MZFRZNQEVfR", "proofs": [ "542JuEGnC6SyQSUHxNQu9z44YhT7SrJ3qNBQYzwxNXgHEtQV9nbHEtLKaXfQSwrueatBTG1MnrbGjCX8L7MBFeoR" ], "script": "base64:AAIFAAAAAAAAABMIAhIDCgEBEgMKAQgSAwoBCBIAAAAACAAAAAAFYWRtaW4BAAAAGgFUXs+afM6aBfaMotx14GtgBLCd6Mb2pgYvAAAAAAtjb2FsQXNzZXRJZAEAAAAgMeDV9UC3cemF7HoOb7evUrojvKZCHJ2aO5kl6ImGjuYBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAEAAAANdHJ5R2V0Qm9vbGVhbgAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGwAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAHQm9vbGVhbgQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgcBAAAADmdldEFzc2V0U3RyaW5nAAAAAQAAAAdhc3NldElkBAAAAAckbWF0Y2gwBQAAAAdhc3NldElkAwkAAAEAAAACBQAAAAckbWF0Y2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IbGFzdE1pbnQAAAAAAAAAAAAJAABmAAAAAgkAAGQAAAACBQAAAAhsYXN0TWludAAAAAAAAAAABQUAAAAGaGVpZ2h0BwkAAAIAAAABAgAAAClZb3UgbmVlZCB0byB3YWl0IDUgYmxvY2tzIGFmdGVyIGxhc3QgbWludAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAAlsYXN0TWludF8FAAAABmNhbGxlcgUAAAAGaGVpZ2h0CQAETAAAAAIJAQAAAAdSZWlzc3VlAAAAAwUAAAALY29hbEFzc2V0SWQAAAAAAAAAAAEGCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAAQUAAAALY29hbEFzc2V0SWQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V589FZxA==", "height": 2190245, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7XHfHoPk82SYhQ6iurqrFYbaBG7tXX2P5HWyFDRh2hEB Next: 4sxfrA26HCjTiS8nvLZm596VCGSzNukBUEzGvAPXbu5G Diff:
Old | New | Differences | |
---|---|---|---|
120 | 120 | } | |
121 | 121 | ||
122 | 122 | ||
123 | + | ||
124 | + | @Callable(i) | |
125 | + | func mintNazi () = { | |
126 | + | let caller = toBase58String(i.caller.bytes) | |
127 | + | let lastMint = tryGetInteger(("lastMint_" + caller)) | |
128 | + | if (if ((lastMint > 0)) | |
129 | + | then ((lastMint + 5) > height) | |
130 | + | else false) | |
131 | + | then throw("You need to wait 5 blocks after last mint") | |
132 | + | else [IntegerEntry(("lastMint_" + caller), height), Reissue(coalAssetId, 1, true), ScriptTransfer(i.caller, 1, coalAssetId)] | |
133 | + | } | |
134 | + | ||
135 | + | ||
123 | 136 | @Verifier(tx) | |
124 | 137 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
125 | 138 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let admin = base58'3MxZPzVdHQYNjp99N7VRuR4RLmJUqnDg9ok' | |
5 | 5 | ||
6 | 6 | let coalAssetId = base58'4MhpjsP1MPpC49v6zBr7eAAEPZdmHWcrSqcSv8tZcpjo' | |
7 | 7 | ||
8 | 8 | func tryGetInteger (key) = match getInteger(this, key) { | |
9 | 9 | case b: Int => | |
10 | 10 | b | |
11 | 11 | case _ => | |
12 | 12 | 0 | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func tryGetBoolean (key) = match getBoolean(this, key) { | |
17 | 17 | case b: Boolean => | |
18 | 18 | b | |
19 | 19 | case _ => | |
20 | 20 | false | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func getAssetString (assetId) = match assetId { | |
25 | 25 | case b: ByteVector => | |
26 | 26 | toBase58String(b) | |
27 | 27 | case _ => | |
28 | 28 | "WAVES" | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func tryGetString (key) = match getString(this, key) { | |
33 | 33 | case b: String => | |
34 | 34 | b | |
35 | 35 | case _ => | |
36 | 36 | "" | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func tryGetBinary (key) = match getBinary(this, key) { | |
41 | 41 | case b: ByteVector => | |
42 | 42 | b | |
43 | 43 | case _ => | |
44 | 44 | base58'' | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func getAssetBytes (assetIdStr) = if ((assetIdStr == "WAVES")) | |
49 | 49 | then unit | |
50 | 50 | else fromBase58String(assetIdStr) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | @Callable(i) | |
54 | 54 | func createFurnace (lifetime) = if ((toBase58String(i.caller.bytes) != toBase58String(admin))) | |
55 | 55 | then throw("You cannot create furnace") | |
56 | 56 | else if ((size(i.payments) != 1)) | |
57 | 57 | then throw("You should to provide reward") | |
58 | 58 | else { | |
59 | 59 | let rewardAmount = i.payments[0].amount | |
60 | 60 | let rewardAssetId = i.payments[0].assetId | |
61 | 61 | let newFurnacesAmount = (tryGetInteger("global_furnacesAmount") + 1) | |
62 | 62 | let furnaceId = toString(newFurnacesAmount) | |
63 | 63 | [IntegerEntry("global_furnacesAmount", newFurnacesAmount), IntegerEntry((("furnace_" + furnaceId) + "_lifetime"), lifetime), IntegerEntry((("furnace_" + furnaceId) + "_rewardAmount"), rewardAmount), StringEntry((("furnace_" + furnaceId) + "_rewardAssetId"), getAssetString(rewardAssetId))] | |
64 | 64 | } | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | ||
68 | 68 | @Callable(i) | |
69 | 69 | func burn (furnaceId) = { | |
70 | 70 | let isFinished = tryGetBoolean((("furnace_" + furnaceId) + "_finished")) | |
71 | 71 | let lifetime = tryGetInteger((("furnace_" + furnaceId) + "_lifetime")) | |
72 | 72 | let lastBurn = tryGetInteger((("furnace_" + furnaceId) + "_lastBurn")) | |
73 | 73 | let finisHeight = (lastBurn + lifetime) | |
74 | 74 | if (isFinished) | |
75 | 75 | then throw("Already finished") | |
76 | 76 | else if ((lifetime == 0)) | |
77 | 77 | then throw("Cannot find furnace") | |
78 | 78 | else if (if ((lastBurn > 0)) | |
79 | 79 | then (height >= finisHeight) | |
80 | 80 | else false) | |
81 | 81 | then throw("Time is run out") | |
82 | 82 | else if ((size(i.payments) != 1)) | |
83 | 83 | then throw("You should to provide payment") | |
84 | 84 | else if ((i.payments[0].assetId != coalAssetId)) | |
85 | 85 | then throw("Invalid coal") | |
86 | 86 | else if ((i.payments[0].amount != 1)) | |
87 | 87 | then throw("You can burn only 1 coal") | |
88 | 88 | else { | |
89 | 89 | let callerAddress = toBase58String(i.caller.bytes) | |
90 | 90 | [Burn(coalAssetId, i.payments[0].amount), IntegerEntry((("furnace_" + furnaceId) + "_lastBurn"), height), StringEntry((("furnace_" + furnaceId) + "_lastStoker"), callerAddress)] | |
91 | 91 | } | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | ||
96 | 96 | @Callable(i) | |
97 | 97 | func claim (furnaceId) = { | |
98 | 98 | let isFinished = tryGetBoolean((("furnace_" + furnaceId) + "_finished")) | |
99 | 99 | let lifetime = tryGetInteger((("furnace_" + furnaceId) + "_lifetime")) | |
100 | 100 | let lastBurn = tryGetInteger((("furnace_" + furnaceId) + "_lastBurn")) | |
101 | 101 | let rewardAsset = tryGetString((("furnace_" + furnaceId) + "_rewardAssetId")) | |
102 | 102 | let lastStoker = tryGetString((("furnace_" + furnaceId) + "_lastStoker")) | |
103 | 103 | let rewardAmount = tryGetInteger((("furnace_" + furnaceId) + "_rewardAmount")) | |
104 | 104 | let finishHeight = (lastBurn + lifetime) | |
105 | 105 | if (isFinished) | |
106 | 106 | then throw("Already finished") | |
107 | 107 | else if ((lifetime == 0)) | |
108 | 108 | then throw("Cannot find furnace") | |
109 | 109 | else if ((lastBurn == 0)) | |
110 | 110 | then throw("Furnace not found") | |
111 | 111 | else if ((finishHeight > height)) | |
112 | 112 | then throw("Time has not run out") | |
113 | 113 | else if ((rewardAsset == "")) | |
114 | 114 | then throw("Cannot find reward asset") | |
115 | 115 | else if ((lastStoker == "")) | |
116 | 116 | then throw("Cannot find last stoker") | |
117 | 117 | else if ((rewardAmount == 0)) | |
118 | 118 | then throw("Reward already sent to winner") | |
119 | 119 | else [BooleanEntry((("furnace_" + furnaceId) + "_finished"), true), ScriptTransfer(Address(fromBase58String(lastStoker)), rewardAmount, getAssetBytes(rewardAsset))] | |
120 | 120 | } | |
121 | 121 | ||
122 | 122 | ||
123 | + | ||
124 | + | @Callable(i) | |
125 | + | func mintNazi () = { | |
126 | + | let caller = toBase58String(i.caller.bytes) | |
127 | + | let lastMint = tryGetInteger(("lastMint_" + caller)) | |
128 | + | if (if ((lastMint > 0)) | |
129 | + | then ((lastMint + 5) > height) | |
130 | + | else false) | |
131 | + | then throw("You need to wait 5 blocks after last mint") | |
132 | + | else [IntegerEntry(("lastMint_" + caller), height), Reissue(coalAssetId, 1, true), ScriptTransfer(i.caller, 1, coalAssetId)] | |
133 | + | } | |
134 | + | ||
135 | + | ||
123 | 136 | @Verifier(tx) | |
124 | 137 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
125 | 138 |
github/deemru/w8io/169f3d6 31.47 ms ◑