tx · HyfQWhLYxAiTacCB8Ph37vSPjBpr9GjN4kr7crJ2kHAS

3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh:  -0.01000000 Waves

2021.07.22 19:58 [1625122] smart account 3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh > SELF 0.00000000 Waves

{ "type": 13, "id": "HyfQWhLYxAiTacCB8Ph37vSPjBpr9GjN4kr7crJ2kHAS", "fee": 1000000, "feeAssetId": null, "timestamp": 1626973174281, "version": 2, "chainId": 84, "sender": "3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh", "senderPublicKey": "D7edN6TZzQ6PbyWHGFdGMPJkkRNjR1Y32g7MmU7AXR73", "proofs": [ "2ULh7qkms9hrSVMXqjkVs1inaCg2octvh5VJnbD95VkuHqv24ZkFAzz6s1gqgGmgrhpUSiCNrR1ai7AcDfg4o2YZ" ], "script": "base64:AAIFAAAAAAAAABAIAhIAEgMKAQESAwoBARIAAAAABQAAAAAJQkxPQ0tTVEVQAAAAAAAAAAAKAAAAAAlJTkdPVENPU1QAAAAAAAAAA+gAAAAACFBMT1RDT1NUAAAAAAAAAYagAAAAAAVnTHVtcAEAAAAg9zCOS72Q1vYXbBOZsGiYip0A3D8vW8S490kPXDWEHLMBAAAACnJhbmRvbWl6ZXIAAAABAAAAA2ludgQAAAAIbGFzdFBsYXkEAAAAByRtYXRjaDAJAAQcAAAAAgUAAAAEdGhpcwIAAAAIbGFzdE1pbmUDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAXMFAAAAByRtYXRjaDAFAAAAAXMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQBAAAADkdvbGRNaW5lcnMyMDIxCQAAAgAAAAECAAAAC01hdGNoIGVycm9yBAAAAARyYW5kCQAAywAAAAIJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgUAAAAIbGFzdFBsYXkIBQAAAANpbnYAAAANdHJhbnNhY3Rpb25JZAgFAA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3YWl0XwUAAAAGY2FsbGVyBQAAAAduZXdXYWl0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAD6AUAAAAFZ0x1bXAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAFcGxvdF8FAAAABmNhbGxlcgUAAAALbmV3UGxvdFNpemUFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V55GIrhA==", "height": 1625122, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3skRifYSV37wido7xWA1oU3f8fF67gCf8JVRXzsGRLT7 Next: 6mq5L6dkUimHL3U3ZCL1djSUzUTiGakGEr5oPaY2r61p Diff:
OldNewDifferences
139139 }
140140
141141
142+@Verifier(tx)
143+func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
144+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let BLOCKSTEP = 10
55
66 let INGOTCOST = 1000
77
88 let PLOTCOST = 100000
99
1010 let gLump = base58'HdveNhSzDRiEib9RfQ5EAxmpFVica4EqvBFd2S4pdbD4'
1111
1212 func randomizer (inv) = {
1313 let lastPlay = match getBinary(this, "lastMine") {
1414 case s: ByteVector =>
1515 s
1616 case _: Unit =>
1717 base58'TGCTLFoHxJ8U7rcUofN'
1818 case _ =>
1919 throw("Match error")
2020 }
2121 let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
2222 sha256(rand)
2323 }
2424
2525
2626 @Callable(i)
2727 func goToMine () = {
2828 let caller = toBase58String(i.caller.bytes)
2929 let wait = match getInteger(this, ("wait_" + caller)) {
3030 case a: Int =>
3131 a
3232 case _ =>
3333 0
3434 }
3535 let newWait = (lastBlock.height + BLOCKSTEP)
3636 let randhash = randomizer(i)
3737 let count = (toInt(randhash) % 1000)
3838 if ((wait > lastBlock.height))
3939 then throw((("Wait block " + toString(wait)) + " for mining again"))
4040 else [IntegerEntry(("wait_" + caller), newWait), ScriptTransfer(i.caller, count, gLump), BinaryEntry("lastMine", randhash)]
4141 }
4242
4343
4444
4545 @Callable(i)
4646 func craftIngot (count) = {
4747 let caller = toBase58String(i.caller.bytes)
4848 let craft = match getInteger(this, ("craft_" + caller)) {
4949 case a: Int =>
5050 a
5151 case _ =>
5252 0
5353 }
5454 let ingots = match getInteger(this, "ingots_count") {
5555 case a: Int =>
5656 a
5757 case _ =>
5858 0
5959 }
6060 let newIngots = (ingots + 1)
6161 let newCraft = (lastBlock.height + BLOCKSTEP)
6262 if ((size(i.payments) == 0))
6363 then throw("Payment wasn't attached")
6464 else if ((craft > lastBlock.height))
6565 then throw((("Wait block " + toString(craft)) + " for crafting again"))
6666 else if (if (if ((count != 1))
6767 then (count != 10)
6868 else false)
6969 then (count != 50)
7070 else false)
7171 then throw("Wrong ingot's weight!")
7272 else {
7373 let payment = i.payments[0]
7474 if ((payment.assetId != gLump))
7575 then throw("Payment only in gLump")
7676 else if ((payment.amount != (INGOTCOST * count)))
7777 then throw((("Payment expected " + toString((INGOTCOST * count))) + " gLump"))
7878 else {
7979 let issueName = ("INGOT" + toString(newIngots))
8080 let issueDesc = (((((("{\"weight\":" + toString(count)) + ",\"uid\":") + toString(newIngots)) + ",\"made_by\":\"") + caller) + "\"}")
8181 let issue = Issue(issueName, issueDesc, 1, 0, false)
8282 let nft = calculateAssetId(issue)
8383 [Burn(gLump, (INGOTCOST * count)), Issue(issueName, issueDesc, 1, 0, false), ScriptTransfer(i.caller, 1, nft), IntegerEntry("ingots_count", newIngots), StringEntry(("ingot_" + toString(newIngots)), toBase58String(nft)), IntegerEntry(("craft_" + caller), newCraft)]
8484 }
8585 }
8686 }
8787
8888
8989
9090 @Callable(i)
9191 func buyPlot (pSize) = {
9292 let caller = toBase58String(i.caller.bytes)
9393 let plotSize = match getInteger(this, ("plot_" + caller)) {
9494 case a: Int =>
9595 a
9696 case _ =>
9797 0
9898 }
9999 if ((plotSize > 0))
100100 then throw("You already have a plot!")
101101 else if (if ((0 > plotSize))
102102 then true
103103 else (plotSize > 1000))
104104 then throw("Correct size value from 1 to 1000")
105105 else {
106106 let payment = i.payments[0]
107107 if (isDefined(payment.assetId))
108108 then throw("Payment only in WAVES")
109109 else if ((payment.amount != (pSize * PLOTCOST)))
110110 then throw((("Payment expected " + toString((pSize * PLOTCOST))) + " WAVELET"))
111111 else [IntegerEntry(("plot_" + caller), pSize)]
112112 }
113113 }
114114
115115
116116
117117 @Callable(i)
118118 func goToPlot () = {
119119 let caller = toBase58String(i.caller.bytes)
120120 let plotSize = match getInteger(this, ("plot_" + caller)) {
121121 case a: Int =>
122122 a
123123 case _ =>
124124 0
125125 }
126126 let wait = match getInteger(this, ("wait_" + caller)) {
127127 case a: Int =>
128128 a
129129 case _ =>
130130 0
131131 }
132132 let newWait = (lastBlock.height + BLOCKSTEP)
133133 let newPlotSize = (plotSize - 1)
134134 if ((0 >= plotSize))
135135 then throw("Plot is empty, buy new!")
136136 else if ((wait > lastBlock.height))
137137 then throw((("Wait block " + toString(wait)) + " for mining again"))
138138 else [IntegerEntry(("wait_" + caller), newWait), ScriptTransfer(i.caller, 1000, gLump), IntegerEntry(("plot_" + caller), newPlotSize)]
139139 }
140140
141141
142+@Verifier(tx)
143+func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
144+

github/deemru/w8io/169f3d6 
28.09 ms