tx · 4Ug1otXcqkkLJ5sSeUx2zjmn81gdzf3D5dn1wiQUCYKU

3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh:  -0.01000000 Waves

2021.07.20 20:39 [1622248] smart account 3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh > SELF 0.00000000 Waves

{ "type": 13, "id": "4Ug1otXcqkkLJ5sSeUx2zjmn81gdzf3D5dn1wiQUCYKU", "fee": 1000000, "feeAssetId": null, "timestamp": 1626802742070, "version": 2, "chainId": 84, "sender": "3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh", "senderPublicKey": "D7edN6TZzQ6PbyWHGFdGMPJkkRNjR1Y32g7MmU7AXR73", "proofs": [ "3EdHx7Wx2EfbBgDQj3fYCTd4VKB277hPMaEnjrt5uov1Tq1rEqxrwm24HNN7M2xeNYYyNPygvMA5SkgpM2KhoePb" ], "script": "base64:AAIFAAAAAAAAABAIAhIAEgMKAQESAwoBARIAAAAABQAAAAAJQkxPQ0tTVEVQAAAAAAAAAAAKAAAAAAlJTkdPVENPU1QAAAAAAAAAAAoAAAAACFBMT1RDT1NUAAAAAAAAAYagAAAAAANSRVMBAAAAIPcwjku9kNb2F2wTmbBomIqdANw/L1vEuPdJD1w1hByzAQAAAApyYW5kb21pemVyAAAAAQAAAANpbnYEAAAACGxhc3RQbGF5BAAAAAckbWF0Y2gwCQAEHAAAAAIFAAAABHRoaXMCAAAACGxhc3RQbGF5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0AQAAAA5Hb2xkTWluZXJzMjAyMQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgQAAAAEcmFuZAkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACCQAAywAAAAIFAAAACGxhc3RQbGF5CAUAAAADaW52AAAADXRyYW5zYWN0aW9uSWQIBQAAAAN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AgUAAAAEdGhpcwkAASwAAAACAgAAAAVwbG90XwUAAAAGY2FsbGVyAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAABHdhaXQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwkAASwAAAACAgAAAAV3YWl0XwUAAAAGY2FsbGVyAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAAB25ld1dhaXQJAABkAAAAAggFAAAACWxhc3RCbG9jawAAAAZoZWlnaHQFAAAACUJMT0NLU1RFUAQAAAALbmV3UGxvdFNpemUJAABlAAAAAgUAAAAIcGxvdFNpemUAAAAAAAAAAAEDCQAAZwAAAAIAAAAAAAAAAAAFAAAACHBsb3RTaXplCQAAAgAAAAECAAAAF1Bsb3QgaXMgZW1wdHksIGJ1eSBuZXchAwkAAGYAAAACBQAAAAR3YWl0CAUAAAAJbGFzdEJsb2NrAAAABmhlaWdodAkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgIAAAARU3RpbGwgd2FpdCBibG9jayAJAAGkAAAAAQUAAAAEd2FpdAIAAAALIGZvciBtaW5pbmcJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAFd2FpdF8FAAAABmNhbGxlcgUAAAAHbmV3V2FpdAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIAAAAAAAAAA+gFAAAAA1JFUwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAAVwbG90XwUAAAAGY2FsbGVyBQAAAAtuZXdQbG90U2l6ZQUAAAADbmlsAAAAADj0Yms=", "height": 1622248, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: H5xzz2ty1jiyC4EedGfirFMjaMQq1aSWVzCkJ4qh8KHT Next: GY1bnnCtSAebiySBkV5665U7BrhVqdkjXjHz1ivNfAmu Diff:
OldNewDifferences
109109 }
110110
111111
112+
113+@Callable(i)
114+func goToPlot () = {
115+ let caller = toBase58String(i.caller.bytes)
116+ let plotSize = match getInteger(this, ("plot_" + caller)) {
117+ case a: Int =>
118+ a
119+ case _ =>
120+ 0
121+ }
122+ let wait = match getInteger(this, ("wait_" + caller)) {
123+ case a: Int =>
124+ a
125+ case _ =>
126+ 0
127+ }
128+ let newWait = (lastBlock.height + BLOCKSTEP)
129+ let newPlotSize = (plotSize - 1)
130+ if ((0 >= plotSize))
131+ then throw("Plot is empty, buy new!")
132+ else if ((wait > lastBlock.height))
133+ then throw((("Still wait block " + toString(wait)) + " for mining"))
134+ else [IntegerEntry(("wait_" + caller), newWait), ScriptTransfer(i.caller, 1000, RES), IntegerEntry(("plot_" + caller), newPlotSize)]
135+ }
136+
137+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let BLOCKSTEP = 10
55
66 let INGOTCOST = 10
77
88 let PLOTCOST = 100000
99
1010 let RES = base58'HdveNhSzDRiEib9RfQ5EAxmpFVica4EqvBFd2S4pdbD4'
1111
1212 func randomizer (inv) = {
1313 let lastPlay = match getBinary(this, "lastPlay") {
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((("Still wait block " + toString(wait)) + " for mining"))
4040 else [IntegerEntry(("wait_" + caller), newWait), ScriptTransfer(i.caller, count, RES)]
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 not attached")
6464 else if ((craft > lastBlock.height))
6565 then throw((("Still wait block " + toString(craft)) + " for crafting"))
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 weight ingot!")
7272 else {
7373 let payment = i.payments[0]
7474 if ((payment.assetId != RES))
7575 then throw("PAY IN RES TOKEN ONLY")
7676 else if ((payment.amount != (INGOTCOST * count)))
7777 then throw((("PAY " + toString((INGOTCOST * count))) + " RES TOKEN ONLY"))
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(RES, 10), 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 {
102102 let payment = i.payments[0]
103103 if (isDefined(payment.assetId))
104104 then throw("Pay in WAVES only")
105105 else if ((payment.amount != (pSize * PLOTCOST)))
106106 then throw((("Pay " + toString((pSize * PLOTCOST))) + " WAVELET"))
107107 else [IntegerEntry(("plot_" + caller), pSize)]
108108 }
109109 }
110110
111111
112+
113+@Callable(i)
114+func goToPlot () = {
115+ let caller = toBase58String(i.caller.bytes)
116+ let plotSize = match getInteger(this, ("plot_" + caller)) {
117+ case a: Int =>
118+ a
119+ case _ =>
120+ 0
121+ }
122+ let wait = match getInteger(this, ("wait_" + caller)) {
123+ case a: Int =>
124+ a
125+ case _ =>
126+ 0
127+ }
128+ let newWait = (lastBlock.height + BLOCKSTEP)
129+ let newPlotSize = (plotSize - 1)
130+ if ((0 >= plotSize))
131+ then throw("Plot is empty, buy new!")
132+ else if ((wait > lastBlock.height))
133+ then throw((("Still wait block " + toString(wait)) + " for mining"))
134+ else [IntegerEntry(("wait_" + caller), newWait), ScriptTransfer(i.caller, 1000, RES), IntegerEntry(("plot_" + caller), newPlotSize)]
135+ }
136+
137+

github/deemru/w8io/169f3d6 
47.47 ms