tx · 57w6JtZHw86Nq8BNcN3VkG9yQbcT2XY7Go5kBJRrsQSk

3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh:  -0.01000000 Waves

2021.07.20 20:24 [1622232] smart account 3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh > SELF 0.00000000 Waves

{ "type": 13, "id": "57w6JtZHw86Nq8BNcN3VkG9yQbcT2XY7Go5kBJRrsQSk", "fee": 1000000, "feeAssetId": null, "timestamp": 1626801966970, "version": 2, "chainId": 84, "sender": "3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh", "senderPublicKey": "D7edN6TZzQ6PbyWHGFdGMPJkkRNjR1Y32g7MmU7AXR73", "proofs": [ "3b1eKrdtDWvSMuxVnzwaNj255RCpJtMdTVvhsannMhry2eg3zLzE4Kr3tH8qWVGt7jEYM78ehLvZxJixLVXkfsex" ], "script": "base64:AAIFAAAAAAAAAA4IAhIAEgMKAQESAwoBAQAAAAUAAAAACUJMT0NLU1RFUAAAAAAAAAAACgAAAAAJSU5HT1RDT1NUAAAAAAAAAAAKAAAAAAhQTE9UQ09TVAAAAAAAAAGGoAAAAAADUkVTAQAAACD3MI5LvZDW9hdsE5mwaJiKnQDcPy9bxLj3SQ9cNYQcswEAAAAKcmFuZG9taXplcgAAAAEAAAADaW52BAAAAAhsYXN0UGxheQQAAAAHJG1hdGNoMAkABBwAAAACBQAAAAR0aGlzAgAAAAhsYXN0UGxheQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAEAAAAOR29sZE1pbmVyczIwMjEJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IEAAAABHJhbmQJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACBQAAAAhsYXN0UGxheQgFAAAAA2ludgAAAA10cmFuc2FjdGlvbklkCAUAAAADaW52A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AAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAGY3JhZnRfBQAAAAZjYWxsZXIFAAAACG5ld0NyYWZ0BQAAAANuaWwAAAABaQEAAAAHYnV5UGxvdAAAAAEAAAAFcFNpemUEAAAABmNhbGxlcgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAhwbG90U2l6ZQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzCQABLAAAAAICAAAABXBsb3RfBQAAAAZjYWxsZXIDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAMJAABmAAAAAgUAAAAIcGxvdFNpemUAAAAAAAAAAAAJAAACAAAAAQIAAAAYWW91IGFscmVhZHkgaGF2ZSBhIHBsb3QhBAAAAAdwYXltZW50CQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAAAwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAAdwYXltZW50AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAARUGF5IGluIFdBVkVTIG9ubHkDCQEAAAACIT0AAAACCAUAAAAHcGF5bWVudAAAAAZhbW91bnQJAABoAAAAAgUAAAAFcFNpemUFAAAACFBMT1RDT1NUCQAAAgAAAAEJAAEsAAAAAgkAASwAAAACAgAAAARQYXkgCQABpAAAAAEJAABoAAAAAgUAAAAFcFNpemUFAAAACFBMT1RDT1NUAgAAAAYgV0FWRVMJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAFcGxvdF8FAAAABmNhbGxlcgUAAAAFcFNpemUFAAAAA25pbAAAAABeEEEx", "height": 1622232, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7CF7CiMEY3DrD1a69vFXYgY2sGRyPWvigztskCf9if7y Next: H5xzz2ty1jiyC4EedGfirFMjaMQq1aSWVzCkJ4qh8KHT Diff:
OldNewDifferences
103103 if (isDefined(payment.assetId))
104104 then throw("Pay in WAVES only")
105105 else if ((payment.amount != (pSize * PLOTCOST)))
106- then throw((("Pay " + toString(((pSize * PLOTCOST) / 100000000))) + " WAVES"))
106+ then throw((("Pay " + toString((pSize * PLOTCOST))) + " WAVES"))
107107 else [IntegerEntry(("plot_" + caller), pSize)]
108108 }
109109 }
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)))
106- then throw((("Pay " + toString(((pSize * PLOTCOST) / 100000000))) + " WAVES"))
106+ then throw((("Pay " + toString((pSize * PLOTCOST))) + " WAVES"))
107107 else [IntegerEntry(("plot_" + caller), pSize)]
108108 }
109109 }
110110
111111

github/deemru/w8io/026f985 
40.58 ms