tx · 894iPjxFqLcpYsmtd9R8mtGehzij8DQbRaKRQFUjnSr2 3N7MT5t1Gmyb9tcpdoUrd47pxXtTkAcgLsR: -0.01400000 Waves 2019.07.14 03:49 [584716] smart account 3N7MT5t1Gmyb9tcpdoUrd47pxXtTkAcgLsR > SELF 0.00000000 Waves
{ "type": 13, "id": "894iPjxFqLcpYsmtd9R8mtGehzij8DQbRaKRQFUjnSr2", "fee": 1400000, "feeAssetId": null, "timestamp": 1563065377008, "version": 1, "sender": "3N7MT5t1Gmyb9tcpdoUrd47pxXtTkAcgLsR", "senderPublicKey": "Adn8NfJZ8ZXuWNMXb9VaY6X6kh6k6G3KMb1WQUesFUV", "proofs": [ "2PA3sVcPxEMYj5JLLw6Zw1BnC6xDdoB64RuNzFwBjABwcgwRib4kNr5CRhC8eybqtruun4tj2Ci8kpWCM2Zwv5ok" ], "script": "base64:AAIDAAAAAAAAAAAAAAAXAAAAAA5vd25lclB1YmxpY0tleQEAAAAgAnfP9tCFuj2k2BUY5PW9DVGxrCHBHKJwugv8WyiaGXIAAAAABE5PTkUCAAAABG5vbmUBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAA251bQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAUAAAADbnVtAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAANzdHIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUFAAAAA3N0cgEAAAAPZ2V0S2V5SXRlbVByaWNlAAAAAQAAAARpdGVtCQABLAAAAAIFAAAABGl0ZW0CAAAABl9wcmljZQEAAAARZ2V0VmFsdWVJdG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zvqiAPqYjPdJdosZ63qvimexPF7 Diff:
Old | New | Differences | |
---|---|---|---|
147 | 147 | let R = f | |
148 | 148 | true | |
149 | 149 | } | |
150 | - | else false | |
150 | + | else if ($isInstanceOf(f, "TransferTransaction")) | |
151 | + | then { | |
152 | + | let R = f | |
153 | + | true | |
154 | + | } | |
155 | + | else false | |
151 | 156 | } | |
152 | 157 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'Adn8NfJZ8ZXuWNMXb9VaY6X6kh6k6G3KMb1WQUesFUV' | |
5 | 5 | ||
6 | 6 | let b = "none" | |
7 | 7 | ||
8 | 8 | func c (d) = { | |
9 | 9 | let e = { | |
10 | 10 | let f = getInteger(this, d) | |
11 | 11 | if ($isInstanceOf(f, "Int")) | |
12 | 12 | then { | |
13 | 13 | let g = f | |
14 | 14 | g | |
15 | 15 | } | |
16 | 16 | else 0 | |
17 | 17 | } | |
18 | 18 | e | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func h (d) = { | |
23 | 23 | let i = { | |
24 | 24 | let f = getString(this, d) | |
25 | 25 | if ($isInstanceOf(f, "String")) | |
26 | 26 | then { | |
27 | 27 | let g = f | |
28 | 28 | g | |
29 | 29 | } | |
30 | 30 | else b | |
31 | 31 | } | |
32 | 32 | i | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func j (k) = (k + "_price") | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func l (k) = c(j(k)) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func m (n,k) = (((k + "_") + n) + "_cnt") | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func o (n,k) = c(m(n, k)) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func p (q,r) = ("item_" + toBase58String(sha256(toBytes((q + r))))) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func s (k) = (k + "_data") | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func t (k) = (k + "_owner") | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func u (k) = h(t(k)) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func v (w) = (w + "_balance") | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func x (w) = c(v(w)) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func y (k,n) = (((k + "_") + n) + "_commit") | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func z (k,n) = h(y(k, n)) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func A (k) = (k + "_comcnt") | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func B (k) = c(A(k)) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func C (k,n) = (((k + "_") + n) + "_reveal") | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func D (k,n) = h(C(k, n)) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func E (k) = (k + "_status") | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func F (k) = h(E(k)) | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func G (k,H) = ((k + "_res:") + H) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | @Callable(I) | |
94 | 94 | func purchase (k) = { | |
95 | 95 | let J = extract(I.payment) | |
96 | 96 | if (isDefined(J.assetId)) | |
97 | 97 | then throw("can use WAVES only at the moment") | |
98 | 98 | else { | |
99 | 99 | let K = toBase58String(I.caller.bytes) | |
100 | 100 | let L = l(k) | |
101 | 101 | let M = u(k) | |
102 | 102 | if ((L > J.amount)) | |
103 | 103 | then throw("purchase amount cannot be less than item price") | |
104 | 104 | else if ((J.amount > L)) | |
105 | 105 | then throw("purchase amount cannot be higher than item price") | |
106 | 106 | else if ((M == b)) | |
107 | 107 | then throw("supplier does not exist") | |
108 | 108 | else WriteSet([DataEntry(m(K, k), (o(K, k) + 1)), DataEntry(v(M), (x(M) + J.amount))]) | |
109 | 109 | } | |
110 | 110 | } | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | ||
114 | 114 | @Callable(I) | |
115 | 115 | func withdraw () = { | |
116 | 116 | let M = toBase58String(I.caller.bytes) | |
117 | 117 | let N = x(M) | |
118 | 118 | if ((0 >= N)) | |
119 | 119 | then throw("insufficient balance") | |
120 | 120 | else ScriptResult(WriteSet([DataEntry(v(M), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(M), N, unit)])) | |
121 | 121 | } | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | ||
125 | 125 | @Callable(I) | |
126 | 126 | func addItem (r,L,O) = { | |
127 | 127 | let M = toBase58String(I.caller.bytes) | |
128 | 128 | let k = p(M, r) | |
129 | 129 | if ((0 >= L)) | |
130 | 130 | then throw("purchase amount cannot be less than item price") | |
131 | 131 | else if ((u(k) != b)) | |
132 | 132 | then throw("an item is already exist") | |
133 | 133 | else WriteSet([DataEntry(t(k), M), DataEntry(j(k), L), DataEntry(s(k), O)]) | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | @Verifier(P) | |
138 | 138 | func Q () = { | |
139 | 139 | let f = P | |
140 | 140 | if ($isInstanceOf(f, "SetScriptTransaction")) | |
141 | 141 | then { | |
142 | 142 | let R = f | |
143 | 143 | sigVerify(P.bodyBytes, P.proofs[0], a) | |
144 | 144 | } | |
145 | 145 | else if ($isInstanceOf(f, "DataTransaction")) | |
146 | 146 | then { | |
147 | 147 | let R = f | |
148 | 148 | true | |
149 | 149 | } | |
150 | - | else false | |
150 | + | else if ($isInstanceOf(f, "TransferTransaction")) | |
151 | + | then { | |
152 | + | let R = f | |
153 | + | true | |
154 | + | } | |
155 | + | else false | |
151 | 156 | } | |
152 | 157 |
github/deemru/w8io/169f3d6 38.12 ms ◑