tx · FwZQ6ea5UhPUtCnr3doyWupnW42F2tgFR4UATXKjPm3d

3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh:  -0.01000000 Waves

2021.07.15 20:00 [1614991] smart account 3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh > SELF 0.00000000 Waves

{ "type": 13, "id": "FwZQ6ea5UhPUtCnr3doyWupnW42F2tgFR4UATXKjPm3d", "fee": 1000000, "feeAssetId": null, "timestamp": 1626368432774, "version": 2, "chainId": 84, "sender": "3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh", "senderPublicKey": "D7edN6TZzQ6PbyWHGFdGMPJkkRNjR1Y32g7MmU7AXR73", "proofs": [ "28J3BgpzSSGDiM9CCNUDLmDZNXq1W2ozEEqVaxGZq2E2arFQ6AwweJZqTTsgDZw6wC4os2xc6nnznoWvg1vqu1fq" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAAEAAAAAAlCTE9DS1NURVAAAAAAAAAAAAoAAAAACUlOR09UQ09TVAAAAAAAAAAACgAAAAADUkVTAQAAACD3MI5LvZDW9hdsE5mwaJiKnQDcPy9bxLj3SQ9cNYQcswEAAAAKcmFuZG9taXplcgAAAAEAAAADaW52BAAAAAhsYXN0UGxheQQAAAAHJG1hdGNoMAkABBwAAAACBQAAAAR0aGlzAgAAAAhsYXN0UGxheQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAABcwUAAAAHJG1hdGNoMAUAAAABcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAEAAAAOR29sZE1pbmVyczIwMjEJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IEAAAABHJhbmQJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACBQAAAAhsYXN0UGxheQgFAAAAA2ludgAAAA10cmFuc2FjdGlvbklkCAUAAAADaW52AAAAD2NhbGxlclB1YmxpY0tleQgFAAAACWxhc3RCbG9jawAA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AAAJbmV3SW5nb3RzCQABLAAAAAICAAAABUlOR09UCQABpAAAAAEFAAAACW5ld0luZ290cwAAAAAAAAAAAQAAAAAAAAAAAAcJAARMAAAAAgkBAAAABEJ1cm4AAAACBQAAAANSRVMAAAAAAAAAAAoJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAAAABBQAAAANuZnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADGluZ290c19jb3VudAUAAAAJbmV3SW5nb3RzCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgIAAAAGaW5nb3RfCQABpAAAAAEFAAAACW5ld0luZ290cwkAAlgAAAABBQAAAANuZnQFAAAAA25pbAAAAAD1OtpL", "height": 1614991, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4HnJUdhRFsoCD9ymTfmfSDQbJXFayBp3Gh6Cu9aCggR4 Next: 6xctEujtSLfCNQALaaFT3bXnPmTUaqCzagwrCzX73QAf Diff:
OldNewDifferences
6565 else if ((payment.amount != INGOTCOST))
6666 then throw((("PAY " + toString(INGOTCOST)) + " RES TOKEN ONLY"))
6767 else {
68- let issue = Issue("DEMO", "DEMO", 1, 0, false)
68+ let issue = Issue(("INGOT" + toString(newIngots)), ("INGOT" + toString(newIngots)), 1, 0, false)
6969 let nft = calculateAssetId(issue)
7070 [Issue(("INGOT" + toString(newIngots)), ("INGOT" + toString(newIngots)), 1, 0, false), Burn(RES, 10), ScriptTransfer(i.caller, 1, nft), IntegerEntry("ingots_count", newIngots), StringEntry(("ingot_" + toString(newIngots)), toBase58String(nft))]
7171 }
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 RES = base58'HdveNhSzDRiEib9RfQ5EAxmpFVica4EqvBFd2S4pdbD4'
99
1010 func randomizer (inv) = {
1111 let lastPlay = match getBinary(this, "lastPlay") {
1212 case s: ByteVector =>
1313 s
1414 case _: Unit =>
1515 base58'TGCTLFoHxJ8U7rcUofN'
1616 case _ =>
1717 throw("Match error")
1818 }
1919 let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
2020 sha256(rand)
2121 }
2222
2323
2424 @Callable(i)
2525 func goToMine () = {
2626 let caller = toBase58String(i.caller.bytes)
2727 let wait = match getInteger(this, ("wait_" + caller)) {
2828 case a: Int =>
2929 a
3030 case _ =>
3131 0
3232 }
3333 let newWait = (lastBlock.height + BLOCKSTEP)
3434 let randhash = randomizer(i)
3535 let count = (toInt(randhash) % 1000)
3636 if ((wait > lastBlock.height))
3737 then throw((("Still wait block " + toString(lastBlock.height)) + " for mining"))
3838 else [IntegerEntry(("wait_" + caller), newWait), ScriptTransfer(i.caller, count, RES)]
3939 }
4040
4141
4242
4343 @Callable(i)
4444 func craftIngot () = {
4545 let caller = toBase58String(i.caller.bytes)
4646 let craft = match getInteger(this, ("craft_" + caller)) {
4747 case a: Int =>
4848 a
4949 case _ =>
5050 0
5151 }
5252 let ingots = match getInteger(this, "ingots_count") {
5353 case a: Int =>
5454 a
5555 case _ =>
5656 0
5757 }
5858 let newIngots = (ingots + 1)
5959 if ((size(i.payments) == 0))
6060 then throw("Payment not attached")
6161 else {
6262 let payment = i.payments[0]
6363 if ((payment.assetId != RES))
6464 then throw("PAY IN RES TOKEN ONLY")
6565 else if ((payment.amount != INGOTCOST))
6666 then throw((("PAY " + toString(INGOTCOST)) + " RES TOKEN ONLY"))
6767 else {
68- let issue = Issue("DEMO", "DEMO", 1, 0, false)
68+ let issue = Issue(("INGOT" + toString(newIngots)), ("INGOT" + toString(newIngots)), 1, 0, false)
6969 let nft = calculateAssetId(issue)
7070 [Issue(("INGOT" + toString(newIngots)), ("INGOT" + toString(newIngots)), 1, 0, false), Burn(RES, 10), ScriptTransfer(i.caller, 1, nft), IntegerEntry("ingots_count", newIngots), StringEntry(("ingot_" + toString(newIngots)), toBase58String(nft))]
7171 }
7272 }
7373 }
7474
7575

github/deemru/w8io/169f3d6 
36.76 ms