tx · Bc3NeHf2UbmGWm2piEERq94ZSWDRr4qQs4TZed4QJmKP 3N3FtJGWEXex57HajuvYKKHU33PS4fwmQH6: -0.01000000 Waves 2021.06.30 05:53 [1592528] smart account 3N3FtJGWEXex57HajuvYKKHU33PS4fwmQH6 > SELF 0.00000000 Waves
{ "type": 13, "id": "Bc3NeHf2UbmGWm2piEERq94ZSWDRr4qQs4TZed4QJmKP", "fee": 1000000, "feeAssetId": null, "timestamp": 1625021628809, "version": 2, "chainId": 84, "sender": "3N3FtJGWEXex57HajuvYKKHU33PS4fwmQH6", "senderPublicKey": "4f5Wt4MDH3Qt6DMuZQid3zoj463xCUkNdUWjUcChuedh", "proofs": [ "37b3T88e2fDsXn32CXtPUPz97X8sAiCodDkPeNmUnCPGteSXNoT1EExUgoYx8kk1Mma6RRUyD3queiCSNabBnkSh" ], "script": "base64:AAIFAAAAAAAAABEIAhIDCgEIEgMKAQgSAwoBCAAAAAIAAAAAA0pQTgEAAAAgRaixr43MFIJOvFHmv8KDH8qDJ3GoY5FnIsYNmRfojMUAAAAABEdPTEQBAAAAIC0eOAmkGWVMqSbVdH5jMxv+07wXTJsDIu8ke5NyDNC8AAAAAwAAAAFpAQAAAAdidXlVbml0AAAAAQAAAAdhc3NldElEBAAAAARjb3N0BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgIAAAAFY29zdF8FAAAAB2Fzc2V0SUQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAADcG10CQEAAAAFdmFsdWUAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAAAwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAABV3b3JrcyB3aXRoIHdhdmVzIG9ubHkDCQEAAAACIT0AAAACCAUAAAADcG10AAAABmFtb3VudAUAAAAEY29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AIAAAASIGZvciBuZXcgYWR2ZW50dXJlCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAehIAUAAAADSlBOCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAICAAAABXdhaXRfBQAAAAdhc3NldElEBQAAAAduZXdXYWl0BQAAAANuaWwAAAAAPBT1VA==", "height": 1592528, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 386oAaA4T3FBz85VR2qYeynsemNDHBPGBZVUbNnwsNSC Next: BmBn2N8FN3kBp5iCMvYuidkkwNoqVVAA1WywhH57VCL2 Diff:
Old | New | Differences | |
---|---|---|---|
44 | 44 | then throw("You are not owner!") | |
45 | 45 | else if ((wait > lastBlock.height)) | |
46 | 46 | then throw((("Still wait block " + toString(lastBlock.height)) + " for forest-walking")) | |
47 | - | else [ScriptTransfer(i.caller, count, | |
47 | + | else [ScriptTransfer(i.caller, count, GOLD), IntegerEntry(("wait_" + assetID), newWait)] | |
48 | 48 | } | |
49 | 49 | ||
50 | 50 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let JPN = base58'5gvKrU3yetdPyMisTo8JiE737U9ZXLp4XkCy2aeE7BbA' | |
5 | 5 | ||
6 | 6 | let GOLD = base58'4385BhNBpLMpBM2Gdt8Z6edjdxYgV4Eb2eE5VvUmxrLK' | |
7 | 7 | ||
8 | 8 | @Callable(i) | |
9 | 9 | func buyUnit (assetID) = { | |
10 | 10 | let cost = match getInteger(this, ("cost_" + assetID)) { | |
11 | 11 | case a: Int => | |
12 | 12 | a | |
13 | 13 | case _ => | |
14 | 14 | 0 | |
15 | 15 | } | |
16 | 16 | let pmt = value(i.payments[0]) | |
17 | 17 | if (isDefined(pmt.assetId)) | |
18 | 18 | then throw("works with waves only") | |
19 | 19 | else if ((pmt.amount != cost)) | |
20 | 20 | then throw("Wrong cost") | |
21 | 21 | else [ScriptTransfer(i.caller, 1, fromBase58String(assetID)), StringEntry(("owner_" + assetID), toBase58String(i.caller.bytes))] | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | ||
26 | 26 | @Callable(i) | |
27 | 27 | func goToForest (assetID) = { | |
28 | 28 | let owner = match getString(this, ("owner_" + assetID)) { | |
29 | 29 | case a: String => | |
30 | 30 | a | |
31 | 31 | case _ => | |
32 | 32 | "" | |
33 | 33 | } | |
34 | 34 | let wait = match getInteger(this, ("wait_" + assetID)) { | |
35 | 35 | case a: Int => | |
36 | 36 | a | |
37 | 37 | case _ => | |
38 | 38 | 0 | |
39 | 39 | } | |
40 | 40 | let caller = toBase58String(i.caller.bytes) | |
41 | 41 | let newWait = (lastBlock.height + 100) | |
42 | 42 | let count = ((lastBlock.height % 100) + 1) | |
43 | 43 | if ((caller != owner)) | |
44 | 44 | then throw("You are not owner!") | |
45 | 45 | else if ((wait > lastBlock.height)) | |
46 | 46 | then throw((("Still wait block " + toString(lastBlock.height)) + " for forest-walking")) | |
47 | - | else [ScriptTransfer(i.caller, count, | |
47 | + | else [ScriptTransfer(i.caller, count, GOLD), IntegerEntry(("wait_" + assetID), newWait)] | |
48 | 48 | } | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | ||
52 | 52 | @Callable(i) | |
53 | 53 | func goToAdventure (assetID) = { | |
54 | 54 | let owner = match getString(this, ("owner_" + assetID)) { | |
55 | 55 | case a: String => | |
56 | 56 | a | |
57 | 57 | case _ => | |
58 | 58 | "" | |
59 | 59 | } | |
60 | 60 | let wait = match getInteger(this, ("wait_" + assetID)) { | |
61 | 61 | case a: Int => | |
62 | 62 | a | |
63 | 63 | case _ => | |
64 | 64 | 0 | |
65 | 65 | } | |
66 | 66 | let caller = toBase58String(i.caller.bytes) | |
67 | 67 | let newWait = (lastBlock.height + 100) | |
68 | 68 | if ((caller != owner)) | |
69 | 69 | then throw("You are not owner!") | |
70 | 70 | else if ((wait > lastBlock.height)) | |
71 | 71 | then throw((("Still wait block " + toString(lastBlock.height)) + " for new adventure")) | |
72 | 72 | else [ScriptTransfer(i.caller, 500000, JPN), IntegerEntry(("wait_" + assetID), newWait)] | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 |
github/deemru/w8io/169f3d6 29.85 ms ◑