tx · BcDQHzgX3H46jVsu4qEZaxa9oWqHHEtndqNh3LiXG8MH 3MpABcPJLQiG9Yxzk3ZV8e2nEbRe1gZHbZe: -0.02000000 Waves 2020.06.17 16:16 [1047586] smart account 3MpABcPJLQiG9Yxzk3ZV8e2nEbRe1gZHbZe > SELF 0.00000000 Waves
{ "type": 13, "id": "BcDQHzgX3H46jVsu4qEZaxa9oWqHHEtndqNh3LiXG8MH", "fee": 2000000, "feeAssetId": null, "timestamp": 1592399919238, "version": 1, "sender": "3MpABcPJLQiG9Yxzk3ZV8e2nEbRe1gZHbZe", "senderPublicKey": "AixLFScfYY3rkC6MkFBBW8xXM1a6q3i79CUrcgykP4V3", "proofs": [ "4M1iMpLCpt5hPeu6vz2dU7sxENEkydQp7i2aZaYg8BX1RvDXGpqjJ5hPXfoFFGY3Bnd6huWfutFr2MCLkHR4TT5w", "22xYJKzs6Lp6rg96gGxPPHWqk7nYUbaeA4UQWPDJYJWSMzxMh8TGErx9p9ZcfxftGTi52649RWQV44Bb42pggRm3", "jj7uvmsn58VNXi2e7vbcEHQTw53RTcLF5xKWUMWUiMZnkcnpJ58bJGc895M8Y6o9PEfEVJmxaMQgV2gSTY7LtrH" ], "script": "base64:AAIDAAAAAAAAABYIARIDCgEBEgQKAgEIEgMKAQgSABIAAAAAOgEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAAAQAAABZnZXRCb29sQnlBZGRyZXNzQW5k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ZzAAAAAAAAAAAACQACWQAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAABCQACWQAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAQAAAAAAAAAAAQAAAAAAAAAAAAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAACCQACWQAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAgAAAAAAAAAAAQAAAAAAAAAAAAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAADCQACWQAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAwAAAAAAAAAAAgAAAAAAAAAAAAkAAGcAAAACBQAAAAVjb3VudAAAAAAAAAAAAxthPWk=", "chainId": 84, "height": 1047586, "spentComplexity": 0 } View: original | compacted Prev: Abf4tzorDKciVSpFWfGaqGMC239B5iNsKUhHGnRSNo7X Next: 4rAHTqxmDuDbNfg9QyB9fEPuFyTrnc84vPF1SJmCZVpm Diff:
Old | New | Differences | |
---|---|---|---|
44 | 44 | let WAVELET = 100000000 | |
45 | 45 | ||
46 | 46 | let PAULI = 1000000 | |
47 | + | ||
48 | + | let PRICELET = 1000000 | |
47 | 49 | ||
48 | 50 | let MINORDERTOTAL = (10 * WAVELET) | |
49 | 51 | ||
102 | 104 | func getNextOrderKey (orderId) = ("order_next_" + orderId) | |
103 | 105 | ||
104 | 106 | ||
105 | - | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, | |
107 | + | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI) | |
106 | 108 | ||
107 | 109 | ||
108 | - | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, | |
110 | + | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET) | |
109 | 111 | ||
110 | 112 | ||
111 | 113 | func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price) | |
252 | 254 | func instantBuyNsbtOrFail (roi) = { | |
253 | 255 | let pmt = extract(i.payment) | |
254 | 256 | let priceWavesByBondCents = fraction((100 + roi), currentPrice, 100) | |
255 | - | let price = (( | |
257 | + | let price = ((PRICELET * PRICELET) / priceWavesByBondCents) | |
256 | 258 | internalAddBuyBondOrder(roi, price, "", i, true) | |
257 | 259 | } | |
258 | 260 | ||
261 | 263 | @Callable(i) | |
262 | 264 | func addBuyBondOrder (price,prevOrder) = { | |
263 | 265 | let pmt = extract(i.payment) | |
264 | - | let priceWavesByBondCents = fraction( | |
266 | + | let priceWavesByBondCents = fraction(PRICELET, PRICELET, price) | |
265 | 267 | let roi = fraction((priceWavesByBondCents - currentPrice), 100, currentPrice) | |
266 | 268 | if ((0 >= price)) | |
267 | 269 | then throw("price less zero") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getNumberByKey (key) = match getInteger(this, key) { | |
5 | 5 | case a: Int => | |
6 | 6 | a | |
7 | 7 | case _ => | |
8 | 8 | 0 | |
9 | 9 | } | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func getStringByKey (key) = match getString(this, key) { | |
13 | 13 | case a: String => | |
14 | 14 | a | |
15 | 15 | case _ => | |
16 | 16 | "" | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func getBoolByAddressAndKey (address,key) = match getBoolean(address, key) { | |
21 | 21 | case a: Boolean => | |
22 | 22 | a | |
23 | 23 | case _ => | |
24 | 24 | false | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func getStringByAddressAndKey (address,key) = match getString(address, key) { | |
29 | 29 | case a: String => | |
30 | 30 | a | |
31 | 31 | case _ => | |
32 | 32 | "" | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func getNumberByAddressAndKey (address,key) = match getInteger(address, key) { | |
37 | 37 | case a: Int => | |
38 | 38 | a | |
39 | 39 | case _ => | |
40 | 40 | 0 | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | let WAVELET = 100000000 | |
45 | 45 | ||
46 | 46 | let PAULI = 1000000 | |
47 | + | ||
48 | + | let PRICELET = 1000000 | |
47 | 49 | ||
48 | 50 | let MINORDERTOTAL = (10 * WAVELET) | |
49 | 51 | ||
50 | 52 | let MAXROI = 95 | |
51 | 53 | ||
52 | 54 | let CANCELED = "canceled" | |
53 | 55 | ||
54 | 56 | let NEW = "new" | |
55 | 57 | ||
56 | 58 | let FILLED = "filled" | |
57 | 59 | ||
58 | 60 | let NeutrinoContractKey = "neutrino_contract" | |
59 | 61 | ||
60 | 62 | let PriceKey = "price" | |
61 | 63 | ||
62 | 64 | let BondAssetIdKey = "bond_asset_id" | |
63 | 65 | ||
64 | 66 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
65 | 67 | ||
66 | 68 | let ControlContractKey = "control_contract" | |
67 | 69 | ||
68 | 70 | let BalanceLockedkKey = "balance_lock_" | |
69 | 71 | ||
70 | 72 | let WavesLockedBalanceKey = (BalanceLockedkKey + "waves") | |
71 | 73 | ||
72 | 74 | let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino") | |
73 | 75 | ||
74 | 76 | let LiquidationContractKey = "liquidation_contract" | |
75 | 77 | ||
76 | 78 | let FirstOrderKey = "order_first" | |
77 | 79 | ||
78 | 80 | func getRoiByOrderIdKey (orderId) = ("debug_order_roi_" + orderId) | |
79 | 81 | ||
80 | 82 | ||
81 | 83 | func getOrderPriceKey (orderId) = ("order_price_" + orderId) | |
82 | 84 | ||
83 | 85 | ||
84 | 86 | func getOrderTotalKey (orderId) = ("order_total_" + orderId) | |
85 | 87 | ||
86 | 88 | ||
87 | 89 | func getOrderOwnerKey (orderId) = ("order_owner_" + orderId) | |
88 | 90 | ||
89 | 91 | ||
90 | 92 | func getOrderHeightKey (orderId) = ("order_height_" + orderId) | |
91 | 93 | ||
92 | 94 | ||
93 | 95 | func getOrderStatusKey (orderId) = ("order_status_" + orderId) | |
94 | 96 | ||
95 | 97 | ||
96 | 98 | func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId) | |
97 | 99 | ||
98 | 100 | ||
99 | 101 | func getPrevOrderKey (orderId) = ("order_prev_" + orderId) | |
100 | 102 | ||
101 | 103 | ||
102 | 104 | func getNextOrderKey (orderId) = ("order_next_" + orderId) | |
103 | 105 | ||
104 | 106 | ||
105 | - | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, | |
107 | + | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI) | |
106 | 108 | ||
107 | 109 | ||
108 | - | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, | |
110 | + | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET) | |
109 | 111 | ||
110 | 112 | ||
111 | 113 | func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price) | |
112 | 114 | ||
113 | 115 | ||
114 | 116 | func convertBondToWaves (amount,price) = convertNeutrinoToWaves(amount, price) | |
115 | 117 | ||
116 | 118 | ||
117 | 119 | let neutrinoContract = Address(base58'3MxUeE9rS9G3ap3kSrw67vkjYyTL3QLJnk3') | |
118 | 120 | ||
119 | 121 | let controlContract = Address(base58'3MzosTW6DBBjpRwTZUWFhZo6UFW1yrmfdtB') | |
120 | 122 | ||
121 | 123 | let liquidationContract = Address(base58'3N1SXpSHeCeqSewbXS79otbnmP89uKUkWyf') | |
122 | 124 | ||
123 | 125 | let neutrinoAssetId = base58'EHLhLVDUufqQytiAjBHzPhsPZgqsX6XfSCrVdxYeC4QN' | |
124 | 126 | ||
125 | 127 | let bondAssetId = base58'91QmVf3hZQJeUX11nurBX76Quf94kQgVMDesqALsjQFN' | |
126 | 128 | ||
127 | 129 | let isBlocked = getBoolByAddressAndKey(controlContract, "is_blocked") | |
128 | 130 | ||
129 | 131 | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
130 | 132 | ||
131 | 133 | let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey) | |
132 | 134 | ||
133 | 135 | let reserve = (wavesBalance(neutrinoContract) - getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey)) | |
134 | 136 | ||
135 | 137 | let neutrinoSupply = (((neutrinoLockedBalance + extract(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId)) | |
136 | 138 | ||
137 | 139 | let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, currentPrice)) | |
138 | 140 | ||
139 | 141 | let firstOrder = getStringByKey(FirstOrderKey) | |
140 | 142 | ||
141 | 143 | func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id)) | |
142 | 144 | ||
143 | 145 | ||
144 | 146 | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
145 | 147 | ||
146 | 148 | ||
147 | 149 | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
148 | 150 | ||
149 | 151 | ||
150 | 152 | func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id)) | |
151 | 153 | ||
152 | 154 | ||
153 | 155 | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
154 | 156 | ||
155 | 157 | ||
156 | 158 | func getPrevOrder (id) = getStringByKey(getPrevOrderKey(id)) | |
157 | 159 | ||
158 | 160 | ||
159 | 161 | func getNextOrder (id) = getStringByKey(getNextOrderKey(id)) | |
160 | 162 | ||
161 | 163 | ||
162 | 164 | func orderData (orderId,totalWavelets,owner,status,roi,price) = [DataEntry(getOrderPriceKey(orderId), price), DataEntry(getOrderTotalKey(orderId), totalWavelets), DataEntry(getOrderOwnerKey(orderId), owner), DataEntry(getOrderHeightKey(orderId), height), DataEntry(getOrderStatusKey(orderId), status), DataEntry(("debug_order_currentPrice_" + orderId), currentPrice), DataEntry(getRoiByOrderIdKey(orderId), roi)] | |
163 | 165 | ||
164 | 166 | ||
165 | 167 | func internalSellBond (pFirstOrder,pNextOrder,pFilledTotal,pRoi,pPrice,pPaymentWavelets,orderOwnerAddress,instantOrder) = { | |
166 | 168 | let priceWavesByBondCents = fraction((100 + pRoi), currentPrice, 100) | |
167 | 169 | let remainedTotal = (pPaymentWavelets - pFilledTotal) | |
168 | 170 | let fillableOrderAmount = convertWavesToBond(remainedTotal, priceWavesByBondCents) | |
169 | 171 | let totalOrderWaveletesRequired = convertBondToWaves(fillableOrderAmount, priceWavesByBondCents) | |
170 | 172 | let nbTokensSellCondition = (fraction(deficit, 100, neutrinoSupply) >= pRoi) | |
171 | 173 | if (!(nbTokensSellCondition)) | |
172 | 174 | then throw(("innapropriate roi: " + toString(pRoi))) | |
173 | 175 | else if ((totalOrderWaveletesRequired == 0)) | |
174 | 176 | then throw("cannot fill order at the moment") | |
175 | 177 | else { | |
176 | 178 | let changeWavelets = (remainedTotal - totalOrderWaveletesRequired) | |
177 | 179 | let writeSetData = if (instantOrder) | |
178 | 180 | then [DataEntry(getOrderPriceKey(pFirstOrder), pPrice), DataEntry(getOrderTotalKey(pFirstOrder), pPaymentWavelets), DataEntry(getOrderOwnerKey(pFirstOrder), toBase58String(orderOwnerAddress.bytes)), DataEntry(getOrderHeightKey(pFirstOrder), height), DataEntry(getOrderStatusKey(pFirstOrder), FILLED), DataEntry(("debug_order_currentPrice_" + pFirstOrder), currentPrice), DataEntry(getRoiByOrderIdKey(pFirstOrder), pRoi)] | |
179 | 181 | else [DataEntry(getOrderFilledTotalKey(pFirstOrder), (pFilledTotal + totalOrderWaveletesRequired)), DataEntry(getOrderStatusKey(pFirstOrder), FILLED), DataEntry(getOrderTotalKey(pFirstOrder), pPaymentWavelets), DataEntry(getPrevOrderKey(pNextOrder), ""), DataEntry(FirstOrderKey, pNextOrder)] | |
180 | 182 | ScriptResult(WriteSet(writeSetData), TransferSet([ScriptTransfer(orderOwnerAddress, fillableOrderAmount, bondAssetId), ScriptTransfer(neutrinoContract, totalOrderWaveletesRequired, unit), ScriptTransfer(orderOwnerAddress, changeWavelets, unit)])) | |
181 | 183 | } | |
182 | 184 | } | |
183 | 185 | ||
184 | 186 | ||
185 | 187 | func internalAddBuyBondOrder (roi,price,prevOrder,inv,instantOrder) = { | |
186 | 188 | let pmt = extract(inv.payment) | |
187 | 189 | let newOrderId = toBase58String(inv.transactionId) | |
188 | 190 | if (isBlocked) | |
189 | 191 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
190 | 192 | else if ((MINORDERTOTAL > pmt.amount)) | |
191 | 193 | then throw(("min order total equals " + toString(MINORDERTOTAL))) | |
192 | 194 | else if ((roi > MAXROI)) | |
193 | 195 | then throw("max setOrder ROI is 95%") | |
194 | 196 | else if (if ((deficit > 0)) | |
195 | 197 | then (0 > roi) | |
196 | 198 | else false) | |
197 | 199 | then throw("can't place order with negative roi during deficit") | |
198 | 200 | else if ((-(MAXROI) > roi)) | |
199 | 201 | then throw("min setOrder ROI is -95%") | |
200 | 202 | else if ((roi == 0)) | |
201 | 203 | then throw("roi should not be equal to 0") | |
202 | 204 | else if (isDefined(pmt.assetId)) | |
203 | 205 | then throw("can use waves only") | |
204 | 206 | else if ((getOrderOwner(newOrderId) != "")) | |
205 | 207 | then throw("order exists") | |
206 | 208 | else if (if ((prevOrder != "")) | |
207 | 209 | then (getOrderStatus(prevOrder) != NEW) | |
208 | 210 | else false) | |
209 | 211 | then throw("prev order status is not new") | |
210 | 212 | else { | |
211 | 213 | let isNewOrderAtFirstPosition = (prevOrder == "") | |
212 | 214 | let owner = toString(inv.caller) | |
213 | 215 | let nextOrder = if (isNewOrderAtFirstPosition) | |
214 | 216 | then firstOrder | |
215 | 217 | else getNextOrder(prevOrder) | |
216 | 218 | let nextOrderRoi = getNumberByKey(getRoiByOrderIdKey(nextOrder)) | |
217 | 219 | let isNextOrderError = if (if ((nextOrder != "")) | |
218 | 220 | then (roi >= nextOrderRoi) | |
219 | 221 | else false) | |
220 | 222 | then true | |
221 | 223 | else false | |
222 | 224 | let prevOrderRoi = getNumberByKey(getRoiByOrderIdKey(prevOrder)) | |
223 | 225 | let isPrevOrderError = if (if ((prevOrder != "")) | |
224 | 226 | then (prevOrderRoi > roi) | |
225 | 227 | else false) | |
226 | 228 | then true | |
227 | 229 | else false | |
228 | 230 | if (if (isNextOrderError) | |
229 | 231 | then true | |
230 | 232 | else isPrevOrderError) | |
231 | 233 | then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError))) | |
232 | 234 | else if (if (isNewOrderAtFirstPosition) | |
233 | 235 | then instantOrder | |
234 | 236 | else false) | |
235 | 237 | then internalSellBond(newOrderId, nextOrder, 0, roi, price, pmt.amount, inv.caller, true) | |
236 | 238 | else if (instantOrder) | |
237 | 239 | then throw("Instant order couldn't be added into waiting queue") | |
238 | 240 | else WriteSet([DataEntry(getPrevOrderKey(newOrderId), prevOrder), DataEntry(getNextOrderKey(newOrderId), nextOrder), DataEntry(getNextOrderKey(prevOrder), if ((prevOrder == "")) | |
239 | 241 | then "" | |
240 | 242 | else newOrderId), DataEntry(getPrevOrderKey(nextOrder), if ((nextOrder == "")) | |
241 | 243 | then "" | |
242 | 244 | else newOrderId), DataEntry(FirstOrderKey, if (if ((firstOrder == "")) | |
243 | 245 | then true | |
244 | 246 | else (firstOrder == nextOrder)) | |
245 | 247 | then newOrderId | |
246 | 248 | else firstOrder), orderData(newOrderId, pmt.amount, owner, NEW, roi, price)]) | |
247 | 249 | } | |
248 | 250 | } | |
249 | 251 | ||
250 | 252 | ||
251 | 253 | @Callable(i) | |
252 | 254 | func instantBuyNsbtOrFail (roi) = { | |
253 | 255 | let pmt = extract(i.payment) | |
254 | 256 | let priceWavesByBondCents = fraction((100 + roi), currentPrice, 100) | |
255 | - | let price = (( | |
257 | + | let price = ((PRICELET * PRICELET) / priceWavesByBondCents) | |
256 | 258 | internalAddBuyBondOrder(roi, price, "", i, true) | |
257 | 259 | } | |
258 | 260 | ||
259 | 261 | ||
260 | 262 | ||
261 | 263 | @Callable(i) | |
262 | 264 | func addBuyBondOrder (price,prevOrder) = { | |
263 | 265 | let pmt = extract(i.payment) | |
264 | - | let priceWavesByBondCents = fraction( | |
266 | + | let priceWavesByBondCents = fraction(PRICELET, PRICELET, price) | |
265 | 267 | let roi = fraction((priceWavesByBondCents - currentPrice), 100, currentPrice) | |
266 | 268 | if ((0 >= price)) | |
267 | 269 | then throw("price less zero") | |
268 | 270 | else internalAddBuyBondOrder(roi, price, prevOrder, i, false) | |
269 | 271 | } | |
270 | 272 | ||
271 | 273 | ||
272 | 274 | ||
273 | 275 | @Callable(i) | |
274 | 276 | func cancelOrder (orderId) = { | |
275 | 277 | let owner = getOrderOwner(orderId) | |
276 | 278 | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
277 | 279 | let caller = toString(i.caller) | |
278 | 280 | let nextOrder = getNextOrder(orderId) | |
279 | 281 | let prevOrder = getPrevOrder(orderId) | |
280 | 282 | if (isBlocked) | |
281 | 283 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
282 | 284 | else if ((owner != caller)) | |
283 | 285 | then throw("permission denied") | |
284 | 286 | else if ((getOrderStatus(orderId) != NEW)) | |
285 | 287 | then throw("invalid order status") | |
286 | 288 | else ScriptResult(WriteSet([DataEntry(FirstOrderKey, if ((firstOrder == orderId)) | |
287 | 289 | then nextOrder | |
288 | 290 | else firstOrder), DataEntry(getNextOrderKey(prevOrder), nextOrder), DataEntry(getPrevOrderKey(nextOrder), prevOrder), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
289 | 291 | } | |
290 | 292 | ||
291 | 293 | ||
292 | 294 | ||
293 | 295 | @Callable(i) | |
294 | 296 | func sellBond () = if (isBlocked) | |
295 | 297 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
296 | 298 | else if ((firstOrder == "")) | |
297 | 299 | then throw("empty orderbook") | |
298 | 300 | else { | |
299 | 301 | let nextOrder = getNextOrder(firstOrder) | |
300 | 302 | let filledTotal = getOrderFilledTotal(firstOrder) | |
301 | 303 | let orderPrice = getOrderPrice(firstOrder) | |
302 | 304 | let roi = getNumberByKey(getRoiByOrderIdKey(firstOrder)) | |
303 | 305 | let paymentWavelets = getOrderTotal(firstOrder) | |
304 | 306 | let orderOwnerAddress = Address(fromBase58String(getOrderOwner(firstOrder))) | |
305 | 307 | internalSellBond(firstOrder, nextOrder, filledTotal, roi, orderPrice, paymentWavelets, orderOwnerAddress, false) | |
306 | 308 | } | |
307 | 309 | ||
308 | 310 | ||
309 | 311 | ||
310 | 312 | @Callable(i) | |
311 | 313 | func updateReservesAndNeutrinoSupply () = { | |
312 | 314 | func getNumberByKeyInternal (key) = match getInteger(this, key) { | |
313 | 315 | case a: Int => | |
314 | 316 | a | |
315 | 317 | case _ => | |
316 | 318 | 0 | |
317 | 319 | } | |
318 | 320 | ||
319 | 321 | let idx = getNumberByKeyInternal("updateReservesAndNeutrinoSupplyIdx") | |
320 | 322 | let newIdx = (idx + 1) | |
321 | 323 | WriteSet([DataEntry("updateReservesAndNeutrinoSupplyIdx", newIdx), DataEntry("reserve", reserve), DataEntry("neutrinoSupply", neutrinoSupply), DataEntry("deficit", deficit)]) | |
322 | 324 | } | |
323 | 325 | ||
324 | 326 | ||
325 | 327 | @Verifier(tx) | |
326 | 328 | func verify () = { | |
327 | 329 | let pubKeyAdminsList = ["D96T5UoL7E2FERaEwov9Frx8XFVPNGqZ4TyDiWvn1urJ", "Fk2zgbrRA8KytTVMVy6Df5i4tTEsKaqg6ybh6x6Hehjj", "37f1yE54FyMKwEkg413peq5Gbze9sBavASVeTYbQLTvJ", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
328 | 330 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
329 | 331 | then 1 | |
330 | 332 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
331 | 333 | then 1 | |
332 | 334 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
333 | 335 | then 1 | |
334 | 336 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
335 | 337 | then 2 | |
336 | 338 | else 0)) | |
337 | 339 | (count >= 3) | |
338 | 340 | } | |
339 | 341 |
github/deemru/w8io/026f985 49.89 ms ◑