tx · 5xZWcZmZPJ4qRuFFUPsJGimYwQPBKsVdKMJAs3H8vGd3 3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4: -0.01400000 Waves 2020.03.11 21:44 [904857] smart account 3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4 > SELF 0.00000000 Waves
{ "type": 13, "id": "5xZWcZmZPJ4qRuFFUPsJGimYwQPBKsVdKMJAs3H8vGd3", "fee": 1400000, "feeAssetId": null, "timestamp": 1583952128829, "version": 1, "sender": "3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4", "senderPublicKey": "4AHsCbS9QYVdKNvxrPWwsMwwy3KqXaCMXeAscExJZk9L", "proofs": [ "33kQFFsj6EsfuFtnxchzvyEKmUbEo9vXbJdeJz99CeipDp76muC5TcYfYavXx2Hp9FKx7QacZCKXS1iCxEJZTyPv" ], "script": "base64:AAIDAAAAAAAAABMIARIGCgQIAQEIEgcKBQgICAEBAAAAHQAAAAAHYUJpdENPMgEAAAAgx/h6AJ03UJ8qMmy7JIhz3VjOE4OL3ofCGi0oG2fBKJYAAAAACHN0YXJ0UXR5AAAAAAAABRQAAAAAAAhub21QcmljZQAAAAAABfXhAAAAAAAQc3VwcGxpZXJEaXNjb3VudAAAAAAAAAAADAAAAAAOT3duZXJFY29QdWJLZXkBAAAAIC70W6NACRoO8DcwW0R46ze+bNGLr0tg3cAkNP8WNkAfAAAAAAN3dnMAAAAAAAX14QAAAAAABE5PTkUCAAAABG5vbmUAAAAABmlzc3VlcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVMr3Oz7nL9FV4g+t+EWzLN77jdANRWt9bwEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAADbnVtBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABQAAAANudW0BAAAA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AAIYnV5T3JkZXIAAAAJYm9keUJ5dGVzCQABkQAAAAIICAUAAAACdHgAAAAIYnV5T3JkZXIAAAAGcHJvb2ZzAAAAAAAAAAAACAgFAAAAAnR4AAAACGJ1eU9yZGVyAAAAD3NlbmRlclB1YmxpY0tleQQAAAAPc2VsbE9yZGVyU2VuZGVyCQACWAAAAAEICAgFAAAAAnR4AAAACXNlbGxPcmRlcgAAAAZzZW5kZXIAAAAFYnl0ZXMEAAAACW1pbkFtb3VudAAAAAAAAAAAAQQAAAAJbWF4QW1vdW50AAAAAAAAAAAEBAAAAAhtYXhQcmljZQkAAGgAAAACBQAAAAltYXhBbW91bnQFAAAACG5vbVByaWNlAwMFAAAAA2J1eQMJAQAAAAlpc0RlZmluZWQAAAABCQAAZwAAAAIFAAAACG1heFByaWNlCAgFAAAAAnR4AAAACGJ1eU9yZGVyAAAABXByaWNlBgkAAAIAAAABAgAAADpFbCBtb250byBhIHBhZ2FyIG5vIHB1ZWRlIHNlciBtZW5vciBxdWUgZWwgcHJlY2lvIGRlIHZlbnRhBwYDBQAAAARzZWxsAwMDCQAAAAAAAAIICAUAAAACdHgAAAAJc2VsbE9yZGVyAAAABnNlbmRlcgUAAAAGaXNzdWVyCQAAZwAAAAIIBQAAAAJ0eAAAAAZhbW91bnQFAAAACW1pbkFtb3VudAcJAABnAAAAAgUAAAAJbWF4QW1vdW50CAUAAAACdHgAAAAGYW1vdW50BwYJAAACAAAAAQIAAABTRXJyb3I6IE1pbmltdW0gYW1vdW50OiAxIGFCaXRDTzI7IE1heGltdW0gYW1vdW50IG9mZmVyZWQ6IDQgYUJpdENPMiBieSBVc2VyIEFjY291bnQHAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgQAAAABYwUAAAAHJG1hdGNoMAYHqnCivw==", "chainId": 84, "height": 904857, "spentComplexity": 0 } View: original | compacted Prev: D7iDaKdtjXP65DcNS7FCMHx7T4zTxFBLHR8352cYakdP Next: 98nrw2wDGF8vdLvZSFQSCngjzaF9FGeNYQSKLkcUshfj Diff:
Old | New | Differences | |
---|---|---|---|
174 | 174 | else if ($isInstanceOf(l, "TransferTransaction")) | |
175 | 175 | then { | |
176 | 176 | let Y = l | |
177 | - | true | |
177 | + | let ac = toBase58String(addressFromRecipient(Y.recipient).bytes) | |
178 | + | if ((Y.sender == h)) | |
179 | + | then true | |
180 | + | else throw("You can't transferred this token") | |
178 | 181 | } | |
179 | 182 | else if ($isInstanceOf(l, "ExchangeTransaction")) | |
180 | 183 | then { | |
181 | 184 | let Y = l | |
182 | - | let | |
185 | + | let ad = if (!(isDefined(Y.sellOrder.assetPair.priceAsset))) | |
183 | 186 | then true | |
184 | 187 | else !(isDefined(Y.sellOrder.assetPair.amountAsset)) | |
185 | - | | |
188 | + | ad | |
186 | 189 | } | |
187 | - | else if ($isInstanceOf(l, " | |
190 | + | else if ($isInstanceOf(l, "ExchangeTransaction")) | |
188 | 191 | then { | |
189 | - | let ad = l | |
190 | - | true | |
192 | + | let Y = l | |
193 | + | let ae = Y.proofs[1] | |
194 | + | let af = addressFromPublicKey(ae) | |
195 | + | let ag = 1400000 | |
196 | + | let ah = ((wavesBalance(af) - ag) >= Y.buyOrder.price) | |
197 | + | let ai = sigVerify(Y.sellOrder.bodyBytes, Y.sellOrder.proofs[0], Y.sellOrder.senderPublicKey) | |
198 | + | let aj = sigVerify(Y.buyOrder.bodyBytes, Y.buyOrder.proofs[0], Y.buyOrder.senderPublicKey) | |
199 | + | let ak = toBase58String(Y.sellOrder.sender.bytes) | |
200 | + | let al = 1 | |
201 | + | let am = 4 | |
202 | + | let an = (am * c) | |
203 | + | if (if (aj) | |
204 | + | then if (isDefined((an >= Y.buyOrder.price))) | |
205 | + | then true | |
206 | + | else throw("El monto a pagar no puede ser menor que el precio de venta") | |
207 | + | else false) | |
208 | + | then true | |
209 | + | else if (ai) | |
210 | + | then if (if (if ((Y.sellOrder.sender == h)) | |
211 | + | then (Y.amount >= al) | |
212 | + | else false) | |
213 | + | then (am >= Y.amount) | |
214 | + | else false) | |
215 | + | then true | |
216 | + | else throw("Error: Minimum amount: 1 aBitCO2; Maximum amount offered: 4 aBitCO2 by User Account") | |
217 | + | else false | |
191 | 218 | } | |
192 | - | else false | |
219 | + | else if ($isInstanceOf(l, "InvokeScriptTransaction")) | |
220 | + | then { | |
221 | + | let ao = l | |
222 | + | true | |
223 | + | } | |
224 | + | else false | |
193 | 225 | } | |
194 | 226 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'ETbtNp6MBuSM9EfjmLDwctrYEBBiq8CZ7ti7zbwTktry' | |
5 | 5 | ||
6 | 6 | let b = 332800 | |
7 | 7 | ||
8 | 8 | let c = 100000000 | |
9 | 9 | ||
10 | 10 | let d = 12 | |
11 | 11 | ||
12 | 12 | let e = base58'4AHsCbS9QYVdKNvxrPWwsMwwy3KqXaCMXeAscExJZk9L' | |
13 | 13 | ||
14 | 14 | let f = 100000000 | |
15 | 15 | ||
16 | 16 | let g = "none" | |
17 | 17 | ||
18 | 18 | let h = Address(base58'3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4') | |
19 | 19 | ||
20 | 20 | func i (j) = { | |
21 | 21 | let k = { | |
22 | 22 | let l = getInteger(this, j) | |
23 | 23 | if ($isInstanceOf(l, "Int")) | |
24 | 24 | then { | |
25 | 25 | let m = l | |
26 | 26 | m | |
27 | 27 | } | |
28 | 28 | else 0 | |
29 | 29 | } | |
30 | 30 | k | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func n (j) = { | |
35 | 35 | let o = { | |
36 | 36 | let l = getString(this, j) | |
37 | 37 | if ($isInstanceOf(l, "String")) | |
38 | 38 | then { | |
39 | 39 | let m = l | |
40 | 40 | m | |
41 | 41 | } | |
42 | 42 | else g | |
43 | 43 | } | |
44 | 44 | o | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func p (q,r) = ("tokens_Bit-CO2:_" + toBase58String(sha256(toBytes((q + r))))) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func s (t) = (t + "_to_Amazonian_Conservation") | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func u (t) = n(s(t)) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func v (t) = "Tokens_ofertados,_Saldo" | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func w (t) = i(v(t)) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func x (t) = (t + "_description") | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func y (z,t) = (((t + "_") + z) + "_cnt") | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func A (z,t) = i(y(z, t)) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func B (t) = "_userdata" | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func C (t) = "_tokens" | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func D (t) = i(C(t)) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func E (q) = "Seller_Balance:_waves" | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func F (q) = i(E(q)) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func G (t) = "Project_name:" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func H (t) = n(G(t)) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func I (t) = "_%" | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func J (t) = i(I(t)) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func K (t) = "_waves" | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func L (t) = i(K(t)) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | @Callable(M) | |
106 | 106 | func AddSupplierToken (r,N,d,O) = { | |
107 | 107 | let q = toBase58String(M.caller.bytes) | |
108 | 108 | let t = p(q, r) | |
109 | 109 | if ((0 >= N)) | |
110 | 110 | then throw("Sorry, insufficient token offer") | |
111 | 111 | else WriteSet([DataEntry(("Ofertante:_" + s(t)), q), DataEntry(v(t), N), DataEntry(("Precio_Nominal:" + K(t)), c), DataEntry(("Max_Descuento_ofrecido:" + I(t)), d), DataEntry(x(t), O)]) | |
112 | 112 | } | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | ||
116 | 116 | @Callable(M) | |
117 | 117 | func PurchaseToken (t,P,Q,R,S) = { | |
118 | 118 | let T = extract(M.payment) | |
119 | 119 | if (isDefined(T.assetId)) | |
120 | 120 | then throw("you can adquire cBitCO2 only by Waves tokens") | |
121 | 121 | else { | |
122 | 122 | let q = { | |
123 | 123 | let l = getString(this, s(t)) | |
124 | 124 | if ($isInstanceOf(l, "String")) | |
125 | 125 | then { | |
126 | 126 | let m = l | |
127 | 127 | m | |
128 | 128 | } | |
129 | 129 | else g | |
130 | 130 | } | |
131 | 131 | let N = { | |
132 | 132 | let l = getInteger(this, v(t)) | |
133 | 133 | if ($isInstanceOf(l, "Int")) | |
134 | 134 | then { | |
135 | 135 | let m = l | |
136 | 136 | m | |
137 | 137 | } | |
138 | 138 | else b | |
139 | 139 | } | |
140 | 140 | let U = { | |
141 | 141 | let l = getInteger(this, E(q)) | |
142 | 142 | if ($isInstanceOf(l, "Int")) | |
143 | 143 | then { | |
144 | 144 | let m = l | |
145 | 145 | m | |
146 | 146 | } | |
147 | 147 | else 0 | |
148 | 148 | } | |
149 | 149 | let V = toBase58String(M.caller.bytes) | |
150 | 150 | let W = ((c * (100 - S)) / 100) | |
151 | 151 | let X = (R * W) | |
152 | 152 | if ((X > T.amount)) | |
153 | 153 | then throw("Payment Amount cannot be less than item Purchase Order") | |
154 | 154 | else if ((T.amount > X)) | |
155 | 155 | then throw("Payment Amount can't be higher than item Purchase Order") | |
156 | 156 | else ScriptResult(WriteSet([DataEntry(y(V, t), (A(V, t) + 1)), DataEntry(G(t), P), DataEntry(B(t), Q), DataEntry(("Cantidad_solicitada:" + C(t)), R), DataEntry(("Request_Status:_" + V), "confirmed"), DataEntry(v(t), (N - R)), DataEntry(E(q), (U + T.amount))]), TransferSet(nil)) | |
157 | 157 | } | |
158 | 158 | } | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | @Verifier(Y) | |
162 | 162 | func Z () = { | |
163 | 163 | let l = Y | |
164 | 164 | if ($isInstanceOf(l, "SetScriptTransaction")) | |
165 | 165 | then { | |
166 | 166 | let aa = l | |
167 | 167 | sigVerify(Y.bodyBytes, Y.proofs[0], e) | |
168 | 168 | } | |
169 | 169 | else if ($isInstanceOf(l, "DataTransaction")) | |
170 | 170 | then { | |
171 | 171 | let ab = l | |
172 | 172 | true | |
173 | 173 | } | |
174 | 174 | else if ($isInstanceOf(l, "TransferTransaction")) | |
175 | 175 | then { | |
176 | 176 | let Y = l | |
177 | - | true | |
177 | + | let ac = toBase58String(addressFromRecipient(Y.recipient).bytes) | |
178 | + | if ((Y.sender == h)) | |
179 | + | then true | |
180 | + | else throw("You can't transferred this token") | |
178 | 181 | } | |
179 | 182 | else if ($isInstanceOf(l, "ExchangeTransaction")) | |
180 | 183 | then { | |
181 | 184 | let Y = l | |
182 | - | let | |
185 | + | let ad = if (!(isDefined(Y.sellOrder.assetPair.priceAsset))) | |
183 | 186 | then true | |
184 | 187 | else !(isDefined(Y.sellOrder.assetPair.amountAsset)) | |
185 | - | | |
188 | + | ad | |
186 | 189 | } | |
187 | - | else if ($isInstanceOf(l, " | |
190 | + | else if ($isInstanceOf(l, "ExchangeTransaction")) | |
188 | 191 | then { | |
189 | - | let ad = l | |
190 | - | true | |
192 | + | let Y = l | |
193 | + | let ae = Y.proofs[1] | |
194 | + | let af = addressFromPublicKey(ae) | |
195 | + | let ag = 1400000 | |
196 | + | let ah = ((wavesBalance(af) - ag) >= Y.buyOrder.price) | |
197 | + | let ai = sigVerify(Y.sellOrder.bodyBytes, Y.sellOrder.proofs[0], Y.sellOrder.senderPublicKey) | |
198 | + | let aj = sigVerify(Y.buyOrder.bodyBytes, Y.buyOrder.proofs[0], Y.buyOrder.senderPublicKey) | |
199 | + | let ak = toBase58String(Y.sellOrder.sender.bytes) | |
200 | + | let al = 1 | |
201 | + | let am = 4 | |
202 | + | let an = (am * c) | |
203 | + | if (if (aj) | |
204 | + | then if (isDefined((an >= Y.buyOrder.price))) | |
205 | + | then true | |
206 | + | else throw("El monto a pagar no puede ser menor que el precio de venta") | |
207 | + | else false) | |
208 | + | then true | |
209 | + | else if (ai) | |
210 | + | then if (if (if ((Y.sellOrder.sender == h)) | |
211 | + | then (Y.amount >= al) | |
212 | + | else false) | |
213 | + | then (am >= Y.amount) | |
214 | + | else false) | |
215 | + | then true | |
216 | + | else throw("Error: Minimum amount: 1 aBitCO2; Maximum amount offered: 4 aBitCO2 by User Account") | |
217 | + | else false | |
191 | 218 | } | |
192 | - | else false | |
219 | + | else if ($isInstanceOf(l, "InvokeScriptTransaction")) | |
220 | + | then { | |
221 | + | let ao = l | |
222 | + | true | |
223 | + | } | |
224 | + | else false | |
193 | 225 | } | |
194 | 226 |
github/deemru/w8io/169f3d6 36.11 ms ◑