tx · 386oAaA4T3FBz85VR2qYeynsemNDHBPGBZVUbNnwsNSC

3N3FtJGWEXex57HajuvYKKHU33PS4fwmQH6:  -0.01000000 Waves

2021.06.30 05:52 [1592527] smart account 3N3FtJGWEXex57HajuvYKKHU33PS4fwmQH6 > SELF 0.00000000 Waves

{ "type": 13, "id": "386oAaA4T3FBz85VR2qYeynsemNDHBPGBZVUbNnwsNSC", "fee": 1000000, "feeAssetId": null, "timestamp": 1625021557426, "version": 2, "chainId": 84, "sender": "3N3FtJGWEXex57HajuvYKKHU33PS4fwmQH6", "senderPublicKey": "4f5Wt4MDH3Qt6DMuZQid3zoj463xCUkNdUWjUcChuedh", "proofs": [ "2eXHYqdy1m2kNqc4JBYM7qhRaDr8mEn9VzgzT9bRNxm5v1QpLjMqQq812mFaHjPgUDXXeKTtFNdBsTp27wMUt8Ni" ], "script": "base64:AAIFAAAAAAAAABEIAhIDCgEIEgMKAQgSAwoBCAAAAAIAAAAAA0pQTgEAAAAgRaixr43MFIJOvFHmv8KDH8qDJ3GoY5FnIsYNmRfojMUAAAAABEdPTEQBAAAAIC0eOAmkGWVMqSbVdH5jMxv+07wXTJsDIu8ke5NyDNC8AAAAAwAAAAFpAQAAAAdidXlVbml0AAAAAQAAAAdhc3NldElEBAAAAARjb3N0BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgIAAAAFY29zdF8FAAAAB2Fzc2V0SUQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAADcG10CQEAAAAFdmFsdWUAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAAAwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAABV3b3JrcyB3aXRoIHdhdmVzIG9ubHkDCQEAAAACIT0AAAACCAUAAAADcG10AAAABmFtb3VudAUAAA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gZm9yIG5ldyBhZHZlbnR1cmUJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAB6EgBQAAAANKUE4JAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAFd2FpdF8FAAAAB2Fzc2V0SUQFAAAAB25ld1dhaXQFAAAAA25pbAAAAADWEa9V", "height": 1592527, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: E1SzTx5SL3mgWPtnMiru63GEghY5uVcxR3HAgNqZCnLi Next: Bc3NeHf2UbmGWm2piEERq94ZSWDRr4qQs4TZed4QJmKP Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 4 #-}
1+{-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let JPN = base58'5gvKrU3yetdPyMisTo8JiE737U9ZXLp4XkCy2aeE7BbA'
5+
6+let GOLD = base58'4385BhNBpLMpBM2Gdt8Z6edjdxYgV4Eb2eE5VvUmxrLK'
57
68 @Callable(i)
79 func buyUnit (assetID) = {
3739 }
3840 let caller = toBase58String(i.caller.bytes)
3941 let newWait = (lastBlock.height + 100)
42+ let count = ((lastBlock.height % 100) + 1)
43+ if ((caller != owner))
44+ then throw("You are not owner!")
45+ else if ((wait > lastBlock.height))
46+ then throw((("Still wait block " + toString(lastBlock.height)) + " for forest-walking"))
47+ else [ScriptTransfer(i.caller, count, JPN), IntegerEntry(("wait_" + assetID), newWait)]
48+ }
49+
50+
51+
52+@Callable(i)
53+func goToAdventure (assetID) = {
54+ let owner = match getString(this, ("owner_" + assetID)) {
55+ case a: String =>
56+ a
57+ case _ =>
58+ ""
59+ }
60+ let wait = match getInteger(this, ("wait_" + assetID)) {
61+ case a: Int =>
62+ a
63+ case _ =>
64+ 0
65+ }
66+ let caller = toBase58String(i.caller.bytes)
67+ let newWait = (lastBlock.height + 100)
4068 if ((caller != owner))
4169 then throw("You are not owner!")
4270 else if ((wait > lastBlock.height))
4371 then throw((("Still wait block " + toString(lastBlock.height)) + " for new adventure"))
44- else [ScriptTransfer(i.caller, 500000, JPN), IntegerEntry(("balance_" + toBase58String(i.caller.bytes)), 500000), IntegerEntry(("wait_" + assetID), newWait)]
72+ else [ScriptTransfer(i.caller, 500000, JPN), IntegerEntry(("wait_" + assetID), newWait)]
4573 }
4674
4775
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 4 #-}
1+{-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let JPN = base58'5gvKrU3yetdPyMisTo8JiE737U9ZXLp4XkCy2aeE7BbA'
5+
6+let GOLD = base58'4385BhNBpLMpBM2Gdt8Z6edjdxYgV4Eb2eE5VvUmxrLK'
57
68 @Callable(i)
79 func buyUnit (assetID) = {
810 let cost = match getInteger(this, ("cost_" + assetID)) {
911 case a: Int =>
1012 a
1113 case _ =>
1214 0
1315 }
1416 let pmt = value(i.payments[0])
1517 if (isDefined(pmt.assetId))
1618 then throw("works with waves only")
1719 else if ((pmt.amount != cost))
1820 then throw("Wrong cost")
1921 else [ScriptTransfer(i.caller, 1, fromBase58String(assetID)), StringEntry(("owner_" + assetID), toBase58String(i.caller.bytes))]
2022 }
2123
2224
2325
2426 @Callable(i)
2527 func goToForest (assetID) = {
2628 let owner = match getString(this, ("owner_" + assetID)) {
2729 case a: String =>
2830 a
2931 case _ =>
3032 ""
3133 }
3234 let wait = match getInteger(this, ("wait_" + assetID)) {
3335 case a: Int =>
3436 a
3537 case _ =>
3638 0
3739 }
3840 let caller = toBase58String(i.caller.bytes)
3941 let newWait = (lastBlock.height + 100)
42+ let count = ((lastBlock.height % 100) + 1)
43+ if ((caller != owner))
44+ then throw("You are not owner!")
45+ else if ((wait > lastBlock.height))
46+ then throw((("Still wait block " + toString(lastBlock.height)) + " for forest-walking"))
47+ else [ScriptTransfer(i.caller, count, JPN), IntegerEntry(("wait_" + assetID), newWait)]
48+ }
49+
50+
51+
52+@Callable(i)
53+func goToAdventure (assetID) = {
54+ let owner = match getString(this, ("owner_" + assetID)) {
55+ case a: String =>
56+ a
57+ case _ =>
58+ ""
59+ }
60+ let wait = match getInteger(this, ("wait_" + assetID)) {
61+ case a: Int =>
62+ a
63+ case _ =>
64+ 0
65+ }
66+ let caller = toBase58String(i.caller.bytes)
67+ let newWait = (lastBlock.height + 100)
4068 if ((caller != owner))
4169 then throw("You are not owner!")
4270 else if ((wait > lastBlock.height))
4371 then throw((("Still wait block " + toString(lastBlock.height)) + " for new adventure"))
44- else [ScriptTransfer(i.caller, 500000, JPN), IntegerEntry(("balance_" + toBase58String(i.caller.bytes)), 500000), IntegerEntry(("wait_" + assetID), newWait)]
72+ else [ScriptTransfer(i.caller, 500000, JPN), IntegerEntry(("wait_" + assetID), newWait)]
4573 }
4674
4775

github/deemru/w8io/169f3d6 
32.98 ms