tx · A6n8FZhX6R7VnnYBs9wawuQSpSs232CSumHTbMuZomyx 3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4: -0.01400000 Waves 2020.03.10 11:30 [902796] smart account 3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4 > SELF 0.00000000 Waves
{ "type": 13, "id": "A6n8FZhX6R7VnnYBs9wawuQSpSs232CSumHTbMuZomyx", "fee": 1400000, "feeAssetId": null, "timestamp": 1583829047254, "version": 1, "sender": "3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4", "senderPublicKey": "4AHsCbS9QYVdKNvxrPWwsMwwy3KqXaCMXeAscExJZk9L", "proofs": [ "5xXSMvtjV1sKPKsjQnbTyhSb8e8fznarn6XAtoHUsuDRZJmM4cf7TsHxQ3nbi4nWu2QMsXQbJJ6JxnQH5KwWh1he" ], "script": "base64:AAIDAAAAAAAAAA8IARIECgIICBIFCgMICAgAAAAlAAAAAAdjQml0Q08yAQAAACDH+HoAnTdQnyoybLskiHPdWM4Tg4veh8IaLSgbZ8EolgAAAAAIc3RhcnRRdHkAAAAAAAAFFAAAAAAACG5vbVByaWNlAAAAAAAF9eEAAAAAABZkaXNjb3VudFByZUljb1N1cHBsaWVyAAAAAAAAAAAMAAAAAA5Pd25lckVjb1B1YktleQEAAAAgLvRbo0AJGg7wNzBbRHjrN75s0YuvS2DdwCQ0/xY2QB8AAAAAA3d2cwAAAAAABfXhAAAAAAAETk9ORQIAAAAEbm9uZQAAAAAGaXNzdWVyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUyvc7Pucv0VXiD634RbMs3vuN0A1Fa31vAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251bQEAAAALZ2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AAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA5Pd25lckVjb1B1YktleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAACdHgFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNFeGNoYW5nZVRyYW5zYWN0aW9uBAAAAAJ0eAUAAAAHJG1hdGNoMAQAAAAJd2l0aFdhdmVzAwkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQgICAUAAAACdHgAAAAJc2VsbE9yZGVyAAAACWFzc2V0UGFpcgAAAApwcmljZUFzc2V0BgkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQgICAUAAAACdHgAAAAJc2VsbE9yZGVyAAAACWFzc2V0UGFpcgAAAAthbW91bnRBc3NldAUAAAAJd2l0aFdhdmVzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgQAAAABYwUAAAAHJG1hdGNoMAYHVCL7jg==", "chainId": 84, "height": 902796, "spentComplexity": 0 } View: original | compacted Prev: CvbEKPABuvZ6ARxhi2SkzVXjkgkhT2nJmVsdauMkjoKS Next: 8NoNFDidy3yoA3LNMVCpQ4fgb2C1GfJ3AwAiGP5JVAEz Diff:
Old | New | Differences | |
---|---|---|---|
153 | 153 | then throw("you can adquire cBitCO2 only by Waves tokens") | |
154 | 154 | else { | |
155 | 155 | let N = u(t) | |
156 | - | let ab = y(t) | |
156 | + | let ab = { | |
157 | + | let l = getInteger(this, N) | |
158 | + | if ($isInstanceOf(l, "Int")) | |
159 | + | then { | |
160 | + | let m = l | |
161 | + | m | |
162 | + | } | |
163 | + | else b | |
164 | + | } | |
157 | 165 | let ac = toBase58String(V.caller.bytes) | |
158 | 166 | let ad = ((c * (100 - d)) / 100) | |
159 | 167 | let ae = (aa.amount / ad) |
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 | 130 | func AddSupplierToken (r,W) = { | |
131 | 131 | let q = toBase58String(V.caller.bytes) | |
132 | 132 | let t = p(q, r) | |
133 | 133 | let X = { | |
134 | 134 | let l = getInteger(this, q) | |
135 | 135 | if ($isInstanceOf(l, "Int")) | |
136 | 136 | then { | |
137 | 137 | let m = l | |
138 | 138 | m | |
139 | 139 | } | |
140 | 140 | else b | |
141 | 141 | } | |
142 | 142 | if ((0 >= X)) | |
143 | 143 | then throw("Sorry, insufficient token offer") | |
144 | 144 | else WriteSet([DataEntry(s(t), q), DataEntry(x(t), X), DataEntry(("Precio_Nominal_de_1 token_cBitCO2:_" + T(t)), c), DataEntry(R(t), d), DataEntry(z(t), W)]) | |
145 | 145 | } | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | ||
149 | 149 | @Callable(V) | |
150 | 150 | func PurchaseToken (t,Y,Z) = { | |
151 | 151 | let aa = extract(V.payment) | |
152 | 152 | if (isDefined(aa.assetId)) | |
153 | 153 | then throw("you can adquire cBitCO2 only by Waves tokens") | |
154 | 154 | else { | |
155 | 155 | let N = u(t) | |
156 | - | let ab = y(t) | |
156 | + | let ab = { | |
157 | + | let l = getInteger(this, N) | |
158 | + | if ($isInstanceOf(l, "Int")) | |
159 | + | then { | |
160 | + | let m = l | |
161 | + | m | |
162 | + | } | |
163 | + | else b | |
164 | + | } | |
157 | 165 | let ac = toBase58String(V.caller.bytes) | |
158 | 166 | let ad = ((c * (100 - d)) / 100) | |
159 | 167 | let ae = (aa.amount / ad) | |
160 | 168 | let af = (ab - ae) | |
161 | 169 | let ag = (ae * ad) | |
162 | 170 | if ((ag > aa.amount)) | |
163 | 171 | then throw("Payment Amount cannot be less than item Purchase Order") | |
164 | 172 | else if ((aa.amount > ag)) | |
165 | 173 | then throw("Payment Amount can't be higher than item Purchase Order") | |
166 | 174 | else ScriptResult(WriteSet([DataEntry(A(ac, t), (C(ac, t) + 1)), DataEntry(s(t), Y), DataEntry(D(t), Z), DataEntry("Cantidad_de_tokens_a_comprar:_", ae), DataEntry(("Investment_Amount,_waves_" + G(t)), ag), DataEntry(("Pago_en__waves_del_Inversor" + E(t)), aa.amount), DataEntry((("Request_Status:_" + ac) + "_"), "sold"), DataEntry((("User_Balance:_" + I(t)) + "_"), ae), DataEntry(("Saldo_tokens_del_Proyecto" + x(t)), af), DataEntry(("Saldo_waves_del_vendedor" + M(N)), (O(N) + aa.amount))]), TransferSet(nil)) | |
167 | 175 | } | |
168 | 176 | } | |
169 | 177 | ||
170 | 178 | ||
171 | 179 | @Verifier(ah) | |
172 | 180 | func ai () = { | |
173 | 181 | let l = ah | |
174 | 182 | if ($isInstanceOf(l, "SetScriptTransaction")) | |
175 | 183 | then { | |
176 | 184 | let aj = l | |
177 | 185 | sigVerify(ah.bodyBytes, ah.proofs[0], e) | |
178 | 186 | } | |
179 | 187 | else if ($isInstanceOf(l, "DataTransaction")) | |
180 | 188 | then { | |
181 | 189 | let ak = l | |
182 | 190 | true | |
183 | 191 | } | |
184 | 192 | else if ($isInstanceOf(l, "TransferTransaction")) | |
185 | 193 | then { | |
186 | 194 | let ah = l | |
187 | 195 | true | |
188 | 196 | } | |
189 | 197 | else if ($isInstanceOf(l, "ExchangeTransaction")) | |
190 | 198 | then { | |
191 | 199 | let ah = l | |
192 | 200 | let al = if (!(isDefined(ah.sellOrder.assetPair.priceAsset))) | |
193 | 201 | then true | |
194 | 202 | else !(isDefined(ah.sellOrder.assetPair.amountAsset)) | |
195 | 203 | al | |
196 | 204 | } | |
197 | 205 | else if ($isInstanceOf(l, "InvokeScriptTransaction")) | |
198 | 206 | then { | |
199 | 207 | let am = l | |
200 | 208 | true | |
201 | 209 | } | |
202 | 210 | else false | |
203 | 211 | } | |
204 | 212 |
github/deemru/w8io/026f985 28.58 ms ◑