tx · 2mbnJCJCZRVyuBcQkXcEPnUrzaWAyTDPMsuYH1yH4ngX 3MqySDQxn5jzBUc144oks9fQzAXCBvJ2B8Y: -0.01000000 Waves 2021.08.24 13:19 [1672285] smart account 3MqySDQxn5jzBUc144oks9fQzAXCBvJ2B8Y > SELF 0.00000000 Waves
{ "type": 13, "id": "2mbnJCJCZRVyuBcQkXcEPnUrzaWAyTDPMsuYH1yH4ngX", "fee": 1000000, "feeAssetId": null, "timestamp": 1629800474575, "version": 1, "sender": "3MqySDQxn5jzBUc144oks9fQzAXCBvJ2B8Y", "senderPublicKey": "3YcAqsm6P2UYnzeZng9DPfjNQbEcHithbYzPy3ZMzLMk", "proofs": [ "2qjJ4cwPGJTZxDU2cLSb679Ff6oKzuGBCU7Ts6EXuVUtdHbL3ob24YuhpqQ3GD8sMizif32siAo7gRw2ggz4eCCf" ], "script": "base64:AAIFAAAAAAAAABQIAhIJCgcBAQEBAQgBEgASAwoBCAAAACsBAAAAD2dldFN0cmluZ09yRmFpbAAAAAEAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQiAAAAAQUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgIAAAAPbWFuZGF0b3J5IHRoaXMuBQAAAANrZXkCAAAADyBpcyBub3QgZGVmaW5lZAAAAAADU0VQAgAAAAJfXwAAAAAIQlVGU0NBTEUJAAE2AAAAAQAN4Lazp2QAAAEAAAAdY29udmVydFByaWNlQXNzZXRJbnRvSWRvQXNzZXQAAAAFAAAAEHByaWNlQXNzZXRBbW91bnQAAAAOcHJpY2VBc3NldE1VTFQAAAAFcHJpY2UAAAAJcHJpY2VNVUxUAAAADGlkb0Fzc2V0TVVMVAQAAAAKYlByaWNlTVVMVAkAATYAAAABBQAAAA5wcmljZUFzc2V0TVVMVAQAAAAOYlByaWNlQXNzZXRCVUYJAAE8AAAAAwkAATYAAAABBQAAABBwcmljZUFzc2V0QW1vdW50BQAAAAhCVUZTQ0FMRQUAAAAKYlBy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cHJpY2UFAAAACXByaWNlTXVsdAUAAAAMaWRvQXNzZXRNdWx0AwkAAGYAAAACBQAAABZyZXF1aXJlZElkb0Fzc2V0QW1vdW50CQAD8AAAAAIFAAAABHRoaXMFAAAACmlkb0Fzc2V0SWQJAAACAAAAAQIAAAA5SURPIGFzc2V0IGhhcyBiZWVuIC0gc29sZCBjb25zaWRlciB0byB1c2Ugc21hbGxlciBwYXltZW50BAAAAAp0b3RhbHNEaWZmCQAETAAAAAIFAAAACXBtdEFtb3VudAkABEwAAAACBQAAAAlwbXRBbW91bnQJAARMAAAAAgAAAAAAAAAAAAkABEwAAAACAAAAAAAAAAAABQAAAANuaWwJAARMAAAAAgkBAAAAC1RvdGFsc0VudHJ5AAAABAkBAAAAC2tleUludmVzdG9yAAAAAQUAAAALdXNlckFkZHJlc3MFAAAAEW9yaWdJbnZlc3RvckFycmF5BQAAAAp0b3RhbHNEaWZmBQAAAApjbGFpbVN0YXJ0CQAETAAAAAIJAQAAAAtUb3RhbHNFbnRyeQAAAAQJAQAAAAlrZXlUb3RhbHMAAAAABQAAAA9vcmlnVG90YWxzQXJyYXkFAAAACnRvdGFsc0RpZmYFAAAACmNsYWltU3RhcnQJAARMAAAAAgkBAAAAG0ludmVzdE9wZXJhdGlvbkhpc3RvcnlFbnRyeQAAAAQFAAAAC3VzZXJBZGRyZXNzBQAAAAlwbXRBbW91bnQAAAAAAAAAAAAIBQAAAAFpAAAADXRyYW5zYWN0aW9uSWQFAAAAA25pbAAAAAFpAQAAAAVjbGFpbQAAAAEAAAAQY2xhaW1lZEFzc2V0SWQ1OAkBAAAADWludGVybmFsQ2xhaW0AAAADBQAAABBjbGFpbWVkQXNzZXRJZDU4CAUAAAABaQAAAAZjYWxsZXIIBQAAAAFpAAAADXRyYW5zYWN0aW9uSWQAAAAAl8EvSw==", "chainId": 84, "height": 1672285, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6UinNALyQ1Rw59C8HKiQfQjkp8eSEtj5aDE4p6PN91Rs Next: 8emc4e4wAfEvFr8C7w5cvS2zpgZyGkmUAZ5ty73E98v8 Diff:
Old | New | Differences | |
---|---|---|---|
157 | 157 | } | |
158 | 158 | ||
159 | 159 | ||
160 | - | @Callable(aU) | |
160 | + | func aU (aB,aG) = aA(aB, addressFromStringValue(aG), fromBase58String("")) | |
161 | + | ||
162 | + | ||
163 | + | @Callable(aV) | |
161 | 164 | func constructor (z,A,B,C,h,G,I) = { | |
162 | 165 | let D = ((100 * 1000) * 1000) | |
163 | - | let | |
166 | + | let aW = (z + A) | |
164 | 167 | if (isDefined(getString(Y()))) | |
165 | 168 | then throw("already initialized") | |
166 | - | else if (("3N4Aib5iubWiGMzdTh6wWiVDVbo32oeVUmH" != toString( | |
169 | + | else if (("3N4Aib5iubWiGMzdTh6wWiVDVbo32oeVUmH" != toString(aV.caller))) | |
167 | 170 | then throw("not authorized") | |
168 | - | else if ((size( | |
171 | + | else if ((size(aV.payments) != 1)) | |
169 | 172 | then throw("exactly 1 payment must be attached") | |
170 | - | else if (( | |
173 | + | else if ((aW >= B)) | |
171 | 174 | then throw("claimStart must be greater than idoEnd") | |
172 | 175 | else { | |
173 | - | let | |
174 | - | let aE = value( | |
175 | - | let | |
176 | + | let aX = value(aV.payments[0]) | |
177 | + | let aE = value(aX.assetId) | |
178 | + | let aY = valueOrErrorMessage(assetInfo(aE), "fail to load ido asset info") | |
176 | 179 | let E = toBase58String(aE) | |
177 | - | let F = pow(10, 0, | |
180 | + | let F = pow(10, 0, aY.decimals, 0, 0, DOWN) | |
178 | 181 | let aF = fromBase58String(G) | |
179 | - | let | |
180 | - | let H = pow(10, 0, | |
182 | + | let aZ = valueOrErrorMessage(assetInfo(aF), "fail to load price asset info") | |
183 | + | let H = pow(10, 0, aZ.decimals, 0, 0, DOWN) | |
181 | 184 | [StringEntry(Y(), J(z, A, B, C, h, D, E, F, G, H, I))] | |
182 | 185 | } | |
183 | 186 | } | |
184 | 187 | ||
185 | 188 | ||
186 | 189 | ||
187 | - | @Callable( | |
190 | + | @Callable(aV) | |
188 | 191 | func invest () = { | |
189 | 192 | let aC = af() | |
190 | 193 | let z = parseIntValue(aC[n]) | |
191 | 194 | let A = parseIntValue(aC[o]) | |
192 | - | let | |
195 | + | let aW = (z + A) | |
193 | 196 | let B = parseIntValue(aC[p]) | |
194 | 197 | let C = parseIntValue(aC[q]) | |
195 | 198 | let h = parseIntValue(aC[r]) | |
200 | 203 | let G = aC[v] | |
201 | 204 | let aF = fromBase58String(G) | |
202 | 205 | let H = parseIntValue(aC[w]) | |
203 | - | let | |
204 | - | let aa = toString( | |
206 | + | let ba = parseIntValue(aC[x]) | |
207 | + | let aa = toString(aV.caller) | |
205 | 208 | if ((z > height)) | |
206 | 209 | then throw("ido has not been started yet") | |
207 | - | else if ((height > | |
210 | + | else if ((height > aW)) | |
208 | 211 | then throw("ido has been already ended") | |
209 | - | else if ((size( | |
212 | + | else if ((size(aV.payments) != 1)) | |
210 | 213 | then throw("exactly 1 payment is expected") | |
211 | 214 | else { | |
212 | - | let | |
213 | - | let | |
214 | - | let | |
215 | - | if (( | |
216 | - | then throw((("invalid payment asset id: " + toBase58String( | |
217 | - | else if (( | |
218 | - | then throw(((("payment amount is less then min allowed: pmtAmount=" + toString( | |
215 | + | let aX = value(aV.payments[0]) | |
216 | + | let bb = value(aX.assetId) | |
217 | + | let bc = aX.amount | |
218 | + | if ((bb != aF)) | |
219 | + | then throw((("invalid payment asset id: " + toBase58String(bb)) + " is expected")) | |
220 | + | else if ((ba > bc)) | |
221 | + | then throw(((("payment amount is less then min allowed: pmtAmount=" + toString(bc)) + " minIvestAmount=") + toString(ba))) | |
219 | 222 | else { | |
220 | - | let | |
221 | - | let | |
222 | - | let | |
223 | - | let | |
224 | - | if (( | |
223 | + | let bd = aj(aa) | |
224 | + | let be = ai() | |
225 | + | let bf = (parseIntValue(be[K]) + bc) | |
226 | + | let bg = e(bf, H, h, D, F) | |
227 | + | if ((bg > assetBalance(this, aE))) | |
225 | 228 | then throw("IDO asset has been - sold consider to use smaller payment") | |
226 | 229 | else { | |
227 | - | let aP = [ | |
228 | - | [ap(Z(aa), | |
230 | + | let aP = [bc, bc, 0, 0] | |
231 | + | [ap(Z(aa), bd, aP, B), ap(ab(), be, aP, B), ax(aa, bc, 0, aV.transactionId)] | |
229 | 232 | } | |
230 | 233 | } | |
231 | 234 | } | |
233 | 236 | ||
234 | 237 | ||
235 | 238 | ||
236 | - | @Callable(aU) | |
237 | - | func claim (aB) = { | |
238 | - | let aa = aU.caller | |
239 | - | aA(aB, aa, aU.transactionId) | |
240 | - | } | |
239 | + | @Callable(aV) | |
240 | + | func claim (aB) = aA(aB, aV.caller, aV.transactionId) | |
241 | 241 | ||
242 | 242 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b) = valueOrErrorMessage(getString(b), (("mandatory this." + b) + " is not defined")) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | let c = "__" | |
8 | 8 | ||
9 | 9 | let d = toBigInt(1000000000000000000) | |
10 | 10 | ||
11 | 11 | func e (f,g,h,i,j) = { | |
12 | 12 | let k = toBigInt(g) | |
13 | 13 | let l = fraction(toBigInt(f), d, k) | |
14 | 14 | let m = fraction(l, k, toBigInt(h)) | |
15 | 15 | toInt(fraction(m, toBigInt(j), d)) | |
16 | 16 | } | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | let n = 1 | |
20 | 20 | ||
21 | 21 | let o = 2 | |
22 | 22 | ||
23 | 23 | let p = 3 | |
24 | 24 | ||
25 | 25 | let q = 4 | |
26 | 26 | ||
27 | 27 | let r = 5 | |
28 | 28 | ||
29 | 29 | let s = 6 | |
30 | 30 | ||
31 | 31 | let t = 7 | |
32 | 32 | ||
33 | 33 | let u = 8 | |
34 | 34 | ||
35 | 35 | let v = 9 | |
36 | 36 | ||
37 | 37 | let w = 10 | |
38 | 38 | ||
39 | 39 | let x = 11 | |
40 | 40 | ||
41 | 41 | func y (z,A,B,C,h,D,E,F,G,H,I) = makeString(["%d%d%d%d%d%d%s%d%s%d%d", z, A, B, C, h, D, E, F, G, H, I], c) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func J (z,A,B,C,h,D,E,F,G,H,I) = y(toString(z), toString(A), toString(B), toString(C), toString(h), toString(D), E, toString(F), G, toString(H), toString(I)) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | let K = 1 | |
48 | 48 | ||
49 | 49 | let L = 2 | |
50 | 50 | ||
51 | 51 | let M = 3 | |
52 | 52 | ||
53 | 53 | let N = 4 | |
54 | 54 | ||
55 | 55 | let O = 5 | |
56 | 56 | ||
57 | 57 | func P (Q,R,S,T,U) = makeString(["%d%d%d%d%d", Q, R, S, T, U], c) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func V (Q,R,S,T,U) = P(toString(Q), toString(R), toString(S), toString(T), toString(U)) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func W (f,X) = makeString(["%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(f), toString(X)], c) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func Y () = "%s__config" | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func Z (aa) = ("%s__" + aa) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func ab () = "%s__totals" | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func ac (ad,aa,ae) = makeString(["%s%s%s%s__history", ad, aa, ae], c) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func af () = split(a(Y()), c) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func ag (ah) = split(valueOrElse(getString(ah), P("0", "0", "0", "0", "0")), c) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func ai () = ag(ab()) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func aj (aa) = ag(Z(aa)) | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func ak (aa) = split(a(Z(aa)), c) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | let al = 0 | |
94 | 94 | ||
95 | 95 | let am = 1 | |
96 | 96 | ||
97 | 97 | let an = 2 | |
98 | 98 | ||
99 | 99 | let ao = 3 | |
100 | 100 | ||
101 | 101 | func ap (b,aq,ar,as) = { | |
102 | 102 | let Q = parseIntValue(aq[K]) | |
103 | 103 | let R = parseIntValue(aq[L]) | |
104 | 104 | let S = parseIntValue(aq[M]) | |
105 | 105 | let T = parseIntValue(aq[N]) | |
106 | 106 | let U = parseIntValue(aq[O]) | |
107 | 107 | let at = (Q + ar[al]) | |
108 | 108 | let au = (R + ar[am]) | |
109 | 109 | let av = (S + ar[an]) | |
110 | 110 | let aw = (T + ar[ao]) | |
111 | 111 | if ((0 > au)) | |
112 | 112 | then throw("invalid math") | |
113 | 113 | else StringEntry(b, V(at, au, av, aw, as)) | |
114 | 114 | } | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func ax (aa,f,X,ay) = StringEntry(ac("invest", aa, toBase58String(ay)), W(f, X)) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func az (aa,f,X,ay) = StringEntry(ac("claim", aa, toBase58String(ay)), W(f, X)) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func aA (aB,aa,ay) = { | |
124 | 124 | let aC = af() | |
125 | 125 | let B = parseIntValue(aC[p]) | |
126 | 126 | let C = parseIntValue(aC[q]) | |
127 | 127 | let aD = (B + C) | |
128 | 128 | let h = parseIntValue(aC[r]) | |
129 | 129 | let D = parseIntValue(aC[s]) | |
130 | 130 | let E = aC[t] | |
131 | 131 | let aE = fromBase58String(E) | |
132 | 132 | let F = parseIntValue(aC[u]) | |
133 | 133 | let G = aC[v] | |
134 | 134 | let aF = fromBase58String(G) | |
135 | 135 | let H = parseIntValue(aC[w]) | |
136 | 136 | let aG = toString(aa) | |
137 | 137 | let aH = ak(aG) | |
138 | 138 | let aI = parseIntValue(aH[K]) | |
139 | 139 | let aJ = parseIntValue(aH[O]) | |
140 | 140 | let aK = if ((height > aD)) | |
141 | 141 | then aD | |
142 | 142 | else height | |
143 | 143 | let aL = (aJ - aK) | |
144 | 144 | let aM = fraction(aI, aL, C) | |
145 | 145 | let aN = e(aM, H, h, D, F) | |
146 | 146 | let aO = if ((aB == G)) | |
147 | 147 | then $Tuple3([0, -(aM), aM, 0], aM, aF) | |
148 | 148 | else if ((aB == E)) | |
149 | 149 | then $Tuple3([0, -(aM), 0, aN], aN, aE) | |
150 | 150 | else throw(("unsupported assetId: " + aB)) | |
151 | 151 | let aP = aO._1 | |
152 | 152 | let aQ = aO._2 | |
153 | 153 | let aR = aO._3 | |
154 | 154 | let aS = aP[an] | |
155 | 155 | let aT = aP[ao] | |
156 | 156 | [ScriptTransfer(aa, aQ, aR), ap(Z(aG), aH, aP, aK), ap(ab(), ai(), aP, aK), az(aG, aS, aT, ay)] | |
157 | 157 | } | |
158 | 158 | ||
159 | 159 | ||
160 | - | @Callable(aU) | |
160 | + | func aU (aB,aG) = aA(aB, addressFromStringValue(aG), fromBase58String("")) | |
161 | + | ||
162 | + | ||
163 | + | @Callable(aV) | |
161 | 164 | func constructor (z,A,B,C,h,G,I) = { | |
162 | 165 | let D = ((100 * 1000) * 1000) | |
163 | - | let | |
166 | + | let aW = (z + A) | |
164 | 167 | if (isDefined(getString(Y()))) | |
165 | 168 | then throw("already initialized") | |
166 | - | else if (("3N4Aib5iubWiGMzdTh6wWiVDVbo32oeVUmH" != toString( | |
169 | + | else if (("3N4Aib5iubWiGMzdTh6wWiVDVbo32oeVUmH" != toString(aV.caller))) | |
167 | 170 | then throw("not authorized") | |
168 | - | else if ((size( | |
171 | + | else if ((size(aV.payments) != 1)) | |
169 | 172 | then throw("exactly 1 payment must be attached") | |
170 | - | else if (( | |
173 | + | else if ((aW >= B)) | |
171 | 174 | then throw("claimStart must be greater than idoEnd") | |
172 | 175 | else { | |
173 | - | let | |
174 | - | let aE = value( | |
175 | - | let | |
176 | + | let aX = value(aV.payments[0]) | |
177 | + | let aE = value(aX.assetId) | |
178 | + | let aY = valueOrErrorMessage(assetInfo(aE), "fail to load ido asset info") | |
176 | 179 | let E = toBase58String(aE) | |
177 | - | let F = pow(10, 0, | |
180 | + | let F = pow(10, 0, aY.decimals, 0, 0, DOWN) | |
178 | 181 | let aF = fromBase58String(G) | |
179 | - | let | |
180 | - | let H = pow(10, 0, | |
182 | + | let aZ = valueOrErrorMessage(assetInfo(aF), "fail to load price asset info") | |
183 | + | let H = pow(10, 0, aZ.decimals, 0, 0, DOWN) | |
181 | 184 | [StringEntry(Y(), J(z, A, B, C, h, D, E, F, G, H, I))] | |
182 | 185 | } | |
183 | 186 | } | |
184 | 187 | ||
185 | 188 | ||
186 | 189 | ||
187 | - | @Callable( | |
190 | + | @Callable(aV) | |
188 | 191 | func invest () = { | |
189 | 192 | let aC = af() | |
190 | 193 | let z = parseIntValue(aC[n]) | |
191 | 194 | let A = parseIntValue(aC[o]) | |
192 | - | let | |
195 | + | let aW = (z + A) | |
193 | 196 | let B = parseIntValue(aC[p]) | |
194 | 197 | let C = parseIntValue(aC[q]) | |
195 | 198 | let h = parseIntValue(aC[r]) | |
196 | 199 | let D = parseIntValue(aC[s]) | |
197 | 200 | let E = aC[t] | |
198 | 201 | let aE = fromBase58String(E) | |
199 | 202 | let F = parseIntValue(aC[u]) | |
200 | 203 | let G = aC[v] | |
201 | 204 | let aF = fromBase58String(G) | |
202 | 205 | let H = parseIntValue(aC[w]) | |
203 | - | let | |
204 | - | let aa = toString( | |
206 | + | let ba = parseIntValue(aC[x]) | |
207 | + | let aa = toString(aV.caller) | |
205 | 208 | if ((z > height)) | |
206 | 209 | then throw("ido has not been started yet") | |
207 | - | else if ((height > | |
210 | + | else if ((height > aW)) | |
208 | 211 | then throw("ido has been already ended") | |
209 | - | else if ((size( | |
212 | + | else if ((size(aV.payments) != 1)) | |
210 | 213 | then throw("exactly 1 payment is expected") | |
211 | 214 | else { | |
212 | - | let | |
213 | - | let | |
214 | - | let | |
215 | - | if (( | |
216 | - | then throw((("invalid payment asset id: " + toBase58String( | |
217 | - | else if (( | |
218 | - | then throw(((("payment amount is less then min allowed: pmtAmount=" + toString( | |
215 | + | let aX = value(aV.payments[0]) | |
216 | + | let bb = value(aX.assetId) | |
217 | + | let bc = aX.amount | |
218 | + | if ((bb != aF)) | |
219 | + | then throw((("invalid payment asset id: " + toBase58String(bb)) + " is expected")) | |
220 | + | else if ((ba > bc)) | |
221 | + | then throw(((("payment amount is less then min allowed: pmtAmount=" + toString(bc)) + " minIvestAmount=") + toString(ba))) | |
219 | 222 | else { | |
220 | - | let | |
221 | - | let | |
222 | - | let | |
223 | - | let | |
224 | - | if (( | |
223 | + | let bd = aj(aa) | |
224 | + | let be = ai() | |
225 | + | let bf = (parseIntValue(be[K]) + bc) | |
226 | + | let bg = e(bf, H, h, D, F) | |
227 | + | if ((bg > assetBalance(this, aE))) | |
225 | 228 | then throw("IDO asset has been - sold consider to use smaller payment") | |
226 | 229 | else { | |
227 | - | let aP = [ | |
228 | - | [ap(Z(aa), | |
230 | + | let aP = [bc, bc, 0, 0] | |
231 | + | [ap(Z(aa), bd, aP, B), ap(ab(), be, aP, B), ax(aa, bc, 0, aV.transactionId)] | |
229 | 232 | } | |
230 | 233 | } | |
231 | 234 | } | |
232 | 235 | } | |
233 | 236 | ||
234 | 237 | ||
235 | 238 | ||
236 | - | @Callable(aU) | |
237 | - | func claim (aB) = { | |
238 | - | let aa = aU.caller | |
239 | - | aA(aB, aa, aU.transactionId) | |
240 | - | } | |
239 | + | @Callable(aV) | |
240 | + | func claim (aB) = aA(aB, aV.caller, aV.transactionId) | |
241 | 241 | ||
242 | 242 |
github/deemru/w8io/169f3d6 68.78 ms ◑