tx · 9GZX2QiM9Rquy8zeDhB7QBTauQwHsrg75JsTVp2MUjGQ 3NCUy4yewhhgobHrkdSBNiCYajzXApktxaK: -0.04000000 Waves 2019.09.24 12:37 [690250] smart account 3NCUy4yewhhgobHrkdSBNiCYajzXApktxaK > SELF 0.00000000 Waves
{ "type": 13, "id": "9GZX2QiM9Rquy8zeDhB7QBTauQwHsrg75JsTVp2MUjGQ", "fee": 4000000, "feeAssetId": null, "timestamp": 1569317756742, "version": 1, "sender": "3NCUy4yewhhgobHrkdSBNiCYajzXApktxaK", "senderPublicKey": "AEBLjt3LBirAMqq8TDdsSedvidamCEi6fV1nhL2DEpew", "proofs": [ "TeR6oAsX37ViMihtog46MFkiZjdwejN87FuyJfAKHtZFJn2Ho7VmvxHXL9ZTW3mUgvzpYhEcme5zjtwicPtvcPo" ], "script": "base64:AAIDAAAAAAAAAAAAAAAKAAAAAA5vd25lclB1YmxpY0tleQEAAAAgkD7fCqmCHKVfL8+fGFXRYhqUJqS1aPUU7D38lld+FgAAAAAAH2Rlc3RpbmF0aW9uV2FsbGV0QWRkcmVzc0RhdGFLZXkCAAAAGmRlc3RpbmF0aW9uX3dhbGxldF9hZGRyZXNzAQAAABFnZXRMb290Qm94RGF0YUtleQAAAAEAAAACaWQJAAEsAAAAAgIAAAAJbG9vdF9ib3hfBQAAAAJpZAEAAAAWZ2V0TG9vdEJveFByaWNlRGF0YUtleQAAAAEAAAACaWQJAAEsAAAAAgkBAAAAEWdldExvb3RCb3hEYXRhS2V5AAAAAQUAAAACaWQCAAAABl9wcmljZQEAAAAWZ2V0TG9vdEJveExpbWl0RGF0YUtleQAAAAEAAAACaWQJAAEsAAAAAgkBAAAAEWdldExvb3RCb3hEYXRhS2V5AAAAAQUAAAACaWQCAAAABl9saW1pdAEAAAAZZ2V0TG9vdEJveEJ1eUNvdW50RGF0YUtleQAAAAEAAAACaWQJAAEsAAAAAgkBAAAAEWdldExvb3RCb3hEYXRhS2V5AAAAAQUAAAACaWQCAAAACl9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ltaXQCAAAAISBpdGVtcyBkdWUgbGltaXQsIGN1cnJlbnQgY291bnQ6IAkAAaQAAAABBQAAAAhidXlDb3VudAkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABlnZXRMb290Qm94QnV5Q291bnREYXRhS2V5AAAAAQUAAAAFaWRTdHIFAAAAC25ld0J1eUNvdW50BQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAG2dldERlc3RpbmF0aW9uV2FsbGV0QWRkcmVzcwAAAAAFAAAADHBsYXllclBheVN1bQUAAAAEdW5pdAUAAAADbmlsAAAAADtayXE=", "chainId": 84, "height": 690250, "spentComplexity": 0 } View: original | compacted Prev: 3qomQQsHPbsF4SY7KxySSVT4iwvH8S8MFeHFGsEKzxSs Next: none Diff:
Old | New | Differences | |
---|---|---|---|
93 | 93 | let r = toString(d) | |
94 | 94 | let s = extract(n.payment) | |
95 | 95 | if (isDefined(s.assetId)) | |
96 | - | then throw("Can | |
96 | + | then throw("Can hold waves only at the moment") | |
97 | 97 | else { | |
98 | 98 | let t = m(r) | |
99 | 99 | let u = (t + 1) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'Ai5K72PXnQpuH5CCLZcpZWSPGyvSmuBY9PHhFEQStzX9' | |
5 | 5 | ||
6 | 6 | let b = "destination_wallet_address" | |
7 | 7 | ||
8 | 8 | func c (d) = ("loot_box_" + d) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | func e (d) = (c(d) + "_price") | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func f (d) = (c(d) + "_limit") | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func g (d) = (c(d) + "_buy_count") | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func h () = { | |
21 | 21 | let i = getString(this, b) | |
22 | 22 | if ($isInstanceOf(i, "String")) | |
23 | 23 | then { | |
24 | 24 | let j = i | |
25 | 25 | if ((j == "")) | |
26 | 26 | then throw("Destination wallet address cannot be empty") | |
27 | 27 | else addressFromStringValue(j) | |
28 | 28 | } | |
29 | 29 | else throw("Destination wallet address undefined") | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func k (d) = { | |
34 | 34 | let i = getInteger(this, e(d)) | |
35 | 35 | if ($isInstanceOf(i, "Int")) | |
36 | 36 | then { | |
37 | 37 | let j = i | |
38 | 38 | j | |
39 | 39 | } | |
40 | 40 | else throw("Loot box price undefined") | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func l (d) = { | |
45 | 45 | let i = getInteger(this, f(d)) | |
46 | 46 | if ($isInstanceOf(i, "Int")) | |
47 | 47 | then { | |
48 | 48 | let j = i | |
49 | 49 | j | |
50 | 50 | } | |
51 | 51 | else throw("Loot box limit undefined") | |
52 | 52 | } | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func m (d) = { | |
56 | 56 | let i = getInteger(this, g(d)) | |
57 | 57 | if ($isInstanceOf(i, "Int")) | |
58 | 58 | then { | |
59 | 59 | let j = i | |
60 | 60 | j | |
61 | 61 | } | |
62 | 62 | else 0 | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | @Callable(n) | |
67 | 67 | func setDestinationWallet (o) = if ((n.callerPublicKey != a)) | |
68 | 68 | then throw("Only owner can call this method") | |
69 | 69 | else if ((o == "")) | |
70 | 70 | then throw("Address cannot be empty") | |
71 | 71 | else WriteSet([DataEntry(b, o)]) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | ||
75 | 75 | @Callable(n) | |
76 | 76 | func setLootBoxInfo (d,p,q) = if ((n.callerPublicKey != a)) | |
77 | 77 | then throw("Only owner can call this method") | |
78 | 78 | else if ((d == 0)) | |
79 | 79 | then throw("Loot id undefined") | |
80 | 80 | else if ((p == 0)) | |
81 | 81 | then throw("Price undefined") | |
82 | 82 | else if ((q == 0)) | |
83 | 83 | then throw("Limit undefined") | |
84 | 84 | else { | |
85 | 85 | let r = toString(d) | |
86 | 86 | WriteSet([DataEntry(e(r), p), DataEntry(f(r), q)]) | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | ||
91 | 91 | @Callable(n) | |
92 | 92 | func buyLootBox (d) = { | |
93 | 93 | let r = toString(d) | |
94 | 94 | let s = extract(n.payment) | |
95 | 95 | if (isDefined(s.assetId)) | |
96 | - | then throw("Can | |
96 | + | then throw("Can hold waves only at the moment") | |
97 | 97 | else { | |
98 | 98 | let t = m(r) | |
99 | 99 | let u = (t + 1) | |
100 | 100 | let v = l(r) | |
101 | 101 | let w = k(r) | |
102 | 102 | let x = s.amount | |
103 | 103 | if ((x != w)) | |
104 | 104 | then throw(((("Price must be equal " + toString(w)) + " wavelets, given: ") + toString(x))) | |
105 | 105 | else if ((u > v)) | |
106 | 106 | then throw(((("Cannot sale more " + toString(v)) + " items due limit, current count: ") + toString(t))) | |
107 | 107 | else ScriptResult(WriteSet([DataEntry(g(r), u)]), TransferSet([ScriptTransfer(h(), x, unit)])) | |
108 | 108 | } | |
109 | 109 | } | |
110 | 110 | ||
111 | 111 |
github/deemru/w8io/169f3d6 35.49 ms ◑