tx · GKoaEa2R9sGpKnjtfeU4pHh33jh4SzeinxPayBxcNPiG 3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4: -0.01400000 Waves 2020.03.10 11:54 [902821] smart account 3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4 > SELF 0.00000000 Waves
{ "type": 13, "id": "GKoaEa2R9sGpKnjtfeU4pHh33jh4SzeinxPayBxcNPiG", "fee": 1400000, "feeAssetId": null, "timestamp": 1583830426416, "version": 1, "sender": "3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4", "senderPublicKey": "4AHsCbS9QYVdKNvxrPWwsMwwy3KqXaCMXeAscExJZk9L", "proofs": [ "5x9Q2kHsiCWY5DddBypzz1k7jXNVaqKbxB5ZNE6Wx6K5PrGPaZ1xXH6GS9WyT2YvKeFArismn2qPEPuTQaScKiiR" ], "script": "base64:AAIDAAAAAAAAABAIARIFCgMIAQgSBQoDCAgIAAAAJQAAAAAHYUJpdENPMgEAAAAgx/h6AJ03UJ8qMmy7JIhz3VjOE4OL3ofCGi0oG2fBKJYAAAAACHN0YXJ0UXR5AAAAAAAABRQAAAAAAAhub21QcmljZQAAAAAABfXhAAAAAAAWZGlzY291bnRQcmVJY29TdXBwbGllcgAAAAAAAAAADAAAAAAOT3duZXJFY29QdWJLZXkBAAAAIC70W6NACRoO8DcwW0R46ze+bNGLr0tg3cAkNP8WNkAfAAAAAAN3dnMAAAAAAAX14QAAAAAABE5PTkUCAAAABG5vbmUAAAAABmlzc3VlcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVMr3Oz7nL9FV4g+t+EWzLN77jdANRWt9bwEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAADbnVtBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABQAAAANudW0BAAAA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eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAADk93bmVyRWNvUHViS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9EYXRhVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAJ0eAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE0V4Y2hhbmdlVHJhbnNhY3Rpb24EAAAAAnR4BQAAAAckbWF0Y2gwBAAAAAl3aXRoV2F2ZXMDCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABCAgIBQAAAAJ0eAAAAAlzZWxsT3JkZXIAAAAJYXNzZXRQYWlyAAAACnByaWNlQXNzZXQGCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABCAgIBQAAAAJ0eAAAAAlzZWxsT3JkZXIAAAAJYXNzZXRQYWlyAAAAC2Ftb3VudEFzc2V0BQAAAAl3aXRoV2F2ZXMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAF0ludm9rZVNjcmlwdFRyYW5zYWN0aW9uBAAAAAFjBQAAAAckbWF0Y2gwBgfGTkb+", "chainId": 84, "height": 902821, "spentComplexity": 0 } View: original | compacted Prev: 8NoNFDidy3yoA3LNMVCpQ4fgb2C1GfJ3AwAiGP5JVAEz Next: 2EjbzBc2KyqBpvtCeAcbGp4cNbA8qFTzMXzoDdYS4tfa Diff:
Old | New | Differences | |
---|---|---|---|
127 | 127 | ||
128 | 128 | ||
129 | 129 | @Callable(V) | |
130 | - | func AddSupplierToken (r,W) = { | |
130 | + | func AddSupplierToken (r,W,X) = { | |
131 | 131 | let q = toBase58String(V.caller.bytes) | |
132 | 132 | let t = p(q, r) | |
133 | - | let X = { | |
134 | - | let l = getInteger(this, q) | |
135 | - | if ($isInstanceOf(l, "Int")) | |
136 | - | then { | |
137 | - | let m = l | |
138 | - | m | |
139 | - | } | |
140 | - | else b | |
141 | - | } | |
142 | - | if ((0 >= X)) | |
133 | + | if ((0 >= W)) | |
143 | 134 | then throw("Sorry, insufficient token offer") | |
144 | - | else WriteSet([DataEntry(s(t), q), DataEntry(x(t), | |
135 | + | else WriteSet([DataEntry(s(t), q), DataEntry(("Saldo_tokens:_" + x(t)), W), DataEntry(("Precio_Nominal_de_1 token_cBitCO2:_" + T(t)), c), DataEntry(R(t), d), DataEntry(z(t), X)]) | |
145 | 136 | } | |
146 | 137 | ||
147 | 138 | ||
153 | 144 | then throw("you can adquire cBitCO2 only by Waves tokens") | |
154 | 145 | else { | |
155 | 146 | let N = u(t) | |
156 | - | let | |
147 | + | let W = { | |
157 | 148 | let l = getInteger(this, N) | |
158 | 149 | if ($isInstanceOf(l, "Int")) | |
159 | 150 | then { | |
162 | 153 | } | |
163 | 154 | else b | |
164 | 155 | } | |
165 | - | let | |
166 | - | let | |
167 | - | let | |
168 | - | let | |
169 | - | let | |
170 | - | if (( | |
156 | + | let ab = toBase58String(V.caller.bytes) | |
157 | + | let ac = ((c * (100 - d)) / 100) | |
158 | + | let ad = (aa.amount / ac) | |
159 | + | let ae = (W - ad) | |
160 | + | let af = (ad * ac) | |
161 | + | if ((af > aa.amount)) | |
171 | 162 | then throw("Payment Amount cannot be less than item Purchase Order") | |
172 | - | else if ((aa.amount > | |
163 | + | else if ((aa.amount > af)) | |
173 | 164 | then throw("Payment Amount can't be higher than item Purchase Order") | |
174 | - | else ScriptResult(WriteSet([DataEntry(A( | |
165 | + | else ScriptResult(WriteSet([DataEntry(A(ab, t), (C(ab, t) + 1)), DataEntry(s(t), Y), DataEntry(D(t), Z), DataEntry("Cantidad_de_tokens_a_comprar:_", ad), DataEntry(("Investment_Amount,_waves_" + G(t)), af), DataEntry(("Pago_en__waves_del_Inversor" + E(t)), aa.amount), DataEntry((("Request_Status:_" + ab) + "_"), "sold"), DataEntry((("User_Balance:_" + I(t)) + "_"), ad), DataEntry(("Saldo_tokens:_" + x(t)), ae), DataEntry(("Saldo_waves_del_vendedor" + M(N)), (O(N) + aa.amount))]), TransferSet([ScriptTransfer(addressFromStringValue(ab), ad, a)])) | |
175 | 166 | } | |
176 | 167 | } | |
177 | 168 | ||
178 | 169 | ||
179 | - | @Verifier( | |
180 | - | func | |
181 | - | let l = | |
170 | + | @Verifier(ag) | |
171 | + | func ah () = { | |
172 | + | let l = ag | |
182 | 173 | if ($isInstanceOf(l, "SetScriptTransaction")) | |
183 | 174 | then { | |
184 | - | let | |
185 | - | sigVerify( | |
175 | + | let ai = l | |
176 | + | sigVerify(ag.bodyBytes, ag.proofs[0], e) | |
186 | 177 | } | |
187 | 178 | else if ($isInstanceOf(l, "DataTransaction")) | |
188 | 179 | then { | |
189 | - | let | |
180 | + | let aj = l | |
190 | 181 | true | |
191 | 182 | } | |
192 | 183 | else if ($isInstanceOf(l, "TransferTransaction")) | |
193 | 184 | then { | |
194 | - | let | |
185 | + | let ag = l | |
195 | 186 | true | |
196 | 187 | } | |
197 | 188 | else if ($isInstanceOf(l, "ExchangeTransaction")) | |
198 | 189 | then { | |
199 | - | let | |
200 | - | let | |
190 | + | let ag = l | |
191 | + | let ak = if (!(isDefined(ag.sellOrder.assetPair.priceAsset))) | |
201 | 192 | then true | |
202 | - | else !(isDefined( | |
203 | - | | |
193 | + | else !(isDefined(ag.sellOrder.assetPair.amountAsset)) | |
194 | + | ak | |
204 | 195 | } | |
205 | 196 | else if ($isInstanceOf(l, "InvokeScriptTransaction")) | |
206 | 197 | then { | |
207 | - | let | |
198 | + | let al = l | |
208 | 199 | true | |
209 | 200 | } | |
210 | 201 | 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) = ("BitCO2:_" + toBase58String(sha256(toBytes((q + r))))) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func s (t) = (t + "_Amaz") | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func u (t) = n(s(t)) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func v (t) = (t + "_tok.amount") | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func w (t) = i(v(t)) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func x (t) = (t + "_tokens") | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func y (t) = i(x(t)) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func z (t) = (t + "_description") | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func A (B,t) = (((t + "_") + B) + "_cnt") | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func C (B,t) = i(A(B, t)) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func D (t) = (t + "_userdata") | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func E (t) = (t + "_saldwvsuser") | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func F (t) = i(E(t)) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func G (t) = (t + "_user.pmt") | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func H (t) = i(G(t)) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func I (t) = (t + "_saldqty") | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func J (t) = i(I(t)) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func K (t) = (t + "_qty") | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func L (t) = i(K(t)) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func M (N) = (N + "_balance") | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func O (N) = i(M(N)) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func P (t) = (("name:_" + t) + "_") | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func Q (t) = n(P(t)) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func R (t) = (("disc:_" + t) + "_") | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func S (t) = i(R(t)) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func T (t) = (("Nom:_" + t) + "_") | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func U (t) = i(T(t)) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | @Callable(V) | |
130 | - | func AddSupplierToken (r,W) = { | |
130 | + | func AddSupplierToken (r,W,X) = { | |
131 | 131 | let q = toBase58String(V.caller.bytes) | |
132 | 132 | let t = p(q, r) | |
133 | - | let X = { | |
134 | - | let l = getInteger(this, q) | |
135 | - | if ($isInstanceOf(l, "Int")) | |
136 | - | then { | |
137 | - | let m = l | |
138 | - | m | |
139 | - | } | |
140 | - | else b | |
141 | - | } | |
142 | - | if ((0 >= X)) | |
133 | + | if ((0 >= W)) | |
143 | 134 | then throw("Sorry, insufficient token offer") | |
144 | - | else WriteSet([DataEntry(s(t), q), DataEntry(x(t), | |
135 | + | else WriteSet([DataEntry(s(t), q), DataEntry(("Saldo_tokens:_" + x(t)), W), DataEntry(("Precio_Nominal_de_1 token_cBitCO2:_" + T(t)), c), DataEntry(R(t), d), DataEntry(z(t), X)]) | |
145 | 136 | } | |
146 | 137 | ||
147 | 138 | ||
148 | 139 | ||
149 | 140 | @Callable(V) | |
150 | 141 | func PurchaseToken (t,Y,Z) = { | |
151 | 142 | let aa = extract(V.payment) | |
152 | 143 | if (isDefined(aa.assetId)) | |
153 | 144 | then throw("you can adquire cBitCO2 only by Waves tokens") | |
154 | 145 | else { | |
155 | 146 | let N = u(t) | |
156 | - | let | |
147 | + | let W = { | |
157 | 148 | let l = getInteger(this, N) | |
158 | 149 | if ($isInstanceOf(l, "Int")) | |
159 | 150 | then { | |
160 | 151 | let m = l | |
161 | 152 | m | |
162 | 153 | } | |
163 | 154 | else b | |
164 | 155 | } | |
165 | - | let | |
166 | - | let | |
167 | - | let | |
168 | - | let | |
169 | - | let | |
170 | - | if (( | |
156 | + | let ab = toBase58String(V.caller.bytes) | |
157 | + | let ac = ((c * (100 - d)) / 100) | |
158 | + | let ad = (aa.amount / ac) | |
159 | + | let ae = (W - ad) | |
160 | + | let af = (ad * ac) | |
161 | + | if ((af > aa.amount)) | |
171 | 162 | then throw("Payment Amount cannot be less than item Purchase Order") | |
172 | - | else if ((aa.amount > | |
163 | + | else if ((aa.amount > af)) | |
173 | 164 | then throw("Payment Amount can't be higher than item Purchase Order") | |
174 | - | else ScriptResult(WriteSet([DataEntry(A( | |
165 | + | else ScriptResult(WriteSet([DataEntry(A(ab, t), (C(ab, t) + 1)), DataEntry(s(t), Y), DataEntry(D(t), Z), DataEntry("Cantidad_de_tokens_a_comprar:_", ad), DataEntry(("Investment_Amount,_waves_" + G(t)), af), DataEntry(("Pago_en__waves_del_Inversor" + E(t)), aa.amount), DataEntry((("Request_Status:_" + ab) + "_"), "sold"), DataEntry((("User_Balance:_" + I(t)) + "_"), ad), DataEntry(("Saldo_tokens:_" + x(t)), ae), DataEntry(("Saldo_waves_del_vendedor" + M(N)), (O(N) + aa.amount))]), TransferSet([ScriptTransfer(addressFromStringValue(ab), ad, a)])) | |
175 | 166 | } | |
176 | 167 | } | |
177 | 168 | ||
178 | 169 | ||
179 | - | @Verifier( | |
180 | - | func | |
181 | - | let l = | |
170 | + | @Verifier(ag) | |
171 | + | func ah () = { | |
172 | + | let l = ag | |
182 | 173 | if ($isInstanceOf(l, "SetScriptTransaction")) | |
183 | 174 | then { | |
184 | - | let | |
185 | - | sigVerify( | |
175 | + | let ai = l | |
176 | + | sigVerify(ag.bodyBytes, ag.proofs[0], e) | |
186 | 177 | } | |
187 | 178 | else if ($isInstanceOf(l, "DataTransaction")) | |
188 | 179 | then { | |
189 | - | let | |
180 | + | let aj = l | |
190 | 181 | true | |
191 | 182 | } | |
192 | 183 | else if ($isInstanceOf(l, "TransferTransaction")) | |
193 | 184 | then { | |
194 | - | let | |
185 | + | let ag = l | |
195 | 186 | true | |
196 | 187 | } | |
197 | 188 | else if ($isInstanceOf(l, "ExchangeTransaction")) | |
198 | 189 | then { | |
199 | - | let | |
200 | - | let | |
190 | + | let ag = l | |
191 | + | let ak = if (!(isDefined(ag.sellOrder.assetPair.priceAsset))) | |
201 | 192 | then true | |
202 | - | else !(isDefined( | |
203 | - | | |
193 | + | else !(isDefined(ag.sellOrder.assetPair.amountAsset)) | |
194 | + | ak | |
204 | 195 | } | |
205 | 196 | else if ($isInstanceOf(l, "InvokeScriptTransaction")) | |
206 | 197 | then { | |
207 | - | let | |
198 | + | let al = l | |
208 | 199 | true | |
209 | 200 | } | |
210 | 201 | else false | |
211 | 202 | } | |
212 | 203 |
github/deemru/w8io/026f985 46.07 ms ◑