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+afM6aBfaMotx14GtgBLCd6Mb2pgYvAAAAAAtjb2FsQXNzZXRJZAEAAAAgMeDV9UC3cemF7HoOb7evUrojvKZCHJ2aO5kl6ImGjuYBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAEAAAANdHJ5R2V0Qm9vbGVhbgAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGwAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAHQm9vbGVhbgQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgcBAAAADmdldEFzc2V0U3RyaW5nAAAAAQAAAAdhc3NldElkBAAAAAckbWF0Y2gwBQAAAAdhc3NldElkAwkAAAEAAAACBQAAAAckbWF0Y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AIbGFzdE1pbnQAAAAAAAAAAAAJAABmAAAAAgkAAGQAAAACBQAAAAhsYXN0TWludAAAAAAAAAAABQUAAAAGaGVpZ2h0BwkAAAIAAAABAgAAAClZb3UgbmVlZCB0byB3YWl0IDUgYmxvY2tzIGFmdGVyIGxhc3QgbWludAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAAlsYXN0TWludF8FAAAABmNhbGxlcgUAAAAGaGVpZ2h0CQAETAAAAAIJAQAAAAdSZWlzc3VlAAAAAwUAAAALY29hbEFzc2V0SWQAAAAAAAAAAAEGCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAAQUAAAALY29hbEFzc2V0SWQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V589FZxA==", "height": 2190245, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7XHfHoPk82SYhQ6iurqrFYbaBG7tXX2P5HWyFDRh2hEB Next: 4sxfrA26HCjTiS8nvLZm596VCGSzNukBUEzGvAPXbu5G Diff:
OldNewDifferences
120120 }
121121
122122
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+
123136 @Verifier(tx)
124137 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
125138
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let admin = base58'3MxZPzVdHQYNjp99N7VRuR4RLmJUqnDg9ok'
55
66 let coalAssetId = base58'4MhpjsP1MPpC49v6zBr7eAAEPZdmHWcrSqcSv8tZcpjo'
77
88 func tryGetInteger (key) = match getInteger(this, key) {
99 case b: Int =>
1010 b
1111 case _ =>
1212 0
1313 }
1414
1515
1616 func tryGetBoolean (key) = match getBoolean(this, key) {
1717 case b: Boolean =>
1818 b
1919 case _ =>
2020 false
2121 }
2222
2323
2424 func getAssetString (assetId) = match assetId {
2525 case b: ByteVector =>
2626 toBase58String(b)
2727 case _ =>
2828 "WAVES"
2929 }
3030
3131
3232 func tryGetString (key) = match getString(this, key) {
3333 case b: String =>
3434 b
3535 case _ =>
3636 ""
3737 }
3838
3939
4040 func tryGetBinary (key) = match getBinary(this, key) {
4141 case b: ByteVector =>
4242 b
4343 case _ =>
4444 base58''
4545 }
4646
4747
4848 func getAssetBytes (assetIdStr) = if ((assetIdStr == "WAVES"))
4949 then unit
5050 else fromBase58String(assetIdStr)
5151
5252
5353 @Callable(i)
5454 func createFurnace (lifetime) = if ((toBase58String(i.caller.bytes) != toBase58String(admin)))
5555 then throw("You cannot create furnace")
5656 else if ((size(i.payments) != 1))
5757 then throw("You should to provide reward")
5858 else {
5959 let rewardAmount = i.payments[0].amount
6060 let rewardAssetId = i.payments[0].assetId
6161 let newFurnacesAmount = (tryGetInteger("global_furnacesAmount") + 1)
6262 let furnaceId = toString(newFurnacesAmount)
6363 [IntegerEntry("global_furnacesAmount", newFurnacesAmount), IntegerEntry((("furnace_" + furnaceId) + "_lifetime"), lifetime), IntegerEntry((("furnace_" + furnaceId) + "_rewardAmount"), rewardAmount), StringEntry((("furnace_" + furnaceId) + "_rewardAssetId"), getAssetString(rewardAssetId))]
6464 }
6565
6666
6767
6868 @Callable(i)
6969 func burn (furnaceId) = {
7070 let isFinished = tryGetBoolean((("furnace_" + furnaceId) + "_finished"))
7171 let lifetime = tryGetInteger((("furnace_" + furnaceId) + "_lifetime"))
7272 let lastBurn = tryGetInteger((("furnace_" + furnaceId) + "_lastBurn"))
7373 let finisHeight = (lastBurn + lifetime)
7474 if (isFinished)
7575 then throw("Already finished")
7676 else if ((lifetime == 0))
7777 then throw("Cannot find furnace")
7878 else if (if ((lastBurn > 0))
7979 then (height >= finisHeight)
8080 else false)
8181 then throw("Time is run out")
8282 else if ((size(i.payments) != 1))
8383 then throw("You should to provide payment")
8484 else if ((i.payments[0].assetId != coalAssetId))
8585 then throw("Invalid coal")
8686 else if ((i.payments[0].amount != 1))
8787 then throw("You can burn only 1 coal")
8888 else {
8989 let callerAddress = toBase58String(i.caller.bytes)
9090 [Burn(coalAssetId, i.payments[0].amount), IntegerEntry((("furnace_" + furnaceId) + "_lastBurn"), height), StringEntry((("furnace_" + furnaceId) + "_lastStoker"), callerAddress)]
9191 }
9292 }
9393
9494
9595
9696 @Callable(i)
9797 func claim (furnaceId) = {
9898 let isFinished = tryGetBoolean((("furnace_" + furnaceId) + "_finished"))
9999 let lifetime = tryGetInteger((("furnace_" + furnaceId) + "_lifetime"))
100100 let lastBurn = tryGetInteger((("furnace_" + furnaceId) + "_lastBurn"))
101101 let rewardAsset = tryGetString((("furnace_" + furnaceId) + "_rewardAssetId"))
102102 let lastStoker = tryGetString((("furnace_" + furnaceId) + "_lastStoker"))
103103 let rewardAmount = tryGetInteger((("furnace_" + furnaceId) + "_rewardAmount"))
104104 let finishHeight = (lastBurn + lifetime)
105105 if (isFinished)
106106 then throw("Already finished")
107107 else if ((lifetime == 0))
108108 then throw("Cannot find furnace")
109109 else if ((lastBurn == 0))
110110 then throw("Furnace not found")
111111 else if ((finishHeight > height))
112112 then throw("Time has not run out")
113113 else if ((rewardAsset == ""))
114114 then throw("Cannot find reward asset")
115115 else if ((lastStoker == ""))
116116 then throw("Cannot find last stoker")
117117 else if ((rewardAmount == 0))
118118 then throw("Reward already sent to winner")
119119 else [BooleanEntry((("furnace_" + furnaceId) + "_finished"), true), ScriptTransfer(Address(fromBase58String(lastStoker)), rewardAmount, getAssetBytes(rewardAsset))]
120120 }
121121
122122
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+
123136 @Verifier(tx)
124137 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
125138

github/deemru/w8io/169f3d6 
31.47 ms