tx · GwNbUzEnFb8UiscoZGV14HeTUpwLe6U9ZEKgGuyS45qq 3N4hXjSD1vVDxawxxZwprRzr3bHqXPMiqyJ: -0.01000000 Waves 2019.11.07 18:38 [754696] smart account 3N4hXjSD1vVDxawxxZwprRzr3bHqXPMiqyJ > SELF 0.00000000 Waves
{ "type": 13, "id": "GwNbUzEnFb8UiscoZGV14HeTUpwLe6U9ZEKgGuyS45qq", "fee": 1000000, "feeAssetId": null, "timestamp": 1573141091758, "version": 1, "sender": "3N4hXjSD1vVDxawxxZwprRzr3bHqXPMiqyJ", "senderPublicKey": "FrdE1LfhaQu8AzvtGEdWwow5DgCQahpMHDcewPRc9aDi", "proofs": [ "ktSjfegSCSeu4c7BPk7EcDNqBEv5pJA1Bb1j2C3tGUHG2b98mdxHzkrCFEgqGP6LjkP44iwpw3A8RJneSWnB7E3" ], "script": "base64:AAIDAAAAAAAAAAgIARIECgICAQAAACcAAAAAFGJ1eU91dGNvbWVUb2tlblR4RmVlAAAAAAAAB6EgAAAAAAVXQVZFUwAAAAAABfXhAAAAAAADVVNEAAAAAAAAAABkAAAAAA5saWdhQ29tbWlzc2lvbgAAAAAAAAAAAAAAAAAdd2F2ZXNSYXRlc09yYWNsZUFkZHJlc3NTdHJpbmcBAAAAAAAAAAAVdG90YWxBc3NldHNQZXJPdXRjb21lAAAAAAAAACcQAAAAABpwcmVzYWxlTWF4QXNzZXRzUGVyT3V0Y29tZQAAAAAAAAALuAAAAAAPZXZlbnRDdXJyZW5jeUlkAQAAAAAAAAAAEGV2ZW50U3RhcnRIZWlnaHQAAAAAAAAAAAAAAAAADmV2ZW50RW5kSGVpZ2h0AAAAAAAAAAABAAAAAAxwcmVzYWxlUHJpY2UAAAAAAAAAA+gAAAAAEnByZXNhbGVTdGFydEhlaWdodAAAAAAAAAAAAAAAAAAQcHJlc2FsZUVuZEhlaWdodAAAAAAAAAAACgAAAAAJc2FsZVByaWNlAAAAAAAAABOIAAAAAA1zYWxlUHJpY2VTdGVwAAAA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dW50VG9CdXkFAAAAGW91dGNvbWVBbW91bnRFdmVudEJhbGFuY2UFAAAAA2ZlZQkBAAAAE3Rocm93VW5kZWZpbmVkRXJyb3IAAAAAAAAAANFCSBg=", "chainId": 84, "height": 754696, "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 buyOutcomeTokenTxFee = 500000 | |
5 | + | ||
6 | + | let WAVES = 100000000 | |
7 | + | ||
8 | + | let USD = 100 | |
9 | + | ||
10 | + | let ligaCommission = 0 | |
11 | + | ||
12 | + | let wavesRatesOracleAddressString = base58'' | |
13 | + | ||
14 | + | let totalAssetsPerOutcome = 10000 | |
15 | + | ||
16 | + | let presaleMaxAssetsPerOutcome = 3000 | |
17 | + | ||
18 | + | let eventCurrencyId = base58'' | |
19 | + | ||
20 | + | let eventStartHeight = 0 | |
21 | + | ||
22 | + | let eventEndHeight = 1 | |
23 | + | ||
24 | + | let presalePrice = 1000 | |
25 | + | ||
26 | + | let presaleStartHeight = 0 | |
27 | + | ||
28 | + | let presaleEndHeight = 10 | |
29 | + | ||
30 | + | let salePrice = 5000 | |
31 | + | ||
32 | + | let salePriceStep = 500 | |
33 | + | ||
34 | + | let salePriceStepPeriod = 100 | |
35 | + | ||
36 | + | let saleStartHeight = 0 | |
37 | + | ||
38 | + | let saleEndHeight = 10 | |
39 | + | ||
40 | + | func throwBuyBeforePresalePeriodError () = throw((((("buyBeforePresalePeriodError" + ",") + toString(presaleStartHeight)) + ",") + toString(height))) | |
41 | + | ||
42 | + | ||
43 | + | func throwBuyAfterSalePeriodError () = throw((((("buyAfterSalePeriodError" + ",") + toString(saleEndHeight)) + ",") + toString(height))) | |
44 | + | ||
45 | + | ||
46 | + | func throwNonexistentOutcomeAssetError (outcomeAssetId) = throw(("nonexistentOutcomeAssetError," + toBase58String(outcomeAssetId))) | |
47 | + | ||
48 | + | ||
49 | + | func throwNotEnoughOutcomeAssetsInPresaleStockError (amountToBuy,balance) = throw((((("notEnoughOutcomeAssetsInPresaleStockError" + ",") + toString(balance)) + ",") + toString(amountToBuy))) | |
50 | + | ||
51 | + | ||
52 | + | func throwNotEnoughOutcomeAssetsInSaleStockError (amountToBuy,balance) = throw((((("notEnoughOutcomeAssetsInSaleStockError" + ",") + toString(balance)) + ",") + toString(amountToBuy))) | |
53 | + | ||
54 | + | ||
55 | + | func throwUnsupportedEventPaymentAssetError (paymentCurrency) = throw((((("unsupportedEventPaymentAssetError" + ",") + toBase58String(eventCurrencyId)) + ",") + toBase58String(paymentCurrency))) | |
56 | + | ||
57 | + | ||
58 | + | func throwInsufficientPaymentError (receivedPaymentAmount,expectedPaymentAmount) = throw((((("insufficientPaymentError" + ",") + toString(expectedPaymentAmount)) + ",") + toString(receivedPaymentAmount))) | |
59 | + | ||
60 | + | ||
61 | + | let noPaymentError = "noPaymentError" | |
62 | + | ||
63 | + | func throwUndefinedError () = throw("undefinedError") | |
64 | + | ||
65 | + | ||
66 | + | func getPayment (i) = valueOrErrorMessage(i.payment, noPaymentError) | |
67 | + | ||
68 | + | ||
69 | + | func getPaymentAssetId (payment) = match payment.assetId { | |
70 | + | case assetId: ByteVector => | |
71 | + | assetId | |
72 | + | case assetId: Unit => | |
73 | + | fromBase58String("WAVES") | |
74 | + | case _ => | |
75 | + | throw() | |
76 | + | } | |
77 | + | ||
78 | + | ||
79 | + | func getIntegerFromAccount (accountAddress,key) = match getInteger(accountAddress, key) { | |
80 | + | case i: Int => | |
81 | + | i | |
82 | + | case _ => | |
83 | + | 0 | |
84 | + | } | |
85 | + | ||
86 | + | ||
87 | + | func arithmeticSeries (a,d,n) = ((n * ((2 * a) + ((n - 1) * d))) / 2) | |
88 | + | ||
89 | + | ||
90 | + | func getPresaleOutcomeAmountSalesKey (outcomeAssetId) = ("presaleOutcomeAmountSales_" + toBase58String(outcomeAssetId)) | |
91 | + | ||
92 | + | ||
93 | + | func getPresaleOutcomeAmountSales (outcomeAssetId) = { | |
94 | + | let presaleOutcomeAmountSalesKey = getPresaleOutcomeAmountSalesKey(outcomeAssetId) | |
95 | + | getIntegerFromAccount(this, presaleOutcomeAmountSalesKey) | |
96 | + | } | |
97 | + | ||
98 | + | ||
99 | + | func getRateWAVESInUSD () = { | |
100 | + | let wavesRatesOracleAddress = addressFromString(toBase58String(wavesRatesOracleAddressString)) | |
101 | + | let rateWAVESInUSDDefault = 50 | |
102 | + | match wavesRatesOracleAddress { | |
103 | + | case address: Address => | |
104 | + | getIntegerFromAccount(address, "waves_usd_2") | |
105 | + | case address: Unit => | |
106 | + | rateWAVESInUSDDefault | |
107 | + | case _ => | |
108 | + | throw() | |
109 | + | } | |
110 | + | } | |
111 | + | ||
112 | + | ||
113 | + | func calculateFeeInEventPaymentAsset () = ((buyOutcomeTokenTxFee * getRateWAVESInUSD()) / USD) | |
114 | + | ||
115 | + | ||
116 | + | func sum (n) = { | |
117 | + | let x = (n / salePriceStepPeriod) | |
118 | + | let fullSum = arithmeticSeries(salePrice, salePriceStep, x) | |
119 | + | ((fullSum * salePriceStepPeriod) + ((arithmeticSeries(salePrice, salePriceStep, (x + 1)) - fullSum) * (n % salePriceStepPeriod))) | |
120 | + | } | |
121 | + | ||
122 | + | ||
123 | + | func amountToPay (alreadySold,amountToBuy) = (sum((alreadySold + amountToBuy)) - sum(alreadySold)) | |
124 | + | ||
125 | + | ||
126 | + | func presaleStrategy (customerAddress,outcomeAssetId,paymentAmount,outcomeAmountToBuy,outcomeAmountEventBalance,fee) = { | |
127 | + | let outcomeAmountAlreadySold = (totalAssetsPerOutcome - outcomeAmountEventBalance) | |
128 | + | let outcomeAmountAvailableInPresalePeriod = (presaleMaxAssetsPerOutcome - outcomeAmountAlreadySold) | |
129 | + | let outcomeRequiredPaymentAmount = ((presalePrice * outcomeAmountToBuy) + fee) | |
130 | + | if ((outcomeAmountToBuy > outcomeAmountAvailableInPresalePeriod)) | |
131 | + | then throwNotEnoughOutcomeAssetsInPresaleStockError(outcomeAmountToBuy, outcomeAmountAvailableInPresalePeriod) | |
132 | + | else if ((paymentAmount != outcomeRequiredPaymentAmount)) | |
133 | + | then throwInsufficientPaymentError(paymentAmount, outcomeRequiredPaymentAmount) | |
134 | + | else { | |
135 | + | let presaleOutcomeAmountSalesKey = getPresaleOutcomeAmountSalesKey(outcomeAssetId) | |
136 | + | let currentPresaleOutcomeAmountSales = getPresaleOutcomeAmountSales(outcomeAssetId) | |
137 | + | let newPresaleOutcomeAmountSales = (currentPresaleOutcomeAmountSales + outcomeAmountToBuy) | |
138 | + | let writeSet = WriteSet([DataEntry(presaleOutcomeAmountSalesKey, newPresaleOutcomeAmountSales)]) | |
139 | + | let transferSet = TransferSet([ScriptTransfer(customerAddress, buyOutcomeTokenTxFee, unit), ScriptTransfer(customerAddress, outcomeAmountToBuy, outcomeAssetId)]) | |
140 | + | ScriptResult(writeSet, transferSet) | |
141 | + | } | |
142 | + | } | |
143 | + | ||
144 | + | ||
145 | + | func saleStrategy (customerAddress,outcomeAssetId,paymentAmount,outcomeAmountToBuy,outcomeAmountEventBalance,fee) = { | |
146 | + | let presaleOutcomeAmountSales = getPresaleOutcomeAmountSales(outcomeAssetId) | |
147 | + | let outcomeAmountAlreadySold = ((totalAssetsPerOutcome - presaleOutcomeAmountSales) - outcomeAmountEventBalance) | |
148 | + | let outcomeRequiredPaymentAmount = (amountToPay(outcomeAmountAlreadySold, outcomeAmountToBuy) + fee) | |
149 | + | if ((outcomeAmountToBuy > outcomeAmountEventBalance)) | |
150 | + | then throwNotEnoughOutcomeAssetsInSaleStockError(outcomeAmountToBuy, outcomeAmountEventBalance) | |
151 | + | else if ((paymentAmount != outcomeRequiredPaymentAmount)) | |
152 | + | then throwInsufficientPaymentError(paymentAmount, outcomeRequiredPaymentAmount) | |
153 | + | else TransferSet([ScriptTransfer(customerAddress, buyOutcomeTokenTxFee, unit), ScriptTransfer(customerAddress, outcomeAmountToBuy, outcomeAssetId)]) | |
154 | + | } | |
155 | + | ||
156 | + | ||
157 | + | @Callable(i) | |
158 | + | func buyOutcomeToken (outcomeAssetId,outcomeAmountToBuy) = { | |
159 | + | let fee = calculateFeeInEventPaymentAsset() | |
160 | + | let customerAddress = i.caller | |
161 | + | let outcomeAmountEventBalance = assetBalance(this, outcomeAssetId) | |
162 | + | let payment = getPayment(i) | |
163 | + | let paymentAmount = payment.amount | |
164 | + | let paymentAssetId = getPaymentAssetId(payment) | |
165 | + | let isNotSupportedPaymentAsset = (paymentAssetId != eventCurrencyId) | |
166 | + | let isPresalePeriod = if ((height >= presaleStartHeight)) | |
167 | + | then (presaleEndHeight >= height) | |
168 | + | else false | |
169 | + | let isSalePeriod = if ((height >= saleStartHeight)) | |
170 | + | then (saleEndHeight >= height) | |
171 | + | else false | |
172 | + | if ((outcomeAmountEventBalance == 0)) | |
173 | + | then throwNonexistentOutcomeAssetError(outcomeAssetId) | |
174 | + | else if (isNotSupportedPaymentAsset) | |
175 | + | then throwUnsupportedEventPaymentAssetError(paymentAssetId) | |
176 | + | else if ((presaleStartHeight > height)) | |
177 | + | then throwBuyBeforePresalePeriodError() | |
178 | + | else if ((height > saleEndHeight)) | |
179 | + | then throwBuyAfterSalePeriodError() | |
180 | + | else if (isPresalePeriod) | |
181 | + | then presaleStrategy(customerAddress, outcomeAssetId, paymentAmount, outcomeAmountToBuy, outcomeAmountEventBalance, fee) | |
182 | + | else if (isSalePeriod) | |
183 | + | then saleStrategy(customerAddress, outcomeAssetId, paymentAmount, outcomeAmountToBuy, outcomeAmountEventBalance, fee) | |
184 | + | else throwUndefinedError() | |
185 | + | } | |
186 | + | ||
187 | + |
github/deemru/w8io/026f985 19.86 ms ◑