tx · BmBn2N8FN3kBp5iCMvYuidkkwNoqVVAA1WywhH57VCL2
3N3FtJGWEXex57HajuvYKKHU33PS4fwmQH6: -0.01000000 Waves
2021.06.30 21:22 [1593472] smart account 3N3FtJGWEXex57HajuvYKKHU33PS4fwmQH6 > SELF 0.00000000 Waves
{
"type": 13,
"id": "BmBn2N8FN3kBp5iCMvYuidkkwNoqVVAA1WywhH57VCL2",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1625077314979,
"version": 2,
"chainId": 84,
"sender": "3N3FtJGWEXex57HajuvYKKHU33PS4fwmQH6",
"senderPublicKey": "4f5Wt4MDH3Qt6DMuZQid3zoj463xCUkNdUWjUcChuedh",
"proofs": [
"61fG5Kn6PwSqJtJRi4DpMT5zZvsr5U83ntSYMJieB4fNZVX4Ts8JcwuzHSDTznAD44B8QwLiznUN1LGMV8VBcwoj"
],
"script": "base64:AAIFAAAAAAAAABYIAhIDCgEIEgMKAQgSAwoBCBIDCgEIAAAAAwAAAAADSlBOAQAAACBFqLGvjcwUgk68Uea/woMfyoMncahjkWcixg2ZF+iMxQAAAAAER09MRAEAAAAgLR44CaQZZUypJtV0fmMzG/7TvBdMmwMi7yR7k3IM0LwAAAAACUJMT0NLU1RFUAAAAAAAAAAACgAAAAQAAAABaQEAAAAHYnV5VW5pdAAAAAEAAAAHYXNzZXRJRAQAAAAEY29zdAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzCQABLAAAAAICAAAABWNvc3RfBQAAAAdhc3NldElEAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAAA3BtdAkBAAAABXZhbHVlAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAVd29ya3Mgd2l0aCB3YXZlcyBvbmx5Aw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xlcgkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAduZXdXYWl0CQAAZAAAAAIIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0BQAAAAlCTE9DS1NURVADCQEAAAACIT0AAAACBQAAAAZjYWxsZXIFAAAABW93bmVyCQAAAgAAAAECAAAAEllvdSBhcmUgbm90IG93bmVyIQMJAABmAAAAAgUAAAAEd2FpdAgFAAAACWxhc3RCbG9jawAAAAZoZWlnaHQJAAACAAAAAQkAASwAAAACCQABLAAAAAICAAAAEVN0aWxsIHdhaXQgYmxvY2sgCQABpAAAAAEIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0AgAAABIgZm9yIG5ldyBhZHZlbnR1cmUJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAB6EgBQAAAANKUE4JAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAFd2FpdF8FAAAAB2Fzc2V0SUQFAAAAB25ld1dhaXQFAAAAA25pbAAAAAACciah",
"height": 1593472,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: Bc3NeHf2UbmGWm2piEERq94ZSWDRr4qQs4TZed4QJmKP
Next: FaMJ1CiQ4NChrg6EwGxVS1eaNs4DJsAB4gATKKfgF2SJ
Diff:
Old | New | | Differences |
---|
4 | 4 | | let JPN = base58'5gvKrU3yetdPyMisTo8JiE737U9ZXLp4XkCy2aeE7BbA' |
---|
5 | 5 | | |
---|
6 | 6 | | let GOLD = base58'4385BhNBpLMpBM2Gdt8Z6edjdxYgV4Eb2eE5VvUmxrLK' |
---|
| 7 | + | |
---|
| 8 | + | let BLOCKSTEP = 10 |
---|
7 | 9 | | |
---|
8 | 10 | | @Callable(i) |
---|
9 | 11 | | func buyUnit (assetID) = { |
---|
|
24 | 26 | | |
---|
25 | 27 | | |
---|
26 | 28 | | @Callable(i) |
---|
| 29 | + | func fightWith (samu1) = { |
---|
| 30 | + | let nftData1 = fromBase58String(samu1) |
---|
| 31 | + | let x = match assetInfo(nftData1) { |
---|
| 32 | + | case asset: Asset => |
---|
| 33 | + | asset.name |
---|
| 34 | + | case _ => |
---|
| 35 | + | throw("Can't find asset") |
---|
| 36 | + | } |
---|
| 37 | + | throw(x) |
---|
| 38 | + | } |
---|
| 39 | + | |
---|
| 40 | + | |
---|
| 41 | + | |
---|
| 42 | + | @Callable(i) |
---|
27 | 43 | | func goToForest (assetID) = { |
---|
28 | 44 | | let owner = match getString(this, ("owner_" + assetID)) { |
---|
29 | 45 | | case a: String => |
---|
|
38 | 54 | | 0 |
---|
39 | 55 | | } |
---|
40 | 56 | | let caller = toBase58String(i.caller.bytes) |
---|
41 | | - | let newWait = (lastBlock.height + 100) |
---|
| 57 | + | let newWait = (lastBlock.height + (BLOCKSTEP * 3)) |
---|
42 | 58 | | let count = ((lastBlock.height % 100) + 1) |
---|
43 | 59 | | if ((caller != owner)) |
---|
44 | 60 | | then throw("You are not owner!") |
---|
|
64 | 80 | | 0 |
---|
65 | 81 | | } |
---|
66 | 82 | | let caller = toBase58String(i.caller.bytes) |
---|
67 | | - | let newWait = (lastBlock.height + 100) |
---|
| 83 | + | let newWait = (lastBlock.height + BLOCKSTEP) |
---|
68 | 84 | | if ((caller != owner)) |
---|
69 | 85 | | then throw("You are not owner!") |
---|
70 | 86 | | else if ((wait > lastBlock.height)) |
---|
Full:
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 | + | |
---|
| 8 | + | let BLOCKSTEP = 10 |
---|
7 | 9 | | |
---|
8 | 10 | | @Callable(i) |
---|
9 | 11 | | func buyUnit (assetID) = { |
---|
10 | 12 | | let cost = match getInteger(this, ("cost_" + assetID)) { |
---|
11 | 13 | | case a: Int => |
---|
12 | 14 | | a |
---|
13 | 15 | | case _ => |
---|
14 | 16 | | 0 |
---|
15 | 17 | | } |
---|
16 | 18 | | let pmt = value(i.payments[0]) |
---|
17 | 19 | | if (isDefined(pmt.assetId)) |
---|
18 | 20 | | then throw("works with waves only") |
---|
19 | 21 | | else if ((pmt.amount != cost)) |
---|
20 | 22 | | then throw("Wrong cost") |
---|
21 | 23 | | else [ScriptTransfer(i.caller, 1, fromBase58String(assetID)), StringEntry(("owner_" + assetID), toBase58String(i.caller.bytes))] |
---|
22 | 24 | | } |
---|
23 | 25 | | |
---|
24 | 26 | | |
---|
25 | 27 | | |
---|
26 | 28 | | @Callable(i) |
---|
| 29 | + | func fightWith (samu1) = { |
---|
| 30 | + | let nftData1 = fromBase58String(samu1) |
---|
| 31 | + | let x = match assetInfo(nftData1) { |
---|
| 32 | + | case asset: Asset => |
---|
| 33 | + | asset.name |
---|
| 34 | + | case _ => |
---|
| 35 | + | throw("Can't find asset") |
---|
| 36 | + | } |
---|
| 37 | + | throw(x) |
---|
| 38 | + | } |
---|
| 39 | + | |
---|
| 40 | + | |
---|
| 41 | + | |
---|
| 42 | + | @Callable(i) |
---|
27 | 43 | | func goToForest (assetID) = { |
---|
28 | 44 | | let owner = match getString(this, ("owner_" + assetID)) { |
---|
29 | 45 | | case a: String => |
---|
30 | 46 | | a |
---|
31 | 47 | | case _ => |
---|
32 | 48 | | "" |
---|
33 | 49 | | } |
---|
34 | 50 | | let wait = match getInteger(this, ("wait_" + assetID)) { |
---|
35 | 51 | | case a: Int => |
---|
36 | 52 | | a |
---|
37 | 53 | | case _ => |
---|
38 | 54 | | 0 |
---|
39 | 55 | | } |
---|
40 | 56 | | let caller = toBase58String(i.caller.bytes) |
---|
41 | | - | let newWait = (lastBlock.height + 100) |
---|
| 57 | + | let newWait = (lastBlock.height + (BLOCKSTEP * 3)) |
---|
42 | 58 | | let count = ((lastBlock.height % 100) + 1) |
---|
43 | 59 | | if ((caller != owner)) |
---|
44 | 60 | | then throw("You are not owner!") |
---|
45 | 61 | | else if ((wait > lastBlock.height)) |
---|
46 | 62 | | then throw((("Still wait block " + toString(lastBlock.height)) + " for forest-walking")) |
---|
47 | 63 | | else [ScriptTransfer(i.caller, count, GOLD), IntegerEntry(("wait_" + assetID), newWait)] |
---|
48 | 64 | | } |
---|
49 | 65 | | |
---|
50 | 66 | | |
---|
51 | 67 | | |
---|
52 | 68 | | @Callable(i) |
---|
53 | 69 | | func goToAdventure (assetID) = { |
---|
54 | 70 | | let owner = match getString(this, ("owner_" + assetID)) { |
---|
55 | 71 | | case a: String => |
---|
56 | 72 | | a |
---|
57 | 73 | | case _ => |
---|
58 | 74 | | "" |
---|
59 | 75 | | } |
---|
60 | 76 | | let wait = match getInteger(this, ("wait_" + assetID)) { |
---|
61 | 77 | | case a: Int => |
---|
62 | 78 | | a |
---|
63 | 79 | | case _ => |
---|
64 | 80 | | 0 |
---|
65 | 81 | | } |
---|
66 | 82 | | let caller = toBase58String(i.caller.bytes) |
---|
67 | | - | let newWait = (lastBlock.height + 100) |
---|
| 83 | + | let newWait = (lastBlock.height + BLOCKSTEP) |
---|
68 | 84 | | if ((caller != owner)) |
---|
69 | 85 | | then throw("You are not owner!") |
---|
70 | 86 | | else if ((wait > lastBlock.height)) |
---|
71 | 87 | | then throw((("Still wait block " + toString(lastBlock.height)) + " for new adventure")) |
---|
72 | 88 | | else [ScriptTransfer(i.caller, 500000, JPN), IntegerEntry(("wait_" + assetID), newWait)] |
---|
73 | 89 | | } |
---|
74 | 90 | | |
---|
75 | 91 | | |
---|