tx · 7Qo512heWwdNf1Jx3exX8Vu6N3xcBhuvPScY3Us3Di4n 3Mx2fYP2ipEikDjD7jj5kqhzqbpDw2mTJPz: -0.01000000 Waves 2020.01.14 19:47 [853985] smart account 3Mx2fYP2ipEikDjD7jj5kqhzqbpDw2mTJPz > SELF 0.00000000 Waves
{ "type": 13, "id": "7Qo512heWwdNf1Jx3exX8Vu6N3xcBhuvPScY3Us3Di4n", "fee": 1000000, "feeAssetId": null, "timestamp": 1579020445845, "version": 1, "sender": "3Mx2fYP2ipEikDjD7jj5kqhzqbpDw2mTJPz", "senderPublicKey": "EBUbBxddWAuXcgAs4ww6SiS8crreiyVHJhc8k2mzctgN", "proofs": [ "5DfXAzLBzqLjqX17o6JyVLE7vKip9WEYBqvq37jJPV1nMg8HWECcxoQ843jwUbXgDsmwkTQdGBp88jWPxGQwN74u" ], "script": "base64:AAIDAAAAAAAAAAgIARIAEgASAAAAADQAAAAADWlzc3VlckFzc2V0SWQBAAAAIIfnFvCAYZWkw3E3ZyLE147cMAI73YaOnzaoDmiz6Ba/AAAAABFpbnZlc3RtZW50QXNzZXRJZAEAAAAgzKCED038fo8oldF/i+/T049zqsmC9lchpEYxh38s/DEAAAAAGGludmVzdG1lbnRBc3NldElkSXNXYXZlcwcAAAAADm93bmVyUHVibGljS2V5AQAAACCKU2B4iX1XPCBdzblawAAggHqQmUns53vb4uG/BUvZYgAAAAAMb3duZXJBZGRyZXNzCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAAA5vd25lclB1YmxpY0tleQAAAAASb3duZXJBZGRyZXNzU3RyaW5nAgAAACMzTXFRaFFGempZZGFkOEJIb3VSaEJnY1l4OGt6YXk3Rjc1cAAAAAATYXNzZXREZWNpbWFsc09mZnNldAAAAAAAAAAAAQAAAAAPdG9rZW5zYWxlQW1vdW50AAAAAAAAAAPoAAAAAAlzdGFydFRpbWUAAAAAAF4d7XgAAAAAB2VuZFRpbWUAAAAAAF4jCfwAAAAABXByaWNl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AUAAAALcEtleTRTaWduZWQFAAAAC3BLZXk1U2lnbmVkAAAAAAAAAAADB+/9wwY=", "chainId": 84, "height": 853985, "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'A9WR8V62sfPdJqJoBzSYXhpGxhuCfiVo5uHAqg5S1Emc' | |
5 | + | ||
6 | + | let investmentAssetId = base58'Emn8cyGDFgnLCKLTXqVWhKJARhtR2muBUuZaSmqNzDfn' | |
7 | + | ||
8 | + | let investmentAssetIdIsWaves = false | |
9 | + | ||
10 | + | let ownerPublicKey = base58'AJy151Fdd1CHhB9v5mNmLHYqjNjcXy9ZfoDeAVHUeB5T' | |
11 | + | ||
12 | + | let ownerAddress = addressFromPublicKey(ownerPublicKey) | |
13 | + | ||
14 | + | let ownerAddressString = "3MqQhQFzjYdad8BHouRhBgcYx8kzay7F75p" | |
15 | + | ||
16 | + | let assetDecimalsOffset = 1 | |
17 | + | ||
18 | + | let tokensaleAmount = 1000 | |
19 | + | ||
20 | + | let startTime = 1579019640 | |
21 | + | ||
22 | + | let endTime = 1579354620 | |
23 | + | ||
24 | + | let price = 100000000 | |
25 | + | ||
26 | + | let softCapAmount = 10000000000 | |
27 | + | ||
28 | + | let minPayment = 100000000 | |
29 | + | ||
30 | + | let swapAssetId = base58'AB1EjGamzeQdfjThY1MTabtCDDKYnK8YRgr9osK9GXoy' | |
31 | + | ||
32 | + | let swapAmount = 1000 | |
33 | + | ||
34 | + | let swapPrice = 100000000 | |
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/fabc49c 22.53 ms ◑