tx · 4uz1CZhUQLr7NzK28RBpS7XXCeK2DpLfvakiXwc5zoCh 3Mu7VYYXCdKzYgHbTRTiR2GcmRjdKwpcXtx: -0.01000000 Waves 2019.11.13 14:41 [763254] smart account 3Mu7VYYXCdKzYgHbTRTiR2GcmRjdKwpcXtx > SELF 0.00000000 Waves
{ "type": 13, "id": "4uz1CZhUQLr7NzK28RBpS7XXCeK2DpLfvakiXwc5zoCh", "fee": 1000000, "feeAssetId": null, "timestamp": 1573645316992, "version": 1, "sender": "3Mu7VYYXCdKzYgHbTRTiR2GcmRjdKwpcXtx", "senderPublicKey": "7hst8L8bJqbcGbPC9DbHZ5E83dQ3LXayYttNsUbgZt7r", "proofs": [ "un9k9Nfhvg21eEsWA7mncd5pVaxFCdHcS3sqesEMKESNWb4LXKTAWf344LytYCD8pRirAhG7gTCwwfn8Nd2NTFR" ], "script": "base64:AAIDAAAAAAAAAA4IARIFCgMCAgESAwoBCAAAADUAAAAAFGJ1eU91dGNvbWVUb2tlblR4RmVlAAAAAAAAB6EgAAAAAAVXQVZFUwAAAAAABfXhAAAAAAADVVNEAAAAAAAAAABkAAAAABRyb290QWNjb3VudFB1YmxpY0tleQEAAAAgq3GDWq9pwG2px8eeb2fO7WPh8zZ/woCUtUpqej1wwxUAAAAADmxpZ2FDb21taXNzaW9uAAAAAAAAAAAAAAAAABV0b3RhbEFzc2V0c1Blck91dGNvbWUAAAAAAAAAJxAAAAAAGnByZXNhbGVNYXhBc3NldHNQZXJPdXRjb21lAAAAAAAAAAu4AAAAAA9ldmVudEN1cnJlbmN5SWQBAAAAILOr7Y643GEksmFW3rTbIhQEuzBwkRdiSbh/vRQs0zM3AAAAAAxwcmVzYWxlUHJpY2UAAAAAAAAAADIAAAAACWxpdmVQcmljZQAAAAAAAAAAZAAAAAANbGl2ZVByaWNlU3RlcAAAAAAAAAAAFAAAAAATbGl2ZVByaWNlU3RlcFBlcmlvZAAAAAAAAAAD6AAAAAAJc3RhdHVzS2V5AgAAAAZzdGF0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b3VudAUAAAASb3V0Y29tZUFtb3VudFRvQnV5BQAAABlvdXRjb21lQW1vdW50RXZlbnRCYWxhbmNlBQAAAANmZWUDBQAAAAxpc0xpdmVTdGF0dXMJAQAAAAxzYWxlU3RyYXRlZ3kAAAAGBQAAAA9jdXN0b21lckFkZHJlc3MFAAAADm91dGNvbWVBc3NldElkBQAAAA1wYXltZW50QW1vdW50BQAAABJvdXRjb21lQW1vdW50VG9CdXkFAAAAGW91dGNvbWVBbW91bnRFdmVudEJhbGFuY2UFAAAAA2ZlZQkBAAAAE3Rocm93VW5kZWZpbmVkRXJyb3IAAAAAAAAAAWkBAAAADGNoYW5nZVN0YXR1cwAAAAEAAAAJbmV3U3RhdHVzAwkBAAAAASEAAAABCQEAAAARaXNTdXBwb3J0ZWRTdGF0dXMAAAABBQAAAAluZXdTdGF0dXMJAQAAACB0aHJvd1Vuc3VwcG9ydGVkRXZlbnRTdGF0dXNFcnJvcgAAAAADCQEAAAABIQAAAAEJAQAAAAxpc1Jvb3RDYWxsZXIAAAABBQAAAAFpCQEAAAAZdGhyb3dJc05vdFJvb3RDYWxsZXJFcnJvcgAAAAAJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACXNldFN0YXR1cwAAAAEFAAAACW5ld1N0YXR1cwUAAAADbmlsAAAAAJaf5vQ=", "chainId": 84, "height": 763254, "spentComplexity": 0 } View: original | compacted Prev: none Next: Hzsd1tXJyPBs8dXgaNtReBinGMQ7Gn9s4XhwXszUutCb 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 rootAccountPublicKey = base58'CYF7FumpbZzyHMFuFQRQfo9XC9veJemd3XuBkusRCcAg' | |
11 | + | ||
12 | + | let ligaCommission = 0 | |
13 | + | ||
14 | + | let totalAssetsPerOutcome = 10000 | |
15 | + | ||
16 | + | let presaleMaxAssetsPerOutcome = 3000 | |
17 | + | ||
18 | + | let eventCurrencyId = base58'D6N2rAqWN6ZCWnCeNFWLGqqjS6nJLeK4m19XiuhdDenr' | |
19 | + | ||
20 | + | let presalePrice = 50 | |
21 | + | ||
22 | + | let livePrice = 100 | |
23 | + | ||
24 | + | let livePriceStep = 20 | |
25 | + | ||
26 | + | let livePriceStepPeriod = 1000 | |
27 | + | ||
28 | + | let statusKey = "status" | |
29 | + | ||
30 | + | let pauseStatus = "pause" | |
31 | + | ||
32 | + | let presaleStatus = "presale" | |
33 | + | ||
34 | + | let liveStatus = "live" | |
35 | + | ||
36 | + | let completeStatus = "complete" | |
37 | + | ||
38 | + | let payoutStatus = "payout" | |
39 | + | ||
40 | + | func throwSalesIsNotAvailableInStatusError (status) = throw((("salesIsNotAvailableInStatusError" + ",") + status)) | |
41 | + | ||
42 | + | ||
43 | + | func throwNonexistentOutcomeAssetError (outcomeAssetId) = throw(("nonexistentOutcomeAssetError," + toBase58String(outcomeAssetId))) | |
44 | + | ||
45 | + | ||
46 | + | func throwNotEnoughOutcomeAssetsInPresaleStockError (amountToBuy,balance) = throw((((("notEnoughOutcomeAssetsInPresaleStockError" + ",") + toString(balance)) + ",") + toString(amountToBuy))) | |
47 | + | ||
48 | + | ||
49 | + | func throwNotEnoughOutcomeAssetsInSaleStockError (amountToBuy,balance) = throw((((("notEnoughOutcomeAssetsInSaleStockError" + ",") + toString(balance)) + ",") + toString(amountToBuy))) | |
50 | + | ||
51 | + | ||
52 | + | func throwUnsupportedEventPaymentAssetError (paymentCurrency) = throw((((("unsupportedEventPaymentAssetError" + ",") + toBase58String(eventCurrencyId)) + ",") + toBase58String(paymentCurrency))) | |
53 | + | ||
54 | + | ||
55 | + | func throwInsufficientPaymentError (receivedPaymentAmount,expectedPaymentAmount) = throw((((("insufficientPaymentError" + ",") + toString(expectedPaymentAmount)) + ",") + toString(receivedPaymentAmount))) | |
56 | + | ||
57 | + | ||
58 | + | func throwUnsupportedEventStatusError () = throw("unsupportedEventStatusError") | |
59 | + | ||
60 | + | ||
61 | + | func throwIsNotRootCallerError () = throw("isNotRootCallerError") | |
62 | + | ||
63 | + | ||
64 | + | let noPaymentError = "noPaymentError" | |
65 | + | ||
66 | + | func throwUndefinedError () = throw("undefinedError") | |
67 | + | ||
68 | + | ||
69 | + | func getIntOr (key,default) = if (isDefined(getInteger(this, key))) | |
70 | + | then getIntegerValue(this, key) | |
71 | + | else default | |
72 | + | ||
73 | + | ||
74 | + | func getStringOr (key,default) = if (isDefined(getInteger(this, key))) | |
75 | + | then getStringValue(this, key) | |
76 | + | else default | |
77 | + | ||
78 | + | ||
79 | + | func getInt (key) = getIntegerValue(this, key) | |
80 | + | ||
81 | + | ||
82 | + | func setInt (key,value) = DataEntry(key, value) | |
83 | + | ||
84 | + | ||
85 | + | func getStr (key) = getStringValue(this, key) | |
86 | + | ||
87 | + | ||
88 | + | func setStr (key,value) = DataEntry(key, value) | |
89 | + | ||
90 | + | ||
91 | + | func setBytes (key,value) = DataEntry(key, value) | |
92 | + | ||
93 | + | ||
94 | + | func getBytes (key) = getBinaryValue(this, key) | |
95 | + | ||
96 | + | ||
97 | + | func isSupportedStatus (status) = if (if (if (if ((status == pauseStatus)) | |
98 | + | then true | |
99 | + | else (status == presaleStatus)) | |
100 | + | then true | |
101 | + | else (status == liveStatus)) | |
102 | + | then true | |
103 | + | else (status == completeStatus)) | |
104 | + | then true | |
105 | + | else (status == payoutStatus) | |
106 | + | ||
107 | + | ||
108 | + | func getStatus () = getStr(statusKey) | |
109 | + | ||
110 | + | ||
111 | + | func setStatus (status) = setStr(statusKey, status) | |
112 | + | ||
113 | + | ||
114 | + | func getPayment (i) = valueOrErrorMessage(i.payment, noPaymentError) | |
115 | + | ||
116 | + | ||
117 | + | func getPaymentAssetId (payment) = match payment.assetId { | |
118 | + | case assetId: ByteVector => | |
119 | + | assetId | |
120 | + | case assetId: Unit => | |
121 | + | fromBase58String("WAVES") | |
122 | + | case _ => | |
123 | + | throw() | |
124 | + | } | |
125 | + | ||
126 | + | ||
127 | + | func getIntegerFromAccount (accountAddress,key) = match getInteger(accountAddress, key) { | |
128 | + | case i: Int => | |
129 | + | i | |
130 | + | case _ => | |
131 | + | 0 | |
132 | + | } | |
133 | + | ||
134 | + | ||
135 | + | func arithmeticSeries (a,d,n) = ((n * ((2 * a) + ((n - 1) * d))) / 2) | |
136 | + | ||
137 | + | ||
138 | + | func getPresaleOutcomeAmountSalesKey (outcomeAssetId) = ("presaleOutcomeAmountSales_" + toBase58String(outcomeAssetId)) | |
139 | + | ||
140 | + | ||
141 | + | func getPresaleOutcomeAmountSales (outcomeAssetId) = { | |
142 | + | let presaleOutcomeAmountSalesKey = getPresaleOutcomeAmountSalesKey(outcomeAssetId) | |
143 | + | getIntegerFromAccount(this, presaleOutcomeAmountSalesKey) | |
144 | + | } | |
145 | + | ||
146 | + | ||
147 | + | func getRateWAVESInUSD () = { | |
148 | + | let rateWAVESInUSDDefault = 50 | |
149 | + | rateWAVESInUSDDefault | |
150 | + | } | |
151 | + | ||
152 | + | ||
153 | + | func calculateFeeInEventPaymentAsset () = ((buyOutcomeTokenTxFee * getRateWAVESInUSD()) / USD) | |
154 | + | ||
155 | + | ||
156 | + | func sum (n) = { | |
157 | + | let x = (n / livePriceStepPeriod) | |
158 | + | let fullSum = arithmeticSeries(livePrice, livePriceStep, x) | |
159 | + | ((fullSum * livePriceStepPeriod) + ((arithmeticSeries(livePrice, livePriceStep, (x + 1)) - fullSum) * (n % livePriceStepPeriod))) | |
160 | + | } | |
161 | + | ||
162 | + | ||
163 | + | func isRootCaller (i) = { | |
164 | + | let callerAccountPubKey = toBase58String(i.callerPublicKey) | |
165 | + | let rootAccountPubKey = toBase58String(rootAccountPublicKey) | |
166 | + | if ((callerAccountPubKey == rootAccountPubKey)) | |
167 | + | then true | |
168 | + | else false | |
169 | + | } | |
170 | + | ||
171 | + | ||
172 | + | func isAdminCaller (i) = { | |
173 | + | let callerAccountPubKey = toBase58String(i.callerPublicKey) | |
174 | + | let rootAccountPubKey = toBase58String(rootAccountPublicKey) | |
175 | + | if ((callerAccountPubKey == rootAccountPubKey)) | |
176 | + | then true | |
177 | + | else false | |
178 | + | } | |
179 | + | ||
180 | + | ||
181 | + | func amountToPay (alreadySold,amountToBuy) = (sum((alreadySold + amountToBuy)) - sum(alreadySold)) | |
182 | + | ||
183 | + | ||
184 | + | func presaleStrategy (customerAddress,outcomeAssetId,paymentAmount,outcomeAmountToBuy,outcomeAmountEventBalance,fee) = { | |
185 | + | let outcomeAmountAlreadySold = (totalAssetsPerOutcome - outcomeAmountEventBalance) | |
186 | + | let outcomeAmountAvailableInPresalePeriod = (presaleMaxAssetsPerOutcome - outcomeAmountAlreadySold) | |
187 | + | let outcomeRequiredPaymentAmount = ((presalePrice * outcomeAmountToBuy) + fee) | |
188 | + | if ((outcomeAmountToBuy > outcomeAmountAvailableInPresalePeriod)) | |
189 | + | then throwNotEnoughOutcomeAssetsInPresaleStockError(outcomeAmountToBuy, outcomeAmountAvailableInPresalePeriod) | |
190 | + | else if ((paymentAmount != outcomeRequiredPaymentAmount)) | |
191 | + | then throwInsufficientPaymentError(paymentAmount, outcomeRequiredPaymentAmount) | |
192 | + | else { | |
193 | + | let presaleOutcomeAmountSalesKey = getPresaleOutcomeAmountSalesKey(outcomeAssetId) | |
194 | + | let currentPresaleOutcomeAmountSales = getPresaleOutcomeAmountSales(outcomeAssetId) | |
195 | + | let newPresaleOutcomeAmountSales = (currentPresaleOutcomeAmountSales + outcomeAmountToBuy) | |
196 | + | let writeSet = WriteSet([DataEntry(presaleOutcomeAmountSalesKey, newPresaleOutcomeAmountSales)]) | |
197 | + | let transferSet = TransferSet([ScriptTransfer(customerAddress, buyOutcomeTokenTxFee, unit), ScriptTransfer(customerAddress, outcomeAmountToBuy, outcomeAssetId)]) | |
198 | + | ScriptResult(writeSet, transferSet) | |
199 | + | } | |
200 | + | } | |
201 | + | ||
202 | + | ||
203 | + | func saleStrategy (customerAddress,outcomeAssetId,paymentAmount,outcomeAmountToBuy,outcomeAmountEventBalance,fee) = { | |
204 | + | let presaleOutcomeAmountSales = getPresaleOutcomeAmountSales(outcomeAssetId) | |
205 | + | let outcomeAmountAlreadySold = ((totalAssetsPerOutcome - presaleOutcomeAmountSales) - outcomeAmountEventBalance) | |
206 | + | let outcomeRequiredPaymentAmount = (amountToPay(outcomeAmountAlreadySold, outcomeAmountToBuy) + fee) | |
207 | + | if ((outcomeAmountToBuy > outcomeAmountEventBalance)) | |
208 | + | then throwNotEnoughOutcomeAssetsInSaleStockError(outcomeAmountToBuy, outcomeAmountEventBalance) | |
209 | + | else if ((paymentAmount != outcomeRequiredPaymentAmount)) | |
210 | + | then throwInsufficientPaymentError(paymentAmount, outcomeRequiredPaymentAmount) | |
211 | + | else TransferSet([ScriptTransfer(customerAddress, buyOutcomeTokenTxFee, unit), ScriptTransfer(customerAddress, outcomeAmountToBuy, outcomeAssetId)]) | |
212 | + | } | |
213 | + | ||
214 | + | ||
215 | + | @Callable(i) | |
216 | + | func buyOutcomeToken (custometPubKey,outcomeAssetId,outcomeAmountToBuy) = { | |
217 | + | let fee = calculateFeeInEventPaymentAsset() | |
218 | + | let customerAddress = i.caller | |
219 | + | let outcomeAmountEventBalance = assetBalance(this, outcomeAssetId) | |
220 | + | let status = getStatus() | |
221 | + | let payment = getPayment(i) | |
222 | + | let paymentAmount = payment.amount | |
223 | + | let paymentAssetId = getPaymentAssetId(payment) | |
224 | + | let isNotSupportedPaymentAsset = (paymentAssetId != eventCurrencyId) | |
225 | + | let isPresaleStatus = (status == presaleStatus) | |
226 | + | let isLiveStatus = (status == liveStatus) | |
227 | + | let isSalesAvailable = if (isPresaleStatus) | |
228 | + | then true | |
229 | + | else isLiveStatus | |
230 | + | if ((outcomeAmountEventBalance == 0)) | |
231 | + | then throwNonexistentOutcomeAssetError(outcomeAssetId) | |
232 | + | else if (isNotSupportedPaymentAsset) | |
233 | + | then throwUnsupportedEventPaymentAssetError(paymentAssetId) | |
234 | + | else if (!(isSalesAvailable)) | |
235 | + | then throwSalesIsNotAvailableInStatusError(status) | |
236 | + | else if (isPresaleStatus) | |
237 | + | then presaleStrategy(customerAddress, outcomeAssetId, paymentAmount, outcomeAmountToBuy, outcomeAmountEventBalance, fee) | |
238 | + | else if (isLiveStatus) | |
239 | + | then saleStrategy(customerAddress, outcomeAssetId, paymentAmount, outcomeAmountToBuy, outcomeAmountEventBalance, fee) | |
240 | + | else throwUndefinedError() | |
241 | + | } | |
242 | + | ||
243 | + | ||
244 | + | ||
245 | + | @Callable(i) | |
246 | + | func changeStatus (newStatus) = if (!(isSupportedStatus(newStatus))) | |
247 | + | then throwUnsupportedEventStatusError() | |
248 | + | else if (!(isRootCaller(i))) | |
249 | + | then throwIsNotRootCallerError() | |
250 | + | else WriteSet([setStatus(newStatus)]) | |
251 | + | ||
252 | + |
github/deemru/w8io/026f985 27.62 ms ◑