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+07wXTJsDIu8ke5NyDNC8AAAAAwAAAAFpAQAAAAdidXlVbml0AAAAAQAAAAdhc3NldElEBAAAAARjb3N0BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgIAAAAFY29zdF8FAAAAB2Fzc2V0SUQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAADcG10CQEAAAAFdmFsdWUAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAAAwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAABV3b3JrcyB3aXRoIHdhdmVzIG9ubHkDCQEAAAACIT0AAAACCAUAAAADcG10AAAABmFtb3VudAUAAAA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Zm9yIG5ldyBhZHZlbnR1cmUJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAB6EgBQAAAANKUE4JAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAFd2FpdF8FAAAAB2Fzc2V0SUQFAAAAB25ld1dhaXQFAAAAA25pbAAAAADWEa9V", "height": 1592527, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: E1SzTx5SL3mgWPtnMiru63GEghY5uVcxR3HAgNqZCnLi Next: Bc3NeHf2UbmGWm2piEERq94ZSWDRr4qQs4TZed4QJmKP Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let JPN = base58'5gvKrU3yetdPyMisTo8JiE737U9ZXLp4XkCy2aeE7BbA' | |
5 | + | ||
6 | + | let GOLD = base58'4385BhNBpLMpBM2Gdt8Z6edjdxYgV4Eb2eE5VvUmxrLK' | |
5 | 7 | ||
6 | 8 | @Callable(i) | |
7 | 9 | func buyUnit (assetID) = { | |
37 | 39 | } | |
38 | 40 | let caller = toBase58String(i.caller.bytes) | |
39 | 41 | 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) | |
40 | 68 | if ((caller != owner)) | |
41 | 69 | then throw("You are not owner!") | |
42 | 70 | else if ((wait > lastBlock.height)) | |
43 | 71 | then throw((("Still wait block " + toString(lastBlock.height)) + " for new adventure")) | |
44 | - | else [ScriptTransfer(i.caller, 500000, JPN), IntegerEntry((" | |
72 | + | else [ScriptTransfer(i.caller, 500000, JPN), IntegerEntry(("wait_" + assetID), newWait)] | |
45 | 73 | } | |
46 | 74 | ||
47 | 75 |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let JPN = base58'5gvKrU3yetdPyMisTo8JiE737U9ZXLp4XkCy2aeE7BbA' | |
5 | + | ||
6 | + | let GOLD = base58'4385BhNBpLMpBM2Gdt8Z6edjdxYgV4Eb2eE5VvUmxrLK' | |
5 | 7 | ||
6 | 8 | @Callable(i) | |
7 | 9 | func buyUnit (assetID) = { | |
8 | 10 | let cost = match getInteger(this, ("cost_" + assetID)) { | |
9 | 11 | case a: Int => | |
10 | 12 | a | |
11 | 13 | case _ => | |
12 | 14 | 0 | |
13 | 15 | } | |
14 | 16 | let pmt = value(i.payments[0]) | |
15 | 17 | if (isDefined(pmt.assetId)) | |
16 | 18 | then throw("works with waves only") | |
17 | 19 | else if ((pmt.amount != cost)) | |
18 | 20 | then throw("Wrong cost") | |
19 | 21 | else [ScriptTransfer(i.caller, 1, fromBase58String(assetID)), StringEntry(("owner_" + assetID), toBase58String(i.caller.bytes))] | |
20 | 22 | } | |
21 | 23 | ||
22 | 24 | ||
23 | 25 | ||
24 | 26 | @Callable(i) | |
25 | 27 | func goToForest (assetID) = { | |
26 | 28 | let owner = match getString(this, ("owner_" + assetID)) { | |
27 | 29 | case a: String => | |
28 | 30 | a | |
29 | 31 | case _ => | |
30 | 32 | "" | |
31 | 33 | } | |
32 | 34 | let wait = match getInteger(this, ("wait_" + assetID)) { | |
33 | 35 | case a: Int => | |
34 | 36 | a | |
35 | 37 | case _ => | |
36 | 38 | 0 | |
37 | 39 | } | |
38 | 40 | let caller = toBase58String(i.caller.bytes) | |
39 | 41 | 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) | |
40 | 68 | if ((caller != owner)) | |
41 | 69 | then throw("You are not owner!") | |
42 | 70 | else if ((wait > lastBlock.height)) | |
43 | 71 | then throw((("Still wait block " + toString(lastBlock.height)) + " for new adventure")) | |
44 | - | else [ScriptTransfer(i.caller, 500000, JPN), IntegerEntry((" | |
72 | + | else [ScriptTransfer(i.caller, 500000, JPN), IntegerEntry(("wait_" + assetID), newWait)] | |
45 | 73 | } | |
46 | 74 | ||
47 | 75 |
github/deemru/w8io/169f3d6 32.98 ms ◑