tx · CoGp6EvJaFb3DzHkojhtY4AELbEu56sPeXWzDLwpyEre 3MumVW3m6TeFcJ8hA3g5JATvQM6xjk5fTgY: -0.01000000 Waves 2020.01.15 16:09 [855252] smart account 3MumVW3m6TeFcJ8hA3g5JATvQM6xjk5fTgY > SELF 0.00000000 Waves
{ "type": 13, "id": "CoGp6EvJaFb3DzHkojhtY4AELbEu56sPeXWzDLwpyEre", "fee": 1000000, "feeAssetId": null, "timestamp": 1579093840164, "version": 1, "sender": "3MumVW3m6TeFcJ8hA3g5JATvQM6xjk5fTgY", "senderPublicKey": "D19ymGbRnwf9qrABkUsaHfymb42Ft39mvmidRQDuLRUn", "proofs": [ "5DVFLQPJKaaqAEQgHg64fdY9df3gMEASFS5w5X7iaqXeR2YaApUaYifNGeUqSPuCyKTTHNWmTR6EKB1tMmM4ThYi" ], "script": "base64:AAIDAAAAAAAAAAgIARIAEgASAAAAADQAAAAADWlzc3VlckFzc2V0SWQBAAAAIFZV7BBZbcfG07uo2D3vBK12jMXeYZKB5tEvtKiJ8fuKAAAAABFpbnZlc3RtZW50QXNzZXRJZAEAAAAEE6vZMwAAAAAYaW52ZXN0bWVudEFzc2V0SWRJc1dhdmVzBgAAAAAOb3duZXJQdWJsaWNLZXkBAAAAIFPICwNpN/9oc6mIkSr3UQFC73h294HQETQZqdrlUqgWAAAAAAxvd25lckFkZHJlc3MJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEFAAAADm93bmVyUHVibGljS2V5AAAAABJvd25lckFkZHJlc3NTdHJpbmcCAAAAIzNNeUxQMXBabjZuWE5Lc2ZmMVJ0M1YzTTNUNTh1M1U3c3BaAAAAABNhc3NldERlY2ltYWxzT2Zmc2V0AAAAAAAAAAABAAAAAA90b2tlbnNhbGVBbW91bnQAAAAAAAAAAAoAAAAACXN0YXJ0VGltZQAAAAAAXh71YAAAAAAHZW5kVGltZQAAAAAAXiQ4GAAAAAAFcHJpY2UAAAAAAAX14QAAAAAADXNvZnRDYXBBb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tleTVTaWduZWQAAAAAAAAAAAMHGqNzhA==", "chainId": 84, "height": 855252, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let issuerAssetId = base58'6p241pxQdrXqtY5DxBdJzE6dpr7XqwmPMw8SwRmSkPHB' | |
5 | + | ||
6 | + | let investmentAssetId = base58'WAVES' | |
7 | + | ||
8 | + | let investmentAssetIdIsWaves = true | |
9 | + | ||
10 | + | let ownerPublicKey = base58'6e3kxqBv8CMe8XKFyfFgikK4NEqTfuKPT3JotS3tStDT' | |
11 | + | ||
12 | + | let ownerAddress = addressFromPublicKey(ownerPublicKey) | |
13 | + | ||
14 | + | let ownerAddressString = "3MyLP1pZn6nXNKsff1Rt3V3M3T58u3U7spZ" | |
15 | + | ||
16 | + | let assetDecimalsOffset = 1 | |
17 | + | ||
18 | + | let tokensaleAmount = 10 | |
19 | + | ||
20 | + | let startTime = 1579087200 | |
21 | + | ||
22 | + | let endTime = 1579431960 | |
23 | + | ||
24 | + | let price = 100000000 | |
25 | + | ||
26 | + | let softCapAmount = 500000000 | |
27 | + | ||
28 | + | let minPayment = 100000000 | |
29 | + | ||
30 | + | let swapAssetId = base58'G7sJQse5JnS7BB2TTppRnEtjpoTnQKX6jpTPrnY2f8nn' | |
31 | + | ||
32 | + | let swapAmount = 10 | |
33 | + | ||
34 | + | let swapPrice = 110000000 | |
35 | + | ||
36 | + | let companyType = 2 | |
37 | + | ||
38 | + | let isTokensale = 0 | |
39 | + | ||
40 | + | let isSwap = 1 | |
41 | + | ||
42 | + | let isTokensaleAndSwap = 2 | |
43 | + | ||
44 | + | let swapKeySumAmountPrefix = "swapSumAmount " | |
45 | + | ||
46 | + | let swapKeySumAssetsPrefix = "swapSumAssets " | |
47 | + | ||
48 | + | let swapKeyDistAssets = "swapAssets" | |
49 | + | ||
50 | + | let swapKeyCollectedAmount = "swapAmount" | |
51 | + | ||
52 | + | let keySumAmountPrefix = "sumAmount " | |
53 | + | ||
54 | + | let keySumPaidAmountPrefix = "paidAmount " | |
55 | + | ||
56 | + | let keySumAssetsPrefix = "sumAssets " | |
57 | + | ||
58 | + | let keyAllowAccountPrefix = "allow " | |
59 | + | ||
60 | + | let keyDistAssets = "assets" | |
61 | + | ||
62 | + | let keyCollectedAmount = "amount" | |
63 | + | ||
64 | + | let keyIssuer = "issuer" | |
65 | + | ||
66 | + | let whitelistAddress = Address(base58'3N6DwWxT82nGJUwBwd7L514r2u71gr7WhwJ') | |
67 | + | ||
68 | + | let dAppWhitelistAddress = Address(base58'3N1SPvLZgv6FMfe5WNUtnPzt3okYxcJhYnR') | |
69 | + | ||
70 | + | let pAddress1 = addressFromString("3NCVDaT1ASbRd42hBSw4EG6ojGVRGtvMiz1") | |
71 | + | ||
72 | + | let pAddress2 = addressFromString("3Ms2kTAxdrcXDxwedfbNjSi6ewGCUqt3heZ") | |
73 | + | ||
74 | + | let pAddress3 = addressFromString("3N6ognm7xnQSFiownS1Df1LacJUQXvfDFLe") | |
75 | + | ||
76 | + | let pAddress4 = addressFromString("3MtVCmN9MZbWf9qxiMFoEPBrdc2fLp3SvuC") | |
77 | + | ||
78 | + | let pAddress5 = addressFromString("3MuWG8gsTK4RQBsm97sMCuUXW99JvRxwYSg") | |
79 | + | ||
80 | + | let ver = "4.0.0-testnet" | |
81 | + | ||
82 | + | let validState = 1000 | |
83 | + | ||
84 | + | func isTokensaleAllow () = if ((companyType == isTokensale)) | |
85 | + | then true | |
86 | + | else (companyType == isTokensaleAndSwap) | |
87 | + | ||
88 | + | ||
89 | + | func isSwapAllow () = if ((companyType == isSwap)) | |
90 | + | then true | |
91 | + | else (companyType == isTokensaleAndSwap) | |
92 | + | ||
93 | + | ||
94 | + | func getCurrentTime () = { | |
95 | + | let blockInfo = value(blockInfoByHeight(height)) | |
96 | + | (blockInfo.timestamp / 1000) | |
97 | + | } | |
98 | + | ||
99 | + | ||
100 | + | func getInvestmentAssetIdForTransfer (isWaves,assetId) = if ((isWaves == false)) | |
101 | + | then assetId | |
102 | + | else unit | |
103 | + | ||
104 | + | ||
105 | + | func getCurrentPrice () = price | |
106 | + | ||
107 | + | ||
108 | + | func getAmount (key) = match getInteger(this, key) { | |
109 | + | case a: Int => | |
110 | + | a | |
111 | + | case _ => | |
112 | + | 0 | |
113 | + | } | |
114 | + | ||
115 | + | ||
116 | + | func hasStarted () = (getCurrentTime() >= startTime) | |
117 | + | ||
118 | + | ||
119 | + | func tokensaleHasEnded () = { | |
120 | + | let assets = match getInteger(this, keyDistAssets) { | |
121 | + | case a: Int => | |
122 | + | a | |
123 | + | case _ => | |
124 | + | tokensaleAmount | |
125 | + | } | |
126 | + | if ((getCurrentTime() > endTime)) | |
127 | + | then true | |
128 | + | else (assets == 0) | |
129 | + | } | |
130 | + | ||
131 | + | ||
132 | + | func swapHasEnded () = { | |
133 | + | let assets = match getInteger(this, swapKeyDistAssets) { | |
134 | + | case a: Int => | |
135 | + | a | |
136 | + | case _ => | |
137 | + | swapAmount | |
138 | + | } | |
139 | + | if ((getCurrentTime() > endTime)) | |
140 | + | then true | |
141 | + | else (swapAmount == 0) | |
142 | + | } | |
143 | + | ||
144 | + | ||
145 | + | func companyHasEnded () = if (tokensaleHasEnded()) | |
146 | + | then swapHasEnded() | |
147 | + | else false | |
148 | + | ||
149 | + | ||
150 | + | func getPayment (i) = match i.payment { | |
151 | + | case p: AttachedPayment => | |
152 | + | let isPaymentOk = match p.assetId { | |
153 | + | case assetId: ByteVector => | |
154 | + | if (!(investmentAssetIdIsWaves)) | |
155 | + | then (assetId == investmentAssetId) | |
156 | + | else false | |
157 | + | case _ => | |
158 | + | (investmentAssetIdIsWaves == true) | |
159 | + | } | |
160 | + | if (isPaymentOk) | |
161 | + | then if ((assetDecimalsOffset == 1)) | |
162 | + | then if (((p.amount % price) == 0)) | |
163 | + | then p.amount | |
164 | + | else throw("payment amount must be a multiple of token price") | |
165 | + | else p.amount | |
166 | + | else throw("Invalid asset ID of investment") | |
167 | + | case _ => | |
168 | + | throw("Payment must be attached") | |
169 | + | } | |
170 | + | ||
171 | + | ||
172 | + | func getSwapPayment (i) = match i.payment { | |
173 | + | case p: AttachedPayment => | |
174 | + | let isPaymentOk = match p.assetId { | |
175 | + | case assetId: ByteVector => | |
176 | + | (assetId == swapAssetId) | |
177 | + | case _ => | |
178 | + | false | |
179 | + | } | |
180 | + | if (isPaymentOk) | |
181 | + | then if ((assetDecimalsOffset == 1)) | |
182 | + | then if (((p.amount % swapPrice) == 0)) | |
183 | + | then p.amount | |
184 | + | else throw("payment amount must be a multiple of token price") | |
185 | + | else p.amount | |
186 | + | else throw("Invalid asset ID of investment") | |
187 | + | case _ => | |
188 | + | throw("Payment must be attached") | |
189 | + | } | |
190 | + | ||
191 | + | ||
192 | + | @Callable(i) | |
193 | + | func deposit () = { | |
194 | + | let currentPrice = getCurrentPrice() | |
195 | + | let accountAmount = getAmount(keyCollectedAmount) | |
196 | + | if (!(isTokensaleAllow())) | |
197 | + | then throw("This deposit method is unsopperted for this company") | |
198 | + | else if (!(hasStarted())) | |
199 | + | then throw(((("The Tokensale works between " + toString(startTime)) + " and ") + toString(endTime))) | |
200 | + | else if (tokensaleHasEnded()) | |
201 | + | then throw("The required amount has already been accumulated. If you are an investor, you can withdraw your funds.") | |
202 | + | else { | |
203 | + | let payment = getPayment(i) | |
204 | + | let currentKey = toBase58String(i.caller.bytes) | |
205 | + | let isAccountAllow = match getInteger(whitelistAddress, currentKey) { | |
206 | + | case a: Int => | |
207 | + | a | |
208 | + | case _ => | |
209 | + | -255 | |
210 | + | } | |
211 | + | if ((validState > isAccountAllow)) | |
212 | + | then throw("Your account has no right to send funds.") | |
213 | + | else { | |
214 | + | let accountAssets = match getInteger(this, keyDistAssets) { | |
215 | + | case a: Int => | |
216 | + | a | |
217 | + | case _ => | |
218 | + | tokensaleAmount | |
219 | + | } | |
220 | + | let tokensCalc = ((payment * assetDecimalsOffset) / currentPrice) | |
221 | + | let minPaymentInAssets = ((minPayment * assetDecimalsOffset) / currentPrice) | |
222 | + | if (if (if ((0 > (accountAssets - tokensCalc))) | |
223 | + | then true | |
224 | + | else (minPaymentInAssets > tokensCalc)) | |
225 | + | then true | |
226 | + | else if ((tokensCalc != accountAssets)) | |
227 | + | then (tokensCalc > (accountAssets - minPaymentInAssets)) | |
228 | + | else false) | |
229 | + | then throw("Incorrect payment amount.") | |
230 | + | else { | |
231 | + | let newInvestorAmount = (getAmount((keySumAmountPrefix + currentKey)) + payment) | |
232 | + | let newInvestorAssets = (getAmount((keySumAssetsPrefix + currentKey)) + tokensCalc) | |
233 | + | let newAccountAssets = (accountAssets - tokensCalc) | |
234 | + | let newAccountAmount = (accountAmount + payment) | |
235 | + | WriteSet([DataEntry((keySumAmountPrefix + currentKey), newInvestorAmount), DataEntry((keySumAssetsPrefix + currentKey), newInvestorAssets), DataEntry(keyDistAssets, newAccountAssets), DataEntry(keyCollectedAmount, newAccountAmount)]) | |
236 | + | } | |
237 | + | } | |
238 | + | } | |
239 | + | } | |
240 | + | ||
241 | + | ||
242 | + | ||
243 | + | @Callable(i) | |
244 | + | func swapDeposit () = { | |
245 | + | let currentPrice = swapPrice | |
246 | + | let accountAmount = getAmount(swapKeyCollectedAmount) | |
247 | + | if (!(isSwapAllow())) | |
248 | + | then throw("This swap-deposit method is unsopperted for this company") | |
249 | + | else if (!(hasStarted())) | |
250 | + | then throw(((("The Tokensale works between " + toString(startTime)) + " and ") + toString(endTime))) | |
251 | + | else if (swapHasEnded()) | |
252 | + | then throw("The required amount has already been accumulated. If you are an investor, you can withdraw your funds.") | |
253 | + | else { | |
254 | + | let payment = getSwapPayment(i) | |
255 | + | let currentKey = toBase58String(i.caller.bytes) | |
256 | + | let isAccountAllow = match getInteger(whitelistAddress, currentKey) { | |
257 | + | case a: Int => | |
258 | + | a | |
259 | + | case _ => | |
260 | + | -255 | |
261 | + | } | |
262 | + | if ((validState > isAccountAllow)) | |
263 | + | then throw("Your account has no right to send funds.") | |
264 | + | else { | |
265 | + | let accountAssets = match getInteger(this, swapKeyDistAssets) { | |
266 | + | case a: Int => | |
267 | + | a | |
268 | + | case _ => | |
269 | + | swapAmount | |
270 | + | } | |
271 | + | let tokensCalc = ((payment * assetDecimalsOffset) / currentPrice) | |
272 | + | if ((0 > (accountAssets - tokensCalc))) | |
273 | + | then throw("Incorrect payment amount.") | |
274 | + | else { | |
275 | + | let newInvestorAmount = (getAmount((swapKeySumAmountPrefix + currentKey)) + payment) | |
276 | + | let newInvestorAssets = (getAmount((swapKeySumAssetsPrefix + currentKey)) + tokensCalc) | |
277 | + | let newAccountAssets = (accountAssets - tokensCalc) | |
278 | + | let newAccountAmount = (accountAmount + payment) | |
279 | + | WriteSet([DataEntry((swapKeySumAmountPrefix + currentKey), newInvestorAmount), DataEntry((swapKeySumAssetsPrefix + currentKey), newInvestorAssets), DataEntry(swapKeyDistAssets, newAccountAssets), DataEntry(swapKeyCollectedAmount, newAccountAmount)]) | |
280 | + | } | |
281 | + | } | |
282 | + | } | |
283 | + | } | |
284 | + | ||
285 | + | ||
286 | + | ||
287 | + | @Callable(i) | |
288 | + | func withdrawal () = { | |
289 | + | let dAppStatus = match getInteger(dAppWhitelistAddress, toString(this)) { | |
290 | + | case a: Int => | |
291 | + | a | |
292 | + | case _ => | |
293 | + | 0 | |
294 | + | } | |
295 | + | if ((dAppStatus == 0)) | |
296 | + | then throw("Withdrawals are not available until the issuer passes verification") | |
297 | + | else { | |
298 | + | let currentKey = toBase58String(i.caller.bytes) | |
299 | + | let currentInvestorAssets = getAmount((keySumAssetsPrefix + currentKey)) | |
300 | + | let currentInvestorAmount = getAmount((keySumAmountPrefix + currentKey)) | |
301 | + | let currentInvestorSwapAssets = getAmount((swapKeySumAssetsPrefix + currentKey)) | |
302 | + | let currentInvestorSwapAmount = getAmount((swapKeySumAmountPrefix + currentKey)) | |
303 | + | let accountSwapAmount = getAmount(swapKeyCollectedAmount) | |
304 | + | let accountSwapAssets = getAmount(swapKeyDistAssets) | |
305 | + | let accountAmount = getAmount(keyCollectedAmount) | |
306 | + | let accountAssets = getAmount(keyDistAssets) | |
307 | + | let investmentAssetIdForTransfer = getInvestmentAssetIdForTransfer(investmentAssetIdIsWaves, investmentAssetId) | |
308 | + | if (!(companyHasEnded())) | |
309 | + | then throw("The Company is still active") | |
310 | + | else if (if (if ((currentKey == ownerAddressString)) | |
311 | + | then if ((accountAmount >= softCapAmount)) | |
312 | + | then true | |
313 | + | else (accountSwapAmount != 0) | |
314 | + | else false) | |
315 | + | then (dAppStatus == 1) | |
316 | + | else false) | |
317 | + | then { | |
318 | + | let issuerAlreadyGotFunds = getAmount(keyIssuer) | |
319 | + | if ((issuerAlreadyGotFunds == 0)) | |
320 | + | then { | |
321 | + | let scriptTransferResult = nil | |
322 | + | let updatedScriptTransferResult = if ((accountAmount >= softCapAmount)) | |
323 | + | then ScriptTransfer(ownerAddress, accountAmount, investmentAssetIdForTransfer) :: scriptTransferResult | |
324 | + | else scriptTransferResult | |
325 | + | let updatedScriptTransferResult1 = if ((accountAmount >= softCapAmount)) | |
326 | + | then ScriptTransfer(ownerAddress, accountSwapAmount, swapAssetId) :: updatedScriptTransferResult | |
327 | + | else updatedScriptTransferResult | |
328 | + | ScriptResult(WriteSet([DataEntry(keyIssuer, 1)]), TransferSet(updatedScriptTransferResult1)) | |
329 | + | } | |
330 | + | else throw("The issuer has already taken its share!") | |
331 | + | } | |
332 | + | else if (if ((currentInvestorAmount == 0)) | |
333 | + | then (currentInvestorSwapAmount == 0) | |
334 | + | else false) | |
335 | + | then throw("Don't have money") | |
336 | + | else { | |
337 | + | let writeSetResult = nil | |
338 | + | let scriptTransferResult = nil | |
339 | + | let updatedWriteSetResult1 = if ((currentInvestorAmount != 0)) | |
340 | + | then [writeSetResult, DataEntry((keySumAmountPrefix + currentKey), 0), DataEntry((keySumAssetsPrefix + currentKey), 0)] | |
341 | + | else writeSetResult | |
342 | + | let updatedWriteSetResult2 = if ((currentInvestorSwapAmount != 0)) | |
343 | + | then [updatedWriteSetResult1, DataEntry((swapKeySumAmountPrefix + currentKey), 0), DataEntry((swapKeySumAssetsPrefix + currentKey), 0)] | |
344 | + | else updatedWriteSetResult1 | |
345 | + | let updatedScriptTransferResult = if ((currentInvestorAmount != 0)) | |
346 | + | then if (if ((accountAmount >= softCapAmount)) | |
347 | + | then (dAppStatus == 1) | |
348 | + | else false) | |
349 | + | then ScriptTransfer(i.caller, currentInvestorAssets, issuerAssetId) :: scriptTransferResult | |
350 | + | else ScriptTransfer(i.caller, currentInvestorAmount, investmentAssetIdForTransfer) :: scriptTransferResult | |
351 | + | else scriptTransferResult | |
352 | + | let updatedScriptTransferResult1 = if ((currentInvestorSwapAmount != 0)) | |
353 | + | then ScriptTransfer(i.caller, currentInvestorSwapAssets, issuerAssetId) :: updatedScriptTransferResult | |
354 | + | else updatedScriptTransferResult | |
355 | + | ScriptResult(WriteSet(writeSetResult), TransferSet(scriptTransferResult)) | |
356 | + | } | |
357 | + | } | |
358 | + | } | |
359 | + | ||
360 | + | ||
361 | + | @Verifier(tx) | |
362 | + | func verify () = match tx { | |
363 | + | case tx: SetAssetScriptTransaction|SetScriptTransaction => | |
364 | + | let pKey1Signed = if (isDefined(getInteger(extract(pAddress1), toBase58String(tx.id)))) | |
365 | + | then 1 | |
366 | + | else 0 | |
367 | + | let pKey2Signed = if (isDefined(getInteger(extract(pAddress2), toBase58String(tx.id)))) | |
368 | + | then 1 | |
369 | + | else 0 | |
370 | + | let pKey3Signed = if (isDefined(getInteger(extract(pAddress3), toBase58String(tx.id)))) | |
371 | + | then 1 | |
372 | + | else 0 | |
373 | + | let pKey4Signed = if (isDefined(getInteger(extract(pAddress4), toBase58String(tx.id)))) | |
374 | + | then 1 | |
375 | + | else 0 | |
376 | + | let pKey5Signed = if (isDefined(getInteger(extract(pAddress5), toBase58String(tx.id)))) | |
377 | + | then 1 | |
378 | + | else 0 | |
379 | + | (((((pKey1Signed + pKey2Signed) + pKey3Signed) + pKey4Signed) + pKey5Signed) >= 3) | |
380 | + | case _ => | |
381 | + | false | |
382 | + | } | |
383 | + |
github/deemru/w8io/169f3d6 55.48 ms ◑