tx · D7iDaKdtjXP65DcNS7FCMHx7T4zTxFBLHR8352cYakdP 3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4: -0.01400000 Waves 2020.03.11 16:50 [904574] smart account 3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4 > SELF 0.00000000 Waves
{ "type": 13, "id": "D7iDaKdtjXP65DcNS7FCMHx7T4zTxFBLHR8352cYakdP", "fee": 1400000, "feeAssetId": null, "timestamp": 1583934576747, "version": 1, "sender": "3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4", "senderPublicKey": "4AHsCbS9QYVdKNvxrPWwsMwwy3KqXaCMXeAscExJZk9L", "proofs": [ "4gUarJn6wwg2oSt88ApZx2ZALQffeuM8yT7VJLeBiZFe58uAG4JWxr6bA73TTbkP1LcPa3jvpQNYE9Rwchk36dFC" ], "script": "base64:AAIDAAAAAAAAABMIARIGCgQIAQEIEgcKBQgICAEBAAAAHQAAAAAHYUJpdENPMgEAAAAgx/h6AJ03UJ8qMmy7JIhz3VjOE4OL3ofCGi0oG2fBKJYAAAAACHN0YXJ0UXR5AAAAAAAABRQAAAAAAAhub21QcmljZQAAAAAABfXhAAAAAAAQc3VwcGxpZXJEaXNjb3VudAAAAAAAAAAADAAAAAAOT3duZXJFY29QdWJLZXkBAAAAIC70W6NACRoO8DcwW0R46ze+bNGLr0tg3cAkNP8WNkAfAAAAAAN3dnMAAAAAAAX14QAAAAAABE5PTkUCAAAABG5vbmUAAAAABmlzc3VlcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVMr3Oz7nL9FV4g+t+EWzLN77jdANRWt9bwEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAADbnVtBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABQAAAANudW0BAAAAC2dldFN0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aW9uBAAAAAJ0eAUAAAAHJG1hdGNoMAQAAAAJd2l0aFdhdmVzAwkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQgICAUAAAACdHgAAAAJc2VsbE9yZGVyAAAACWFzc2V0UGFpcgAAAApwcmljZUFzc2V0BgkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQgICAUAAAACdHgAAAAJc2VsbE9yZGVyAAAACWFzc2V0UGFpcgAAAAthbW91bnRBc3NldAUAAAAJd2l0aFdhdmVzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgQAAAABYwUAAAAHJG1hdGNoMAYHR6M1LQ==", "chainId": 84, "height": 904574, "spentComplexity": 0 } View: original | compacted Prev: 4yVTstQBG5Kguo2GHZzdVWgd4PwVD8gWY1ovNpzzKq9t Next: 5xZWcZmZPJ4qRuFFUPsJGimYwQPBKsVdKMJAs3H8vGd3 Diff:
Old | New | Differences | |
---|---|---|---|
72 | 72 | func B (t) = "_userdata" | |
73 | 73 | ||
74 | 74 | ||
75 | - | func C ( | |
75 | + | func C (t) = "_tokens" | |
76 | 76 | ||
77 | 77 | ||
78 | - | func | |
78 | + | func D (t) = i(C(t)) | |
79 | 79 | ||
80 | 80 | ||
81 | - | func | |
81 | + | func E (q) = "Seller_Balance:_waves" | |
82 | 82 | ||
83 | 83 | ||
84 | - | func | |
84 | + | func F (q) = i(E(q)) | |
85 | 85 | ||
86 | 86 | ||
87 | - | func | |
87 | + | func G (t) = "Project_name:" | |
88 | 88 | ||
89 | 89 | ||
90 | - | func | |
90 | + | func H (t) = n(G(t)) | |
91 | 91 | ||
92 | 92 | ||
93 | - | func | |
93 | + | func I (t) = "_%" | |
94 | 94 | ||
95 | 95 | ||
96 | - | func | |
96 | + | func J (t) = i(I(t)) | |
97 | 97 | ||
98 | 98 | ||
99 | - | func | |
99 | + | func K (t) = "_waves" | |
100 | 100 | ||
101 | 101 | ||
102 | - | func | |
102 | + | func L (t) = i(K(t)) | |
103 | 103 | ||
104 | 104 | ||
105 | - | func N (t) = "_waves" | |
106 | - | ||
107 | - | ||
108 | - | func O (t) = i(N(t)) | |
109 | - | ||
110 | - | ||
111 | - | @Callable(P) | |
112 | - | func AddSupplierToken (r,Q,d,R) = { | |
113 | - | let q = toBase58String(P.caller.bytes) | |
105 | + | @Callable(M) | |
106 | + | func AddSupplierToken (r,N,d,O) = { | |
107 | + | let q = toBase58String(M.caller.bytes) | |
114 | 108 | let t = p(q, r) | |
115 | - | if ((0 >= | |
109 | + | if ((0 >= N)) | |
116 | 110 | then throw("Sorry, insufficient token offer") | |
117 | - | else WriteSet([DataEntry(("Ofertante:_" + s(t)), q), DataEntry(v(t), | |
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)]) | |
118 | 112 | } | |
119 | 113 | ||
120 | 114 | ||
121 | 115 | ||
122 | - | @Callable( | |
123 | - | func PurchaseToken (t,S | |
124 | - | let | |
125 | - | if (isDefined( | |
116 | + | @Callable(M) | |
117 | + | func PurchaseToken (t,P,Q,R,S) = { | |
118 | + | let T = extract(M.payment) | |
119 | + | if (isDefined(T.assetId)) | |
126 | 120 | then throw("you can adquire cBitCO2 only by Waves tokens") | |
127 | 121 | else { | |
128 | 122 | let q = { | |
134 | 128 | } | |
135 | 129 | else g | |
136 | 130 | } | |
137 | - | let | |
131 | + | let N = { | |
138 | 132 | let l = getInteger(this, v(t)) | |
139 | 133 | if ($isInstanceOf(l, "Int")) | |
140 | 134 | then { | |
143 | 137 | } | |
144 | 138 | else b | |
145 | 139 | } | |
146 | - | let | |
147 | - | let l = getInteger(this, | |
140 | + | let U = { | |
141 | + | let l = getInteger(this, E(q)) | |
148 | 142 | if ($isInstanceOf(l, "Int")) | |
149 | 143 | then { | |
150 | 144 | let m = l | |
152 | 146 | } | |
153 | 147 | else 0 | |
154 | 148 | } | |
155 | - | let | |
156 | - | let | |
157 | - | let | |
158 | - | if (( | |
149 | + | let V = toBase58String(M.caller.bytes) | |
150 | + | let W = ((c * (100 - S)) / 100) | |
151 | + | let X = (R * W) | |
152 | + | if ((X > T.amount)) | |
159 | 153 | then throw("Payment Amount cannot be less than item Purchase Order") | |
160 | - | else if (( | |
154 | + | else if ((T.amount > X)) | |
161 | 155 | then throw("Payment Amount can't be higher than item Purchase Order") | |
162 | - | else ScriptResult(WriteSet([DataEntry(y( | |
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)) | |
163 | 157 | } | |
164 | 158 | } | |
165 | 159 | ||
166 | 160 | ||
167 | - | @Verifier( | |
168 | - | func | |
169 | - | let l = | |
161 | + | @Verifier(Y) | |
162 | + | func Z () = { | |
163 | + | let l = Y | |
170 | 164 | if ($isInstanceOf(l, "SetScriptTransaction")) | |
171 | 165 | then { | |
172 | - | let | |
173 | - | sigVerify( | |
166 | + | let aa = l | |
167 | + | sigVerify(Y.bodyBytes, Y.proofs[0], e) | |
174 | 168 | } | |
175 | 169 | else if ($isInstanceOf(l, "DataTransaction")) | |
176 | 170 | then { | |
177 | - | let | |
171 | + | let ab = l | |
178 | 172 | true | |
179 | 173 | } | |
180 | 174 | else if ($isInstanceOf(l, "TransferTransaction")) | |
181 | 175 | then { | |
182 | - | let | |
176 | + | let Y = l | |
183 | 177 | true | |
184 | 178 | } | |
185 | 179 | else if ($isInstanceOf(l, "ExchangeTransaction")) | |
186 | 180 | then { | |
187 | - | let | |
188 | - | let | |
181 | + | let Y = l | |
182 | + | let ac = if (!(isDefined(Y.sellOrder.assetPair.priceAsset))) | |
189 | 183 | then true | |
190 | - | else !(isDefined( | |
191 | - | | |
184 | + | else !(isDefined(Y.sellOrder.assetPair.amountAsset)) | |
185 | + | ac | |
192 | 186 | } | |
193 | 187 | else if ($isInstanceOf(l, "InvokeScriptTransaction")) | |
194 | 188 | then { | |
195 | - | let | |
189 | + | let ad = l | |
196 | 190 | true | |
197 | 191 | } | |
198 | 192 | else false |
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 | - | func C ( | |
75 | + | func C (t) = "_tokens" | |
76 | 76 | ||
77 | 77 | ||
78 | - | func | |
78 | + | func D (t) = i(C(t)) | |
79 | 79 | ||
80 | 80 | ||
81 | - | func | |
81 | + | func E (q) = "Seller_Balance:_waves" | |
82 | 82 | ||
83 | 83 | ||
84 | - | func | |
84 | + | func F (q) = i(E(q)) | |
85 | 85 | ||
86 | 86 | ||
87 | - | func | |
87 | + | func G (t) = "Project_name:" | |
88 | 88 | ||
89 | 89 | ||
90 | - | func | |
90 | + | func H (t) = n(G(t)) | |
91 | 91 | ||
92 | 92 | ||
93 | - | func | |
93 | + | func I (t) = "_%" | |
94 | 94 | ||
95 | 95 | ||
96 | - | func | |
96 | + | func J (t) = i(I(t)) | |
97 | 97 | ||
98 | 98 | ||
99 | - | func | |
99 | + | func K (t) = "_waves" | |
100 | 100 | ||
101 | 101 | ||
102 | - | func | |
102 | + | func L (t) = i(K(t)) | |
103 | 103 | ||
104 | 104 | ||
105 | - | func N (t) = "_waves" | |
106 | - | ||
107 | - | ||
108 | - | func O (t) = i(N(t)) | |
109 | - | ||
110 | - | ||
111 | - | @Callable(P) | |
112 | - | func AddSupplierToken (r,Q,d,R) = { | |
113 | - | let q = toBase58String(P.caller.bytes) | |
105 | + | @Callable(M) | |
106 | + | func AddSupplierToken (r,N,d,O) = { | |
107 | + | let q = toBase58String(M.caller.bytes) | |
114 | 108 | let t = p(q, r) | |
115 | - | if ((0 >= | |
109 | + | if ((0 >= N)) | |
116 | 110 | then throw("Sorry, insufficient token offer") | |
117 | - | else WriteSet([DataEntry(("Ofertante:_" + s(t)), q), DataEntry(v(t), | |
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)]) | |
118 | 112 | } | |
119 | 113 | ||
120 | 114 | ||
121 | 115 | ||
122 | - | @Callable( | |
123 | - | func PurchaseToken (t,S | |
124 | - | let | |
125 | - | if (isDefined( | |
116 | + | @Callable(M) | |
117 | + | func PurchaseToken (t,P,Q,R,S) = { | |
118 | + | let T = extract(M.payment) | |
119 | + | if (isDefined(T.assetId)) | |
126 | 120 | then throw("you can adquire cBitCO2 only by Waves tokens") | |
127 | 121 | else { | |
128 | 122 | let q = { | |
129 | 123 | let l = getString(this, s(t)) | |
130 | 124 | if ($isInstanceOf(l, "String")) | |
131 | 125 | then { | |
132 | 126 | let m = l | |
133 | 127 | m | |
134 | 128 | } | |
135 | 129 | else g | |
136 | 130 | } | |
137 | - | let | |
131 | + | let N = { | |
138 | 132 | let l = getInteger(this, v(t)) | |
139 | 133 | if ($isInstanceOf(l, "Int")) | |
140 | 134 | then { | |
141 | 135 | let m = l | |
142 | 136 | m | |
143 | 137 | } | |
144 | 138 | else b | |
145 | 139 | } | |
146 | - | let | |
147 | - | let l = getInteger(this, | |
140 | + | let U = { | |
141 | + | let l = getInteger(this, E(q)) | |
148 | 142 | if ($isInstanceOf(l, "Int")) | |
149 | 143 | then { | |
150 | 144 | let m = l | |
151 | 145 | m | |
152 | 146 | } | |
153 | 147 | else 0 | |
154 | 148 | } | |
155 | - | let | |
156 | - | let | |
157 | - | let | |
158 | - | if (( | |
149 | + | let V = toBase58String(M.caller.bytes) | |
150 | + | let W = ((c * (100 - S)) / 100) | |
151 | + | let X = (R * W) | |
152 | + | if ((X > T.amount)) | |
159 | 153 | then throw("Payment Amount cannot be less than item Purchase Order") | |
160 | - | else if (( | |
154 | + | else if ((T.amount > X)) | |
161 | 155 | then throw("Payment Amount can't be higher than item Purchase Order") | |
162 | - | else ScriptResult(WriteSet([DataEntry(y( | |
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)) | |
163 | 157 | } | |
164 | 158 | } | |
165 | 159 | ||
166 | 160 | ||
167 | - | @Verifier( | |
168 | - | func | |
169 | - | let l = | |
161 | + | @Verifier(Y) | |
162 | + | func Z () = { | |
163 | + | let l = Y | |
170 | 164 | if ($isInstanceOf(l, "SetScriptTransaction")) | |
171 | 165 | then { | |
172 | - | let | |
173 | - | sigVerify( | |
166 | + | let aa = l | |
167 | + | sigVerify(Y.bodyBytes, Y.proofs[0], e) | |
174 | 168 | } | |
175 | 169 | else if ($isInstanceOf(l, "DataTransaction")) | |
176 | 170 | then { | |
177 | - | let | |
171 | + | let ab = l | |
178 | 172 | true | |
179 | 173 | } | |
180 | 174 | else if ($isInstanceOf(l, "TransferTransaction")) | |
181 | 175 | then { | |
182 | - | let | |
176 | + | let Y = l | |
183 | 177 | true | |
184 | 178 | } | |
185 | 179 | else if ($isInstanceOf(l, "ExchangeTransaction")) | |
186 | 180 | then { | |
187 | - | let | |
188 | - | let | |
181 | + | let Y = l | |
182 | + | let ac = if (!(isDefined(Y.sellOrder.assetPair.priceAsset))) | |
189 | 183 | then true | |
190 | - | else !(isDefined( | |
191 | - | | |
184 | + | else !(isDefined(Y.sellOrder.assetPair.amountAsset)) | |
185 | + | ac | |
192 | 186 | } | |
193 | 187 | else if ($isInstanceOf(l, "InvokeScriptTransaction")) | |
194 | 188 | then { | |
195 | - | let | |
189 | + | let ad = l | |
196 | 190 | true | |
197 | 191 | } | |
198 | 192 | else false | |
199 | 193 | } | |
200 | 194 |
github/deemru/w8io/169f3d6 53.51 ms ◑