tx · 9p3A64kThR1jptuYhX8eTKvY4t1sgsLkHoD676d7dNRy

3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh:  -0.01000000 Waves

2021.07.15 07:50 [1614265] smart account 3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh > SELF 0.00000000 Waves

{ "type": 13, "id": "9p3A64kThR1jptuYhX8eTKvY4t1sgsLkHoD676d7dNRy", "fee": 1000000, "feeAssetId": null, "timestamp": 1626324627865, "version": 2, "chainId": 84, "sender": "3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh", "senderPublicKey": "D7edN6TZzQ6PbyWHGFdGMPJkkRNjR1Y32g7MmU7AXR73", "proofs": [ "3mPoGNP51WQdaSjoj3EdGbyi1MA4qYzhz7Ca5oE5bZ6uozAgqCmwC9xQ5MftWJnj56uJ4cUDbWLtyPwHJeJNQb36" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAADAAAAAAlCTE9DS1NURVAAAAAAAAAAAAoAAAAAA1JFUwEAAAAg9zCOS72Q1vYXbBOZsGiYip0A3D8vW8S490kPXDWEHLMBAAAACnJhbmRvbWl6ZXIAAAABAAAAA2ludgQAAAAIbGFzdFBsYXkEAAAAByRtYXRjaDAJAAQcAAAAAgUAAAAEdGhpcwIAAAAIbGFzdFBsYXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAXMFAAAAByRtYXRjaDAFAAAAAXMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQBAAAADkdvbGRNaW5lcnMyMDIxCQAAAgAAAAECAAAAC01hdGNoIGVycm9yBAAAAARyYW5kCQAAywAAAAIJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgUAAAAIbGFzdFBsYXkIBQAAAANpbnYAAAANdHJhbnNhY3Rpb25JZAgFAAAAA2ludgAAAA9jYWxsZXJQdWJsaWNLZXkIBQAAAAlsYXN0QmxvY2sAAAATZ2VuZXJhdGlvblNpZ25h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eeded", "spentComplexity": 0 } View: original | compacted Prev: 9FrmauXha9yDCP9veavtQRMpZWwr4Ug8roZ7b1ofe5Xh Next: 4HnJUdhRFsoCD9ymTfmfSDQbJXFayBp3Gh6Cu9aCggR4 Diff:
OldNewDifferences
5353 case _ =>
5454 0
5555 }
56+ let newIngots = (ingots + 1)
5657 let balance = assetBalance(i.caller, RES)
5758 if ((10 > balance))
5859 then throw("Not enough, need 1000 pieces")
5960 else {
6061 let issue = Issue("DEMO", "DEMO", 1, 0, false)
6162 let nft = calculateAssetId(issue)
62-[Issue("DEMO", "DEMO", 1, 0, false), Burn(RES, 10), ScriptTransfer(i.caller, 1, nft), IntegerEntry("ingots_count", (ingots + 1)), StringEntry(("ingot_" + toString(ingots)), toBase58String(nft))]
63+[Issue("DEMO", "DEMO", 1, 0, false), Burn(RES, 10), ScriptTransfer(i.caller, 1, nft), IntegerEntry("ingots_count", newIngots), StringEntry(("ingot_" + toString(newIngots)), toBase58String(nft))]
6364 }
6465 }
6566
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let BLOCKSTEP = 10
55
66 let RES = base58'HdveNhSzDRiEib9RfQ5EAxmpFVica4EqvBFd2S4pdbD4'
77
88 func randomizer (inv) = {
99 let lastPlay = match getBinary(this, "lastPlay") {
1010 case s: ByteVector =>
1111 s
1212 case _: Unit =>
1313 base58'TGCTLFoHxJ8U7rcUofN'
1414 case _ =>
1515 throw("Match error")
1616 }
1717 let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
1818 sha256(rand)
1919 }
2020
2121
2222 @Callable(i)
2323 func goToMine () = {
2424 let caller = toBase58String(i.caller.bytes)
2525 let wait = match getInteger(this, ("wait_" + caller)) {
2626 case a: Int =>
2727 a
2828 case _ =>
2929 0
3030 }
3131 let newWait = (lastBlock.height + BLOCKSTEP)
3232 let randhash = randomizer(i)
3333 let count = (toInt(randhash) % 1000)
3434 if ((wait > lastBlock.height))
3535 then throw((("Still wait block " + toString(lastBlock.height)) + " for mining"))
3636 else [IntegerEntry(("wait_" + caller), newWait), ScriptTransfer(i.caller, count, RES)]
3737 }
3838
3939
4040
4141 @Callable(i)
4242 func craftIngot () = {
4343 let caller = toBase58String(i.caller.bytes)
4444 let craft = match getInteger(this, ("craft_" + caller)) {
4545 case a: Int =>
4646 a
4747 case _ =>
4848 0
4949 }
5050 let ingots = match getInteger(this, "ingots_count") {
5151 case a: Int =>
5252 a
5353 case _ =>
5454 0
5555 }
56+ let newIngots = (ingots + 1)
5657 let balance = assetBalance(i.caller, RES)
5758 if ((10 > balance))
5859 then throw("Not enough, need 1000 pieces")
5960 else {
6061 let issue = Issue("DEMO", "DEMO", 1, 0, false)
6162 let nft = calculateAssetId(issue)
62-[Issue("DEMO", "DEMO", 1, 0, false), Burn(RES, 10), ScriptTransfer(i.caller, 1, nft), IntegerEntry("ingots_count", (ingots + 1)), StringEntry(("ingot_" + toString(ingots)), toBase58String(nft))]
63+[Issue("DEMO", "DEMO", 1, 0, false), Burn(RES, 10), ScriptTransfer(i.caller, 1, nft), IntegerEntry("ingots_count", newIngots), StringEntry(("ingot_" + toString(newIngots)), toBase58String(nft))]
6364 }
6465 }
6566
6667

github/deemru/w8io/169f3d6 
27.88 ms