tx · 2UDw7KpHif9q93RB2CAmmJdT4Qpig1YwPsAeEPU5fayx 3N4Pj4MutKVgrmcuX7jgyVGWoBhDyKYFZBj: -0.01400000 Waves 2019.09.30 23:33 [699676] smart account 3N4Pj4MutKVgrmcuX7jgyVGWoBhDyKYFZBj > SELF 0.00000000 Waves
{ "type": 13, "id": "2UDw7KpHif9q93RB2CAmmJdT4Qpig1YwPsAeEPU5fayx", "fee": 1400000, "feeAssetId": null, "timestamp": 1569875665491, "version": 1, "sender": "3N4Pj4MutKVgrmcuX7jgyVGWoBhDyKYFZBj", "senderPublicKey": "7YuxEiQSearE3DvFS84DXzV5gad9qxsq4bTy633SAYBj", "proofs": [ "2JfN3oy4xBFJKsibEubyzenQH7sTvb7U6gKxgsoDg1h6WTfEZGzA8rXgYX2twDBjGpzvPQnViEeQKFKchyP7Z7A4" ], "script": "base64:AAIDAAAAAAAAAAAAAABsAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAADGdldEJvb2xCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGwAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAHQm9vbGVhbgQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQcBAAAAGGdldE51bWJlckJ5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRj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EAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAxPcmRlcmJvb2tLZXkJAQAAAAlkcm9wT3JkZXIAAAABBQAAAAdvcmRlcklkCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAWZ2V0T3JkZXJGaWxsZWRUb3RhbEtleQAAAAEFAAAAB29yZGVySWQJAABkAAAAAgUAAAALZmlsbGVkVG90YWwFAAAADm5ld0ZpbGxlZFRvdGFsCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAARZ2V0T3JkZXJTdGF0dXNLZXkAAAABBQAAAAdvcmRlcklkBQAAAAZzdGF0dXMFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEFAAAACm9yZGVyT3duZXIJAQAAABVjb252ZXJ0Qm9uZFRvTmV1dHJpbm8AAAABBQAAAA5uZXdGaWxsZWRUb3RhbAUAAAAPbmV1dHJpbm9Bc3NldElkBQAAAANuaWwAAAAA9cv1SQ==", "chainId": 84, "height": 699676, "spentComplexity": 0 } View: original | compacted Prev: GhxM5bqNkiUffHBX63xbHQXXAQFCQpovePhYsSusiS24 Next: Az8K416kiGhbimmShQENYaigC6GPtxwomu8wAisvqvyw Diff:
Old | New | Differences | |
---|---|---|---|
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | + | func getNumberByAddressAndKey (address,key) = match getInteger(addressFromStringValue(address), key) { | |
29 | + | case a: Int => | |
30 | + | a | |
31 | + | case _ => | |
32 | + | 0 | |
33 | + | } | |
34 | + | ||
35 | + | ||
28 | 36 | let LISTSPLITSYMBOL = "_" | |
29 | 37 | ||
30 | 38 | let LISTDATASYMBOL = "+" | |
42 | 50 | let BondAssetIdKey = "bond_asset_id" | |
43 | 51 | ||
44 | 52 | let AuctionContractKey = "auction_contract" | |
53 | + | ||
54 | + | let RPDContractKey = "rpd_contract" | |
45 | 55 | ||
46 | 56 | let BalanceLockIntervalKey = "balance_lock_interval" | |
47 | 57 | ||
72 | 82 | let OrderFilledTotalKey = "order_filled_total_" | |
73 | 83 | ||
74 | 84 | let OrderStatusKey = "order_status_" | |
85 | + | ||
86 | + | let RPDCountKey = "rpd_count" | |
87 | + | ||
88 | + | let RPDProfitKey = "rpd_profit" | |
89 | + | ||
90 | + | let NeutrinoRPDBalanceKey = "neutrino_rpd" | |
75 | 91 | ||
76 | 92 | let IsBlockedKey = "is_blocked" | |
77 | 93 | ||
111 | 127 | ||
112 | 128 | ||
113 | 129 | func getOracleProvidePriceKey (owner) = (OracleProvidePriceKey + owner) | |
130 | + | ||
131 | + | ||
132 | + | func getNeutrinoRPDSnapshotBalanceKey (count) = ((NeutrinoRPDBalanceKey + "_") + toString(count)) | |
133 | + | ||
134 | + | ||
135 | + | func getRPDProfitKey (count) = ((RPDProfitKey + "_") + toString(count)) | |
114 | 136 | ||
115 | 137 | ||
116 | 138 | func getNeutrinoBalanceKey (owner) = (NeutrinoBalanceKey + owner) | |
168 | 190 | ||
169 | 191 | let percentPriceOffset = getNumberByKey(PriceOffsetKey) | |
170 | 192 | ||
193 | + | let rpdCount = getNumberByKey(RPDCountKey) | |
194 | + | ||
171 | 195 | let voteInterval = getNumberByKey(VoteIntervalKey) | |
172 | 196 | ||
173 | 197 | let blockExpireVote = getNumberByKey(BlockExpireVoteKey) | |
181 | 205 | let neutrinoAssetId = fromBase58String(getStringByKey(NeutrinoAssetIdKey)) | |
182 | 206 | ||
183 | 207 | let auctionContract = getStringByKey(AuctionContractKey) | |
208 | + | ||
209 | + | let rpdContract = getStringByKey(RPDContractKey) | |
184 | 210 | ||
185 | 211 | let reserve = wavesBalance(this) | |
186 | 212 | ||
211 | 237 | let adminTwo = getStringByKey(getAdminKey(1)) | |
212 | 238 | ||
213 | 239 | let adminThree = getStringByKey(getAdminKey(2)) | |
240 | + | ||
241 | + | let neutrinoRPDBalance = getNumberByAddressAndKey(rpdContract, NeutrinoRPDBalanceKey) | |
214 | 242 | ||
215 | 243 | func getAdminVoteInt (owner) = if (getBoolByKey(getAdminVoteKey(owner))) | |
216 | 244 | then 1 | |
247 | 275 | ||
248 | 276 | ||
249 | 277 | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
278 | + | ||
279 | + | ||
280 | + | func getRPDProfit (count) = getNumberByKey(getRPDProfitKey(count)) | |
250 | 281 | ||
251 | 282 | ||
252 | 283 | func getOrderElementById (id) = (id + LISTSPLITSYMBOL) | |
405 | 436 | else if (isBlocked) | |
406 | 437 | then throw("contract is blocked") | |
407 | 438 | else { | |
408 | - | let account = toBase58String(i.caller.bytes) | |
409 | 439 | let amount = convertWavesToNeutrino(pmt.amount) | |
410 | - | | |
440 | + | TransferSet([ScriptTransfer(i.caller, amount, neutrinoAssetId)]) | |
411 | 441 | } | |
412 | 442 | } | |
413 | 443 | ||
486 | 516 | then throw("contract is blocked") | |
487 | 517 | else if ((0 >= surplus)) | |
488 | 518 | then throw("surplus is less than zero") | |
489 | - | else { | |
490 | - | let amount = (orderTotal - filledTotal) | |
491 | - | let surplusBond = convertNeutrinoToBond(surplus) | |
492 | - | let status = if ((surplusBond >= amount)) | |
493 | - | then FILLED | |
494 | - | else NEW | |
495 | - | let newFilledTotal = if ((surplusBond >= amount)) | |
496 | - | then orderTotal | |
497 | - | else surplusBond | |
498 | - | ScriptResult(WriteSet([DataEntry(OrderbookKey, dropOrder(orderId)), DataEntry(getOrderFilledTotalKey(orderId), (filledTotal + newFilledTotal)), DataEntry(getOrderStatusKey(orderId), status)]), TransferSet([ScriptTransfer(addressFromStringValue(orderOwner), convertBondToNeutrino(newFilledTotal), neutrinoAssetId)])) | |
499 | - | } | |
519 | + | else if ((orderOwner == "")) | |
520 | + | then { | |
521 | + | let newRpdCount = (rpdCount + 1) | |
522 | + | ScriptResult(WriteSet([DataEntry(RPDCountKey, newRpdCount), DataEntry(getRPDProfitKey(rpdCount), surplus), DataEntry(getNeutrinoRPDSnapshotBalanceKey(rpdCount), neutrinoRPDBalance)]), TransferSet([ScriptTransfer(addressFromStringValue(rpdContract), surplus, neutrinoAssetId)])) | |
523 | + | } | |
524 | + | else { | |
525 | + | let amount = (orderTotal - filledTotal) | |
526 | + | let surplusBond = convertNeutrinoToBond(surplus) | |
527 | + | let status = if ((surplusBond >= amount)) | |
528 | + | then FILLED | |
529 | + | else NEW | |
530 | + | let newFilledTotal = if ((surplusBond >= amount)) | |
531 | + | then orderTotal | |
532 | + | else surplusBond | |
533 | + | ScriptResult(WriteSet([DataEntry(OrderbookKey, dropOrder(orderId)), DataEntry(getOrderFilledTotalKey(orderId), (filledTotal + newFilledTotal)), DataEntry(getOrderStatusKey(orderId), status)]), TransferSet([ScriptTransfer(addressFromStringValue(orderOwner), convertBondToNeutrino(newFilledTotal), neutrinoAssetId)])) | |
534 | + | } | |
500 | 535 | } | |
501 | 536 | ||
502 | 537 |
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 getBoolByKey (key) = match getBoolean(this, key) { | |
21 | 21 | case a: Boolean => | |
22 | 22 | a | |
23 | 23 | case _ => | |
24 | 24 | false | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | + | func getNumberByAddressAndKey (address,key) = match getInteger(addressFromStringValue(address), key) { | |
29 | + | case a: Int => | |
30 | + | a | |
31 | + | case _ => | |
32 | + | 0 | |
33 | + | } | |
34 | + | ||
35 | + | ||
28 | 36 | let LISTSPLITSYMBOL = "_" | |
29 | 37 | ||
30 | 38 | let LISTDATASYMBOL = "+" | |
31 | 39 | ||
32 | 40 | let WAVELET = 100000000 | |
33 | 41 | ||
34 | 42 | let CANCELED = "canceled" | |
35 | 43 | ||
36 | 44 | let NEW = "new" | |
37 | 45 | ||
38 | 46 | let FILLED = "filled" | |
39 | 47 | ||
40 | 48 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
41 | 49 | ||
42 | 50 | let BondAssetIdKey = "bond_asset_id" | |
43 | 51 | ||
44 | 52 | let AuctionContractKey = "auction_contract" | |
53 | + | ||
54 | + | let RPDContractKey = "rpd_contract" | |
45 | 55 | ||
46 | 56 | let BalanceLockIntervalKey = "balance_lock_interval" | |
47 | 57 | ||
48 | 58 | let VoteIntervalKey = "vote_interval" | |
49 | 59 | ||
50 | 60 | let MinSwapAmountKey = "min_swap_amount" | |
51 | 61 | ||
52 | 62 | let PriceOffsetKey = "price_offset" | |
53 | 63 | ||
54 | 64 | let ProvidingIntervalKey = "providing_interval" | |
55 | 65 | ||
56 | 66 | let PriceKey = "price" | |
57 | 67 | ||
58 | 68 | let NeutrinoBalanceKey = "neutrino_" | |
59 | 69 | ||
60 | 70 | let WavesBalanceKey = "waves_" | |
61 | 71 | ||
62 | 72 | let BalanceUnlockBlockKey = "balance_block_" | |
63 | 73 | ||
64 | 74 | let OrderbookKey = "orderbook" | |
65 | 75 | ||
66 | 76 | let OrderTotalKey = "order_total_" | |
67 | 77 | ||
68 | 78 | let OrderOwnerKey = "order_owner_" | |
69 | 79 | ||
70 | 80 | let OrderHeightKey = "order_height_" | |
71 | 81 | ||
72 | 82 | let OrderFilledTotalKey = "order_filled_total_" | |
73 | 83 | ||
74 | 84 | let OrderStatusKey = "order_status_" | |
85 | + | ||
86 | + | let RPDCountKey = "rpd_count" | |
87 | + | ||
88 | + | let RPDProfitKey = "rpd_profit" | |
89 | + | ||
90 | + | let NeutrinoRPDBalanceKey = "neutrino_rpd" | |
75 | 91 | ||
76 | 92 | let IsBlockedKey = "is_blocked" | |
77 | 93 | ||
78 | 94 | let BlackSwarmPriceKey = "black_swarm_price" | |
79 | 95 | ||
80 | 96 | let AdminVoteKey = "admin_vote_" | |
81 | 97 | ||
82 | 98 | let AdminVotePriceKey = "admin_vote_price_" | |
83 | 99 | ||
84 | 100 | let BlockExpireVoteKey = "vote_expire_block" | |
85 | 101 | ||
86 | 102 | let AdminKey = "admin_" | |
87 | 103 | ||
88 | 104 | let IsPricePendingKey = "is_pending_price" | |
89 | 105 | ||
90 | 106 | let OracleKey = "oracle_" | |
91 | 107 | ||
92 | 108 | let OracleIsProvideKey = "oracle_is_provide_" | |
93 | 109 | ||
94 | 110 | let OracleProvidePriceKey = "oracle_price_provide_" | |
95 | 111 | ||
96 | 112 | let BlockExpireProvidingKey = "providing_expire_block" | |
97 | 113 | ||
98 | 114 | func getAdminKey (count) = (AdminKey + toString(count)) | |
99 | 115 | ||
100 | 116 | ||
101 | 117 | func getAdminVoteKey (owner) = (AdminVoteKey + owner) | |
102 | 118 | ||
103 | 119 | ||
104 | 120 | func getAdminVotePriceKey (owner) = (AdminVotePriceKey + owner) | |
105 | 121 | ||
106 | 122 | ||
107 | 123 | func getOracleKey (count) = (OracleKey + toString(count)) | |
108 | 124 | ||
109 | 125 | ||
110 | 126 | func getOracleIsProvideKey (owner) = (OracleIsProvideKey + owner) | |
111 | 127 | ||
112 | 128 | ||
113 | 129 | func getOracleProvidePriceKey (owner) = (OracleProvidePriceKey + owner) | |
130 | + | ||
131 | + | ||
132 | + | func getNeutrinoRPDSnapshotBalanceKey (count) = ((NeutrinoRPDBalanceKey + "_") + toString(count)) | |
133 | + | ||
134 | + | ||
135 | + | func getRPDProfitKey (count) = ((RPDProfitKey + "_") + toString(count)) | |
114 | 136 | ||
115 | 137 | ||
116 | 138 | func getNeutrinoBalanceKey (owner) = (NeutrinoBalanceKey + owner) | |
117 | 139 | ||
118 | 140 | ||
119 | 141 | func getWavesBalanceKey (owner) = (WavesBalanceKey + owner) | |
120 | 142 | ||
121 | 143 | ||
122 | 144 | func getBalanceUnlockBlockKey (owner) = (BalanceUnlockBlockKey + owner) | |
123 | 145 | ||
124 | 146 | ||
125 | 147 | func getBlackSwarmPriceKey (block) = ((BlackSwarmPriceKey + "_") + toString(block)) | |
126 | 148 | ||
127 | 149 | ||
128 | 150 | func getPriceHistoryKey (block) = ((PriceKey + "_") + toString(block)) | |
129 | 151 | ||
130 | 152 | ||
131 | 153 | func getOrderTotalKey (orderId) = (OrderTotalKey + orderId) | |
132 | 154 | ||
133 | 155 | ||
134 | 156 | func getOrderOwnerKey (orderId) = (OrderOwnerKey + orderId) | |
135 | 157 | ||
136 | 158 | ||
137 | 159 | func getOrderHeightKey (orderId) = (OrderHeightKey + orderId) | |
138 | 160 | ||
139 | 161 | ||
140 | 162 | func getOrderStatusKey (orderId) = (OrderStatusKey + orderId) | |
141 | 163 | ||
142 | 164 | ||
143 | 165 | func getOrderFilledTotalKey (orderId) = (OrderFilledTotalKey + orderId) | |
144 | 166 | ||
145 | 167 | ||
146 | 168 | let price = getNumberByKey(PriceKey) | |
147 | 169 | ||
148 | 170 | func convertNeutrinoToWaves (amount) = ((amount * 100) / price) | |
149 | 171 | ||
150 | 172 | ||
151 | 173 | func convertWavesToNeutrino (amount) = ((amount * price) / 100) | |
152 | 174 | ||
153 | 175 | ||
154 | 176 | func convertNeutrinoToBond (amount) = (amount / WAVELET) | |
155 | 177 | ||
156 | 178 | ||
157 | 179 | func convertBondToNeutrino (amount) = (amount * WAVELET) | |
158 | 180 | ||
159 | 181 | ||
160 | 182 | func convertWavesToBond (amount) = convertNeutrinoToBond(convertWavesToNeutrino(amount)) | |
161 | 183 | ||
162 | 184 | ||
163 | 185 | let providingInterval = getNumberByKey(ProvidingIntervalKey) | |
164 | 186 | ||
165 | 187 | let blockExpireProviding = getNumberByKey(BlockExpireProvidingKey) | |
166 | 188 | ||
167 | 189 | let isPricePending = getBoolByKey(IsPricePendingKey) | |
168 | 190 | ||
169 | 191 | let percentPriceOffset = getNumberByKey(PriceOffsetKey) | |
170 | 192 | ||
193 | + | let rpdCount = getNumberByKey(RPDCountKey) | |
194 | + | ||
171 | 195 | let voteInterval = getNumberByKey(VoteIntervalKey) | |
172 | 196 | ||
173 | 197 | let blockExpireVote = getNumberByKey(BlockExpireVoteKey) | |
174 | 198 | ||
175 | 199 | let balanceLockInterval = getNumberByKey(BalanceLockIntervalKey) | |
176 | 200 | ||
177 | 201 | let isBlocked = getBoolByKey(IsBlockedKey) | |
178 | 202 | ||
179 | 203 | let minSwapAmount = getNumberByKey(MinSwapAmountKey) | |
180 | 204 | ||
181 | 205 | let neutrinoAssetId = fromBase58String(getStringByKey(NeutrinoAssetIdKey)) | |
182 | 206 | ||
183 | 207 | let auctionContract = getStringByKey(AuctionContractKey) | |
208 | + | ||
209 | + | let rpdContract = getStringByKey(RPDContractKey) | |
184 | 210 | ||
185 | 211 | let reserve = wavesBalance(this) | |
186 | 212 | ||
187 | 213 | let orderbook = getStringByKey(OrderbookKey) | |
188 | 214 | ||
189 | 215 | let bondAssetId = fromBase58String(getStringByKey(BondAssetIdKey)) | |
190 | 216 | ||
191 | 217 | let bondSupply = { | |
192 | 218 | let info = extract(assetInfo(bondAssetId)) | |
193 | 219 | (info.quantity - assetBalance(this, bondAssetId)) | |
194 | 220 | } | |
195 | 221 | ||
196 | 222 | let neutrinoSupply = { | |
197 | 223 | let info = extract(assetInfo(neutrinoAssetId)) | |
198 | 224 | (info.quantity - assetBalance(this, neutrinoAssetId)) | |
199 | 225 | } | |
200 | 226 | ||
201 | 227 | let surplus = (convertWavesToNeutrino(reserve) - neutrinoSupply) | |
202 | 228 | ||
203 | 229 | let oracleOne = getStringByKey(getOracleKey(0)) | |
204 | 230 | ||
205 | 231 | let oracleTwo = getStringByKey(getOracleKey(1)) | |
206 | 232 | ||
207 | 233 | let oracleThree = getStringByKey(getOracleKey(2)) | |
208 | 234 | ||
209 | 235 | let adminOne = getStringByKey(getAdminKey(0)) | |
210 | 236 | ||
211 | 237 | let adminTwo = getStringByKey(getAdminKey(1)) | |
212 | 238 | ||
213 | 239 | let adminThree = getStringByKey(getAdminKey(2)) | |
240 | + | ||
241 | + | let neutrinoRPDBalance = getNumberByAddressAndKey(rpdContract, NeutrinoRPDBalanceKey) | |
214 | 242 | ||
215 | 243 | func getAdminVoteInt (owner) = if (getBoolByKey(getAdminVoteKey(owner))) | |
216 | 244 | then 1 | |
217 | 245 | else 0 | |
218 | 246 | ||
219 | 247 | ||
220 | 248 | func getAdminVotePrice (owner) = getNumberByKey(getAdminVotePriceKey(owner)) | |
221 | 249 | ||
222 | 250 | ||
223 | 251 | func isOracleProvide (owner) = getBoolByKey(getOracleIsProvideKey(owner)) | |
224 | 252 | ||
225 | 253 | ||
226 | 254 | func isOracleProvideInt (owner) = if (isOracleProvide(owner)) | |
227 | 255 | then 1 | |
228 | 256 | else 0 | |
229 | 257 | ||
230 | 258 | ||
231 | 259 | func getOracleProvidePrice (owner) = getNumberByKey(getOracleProvidePriceKey(owner)) | |
232 | 260 | ||
233 | 261 | ||
234 | 262 | func getWavesBalance (owner) = getNumberByKey(getWavesBalanceKey(owner)) | |
235 | 263 | ||
236 | 264 | ||
237 | 265 | func getNeutrinoBalance (owner) = getNumberByKey(getNeutrinoBalanceKey(owner)) | |
238 | 266 | ||
239 | 267 | ||
240 | 268 | func getUnlockBalanceBlock (owner) = getNumberByKey(getBalanceUnlockBlockKey(owner)) | |
241 | 269 | ||
242 | 270 | ||
243 | 271 | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
244 | 272 | ||
245 | 273 | ||
246 | 274 | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
247 | 275 | ||
248 | 276 | ||
249 | 277 | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
278 | + | ||
279 | + | ||
280 | + | func getRPDProfit (count) = getNumberByKey(getRPDProfitKey(count)) | |
250 | 281 | ||
251 | 282 | ||
252 | 283 | func getOrderElementById (id) = (id + LISTSPLITSYMBOL) | |
253 | 284 | ||
254 | 285 | ||
255 | 286 | func addOrder (orderId) = (orderbook + getOrderElementById(orderId)) | |
256 | 287 | ||
257 | 288 | ||
258 | 289 | func dropOrder (orderId) = { | |
259 | 290 | let parts = split(orderbook, getOrderElementById(orderId)) | |
260 | 291 | (parts[0] + parts[1]) | |
261 | 292 | } | |
262 | 293 | ||
263 | 294 | ||
264 | 295 | @Callable(i) | |
265 | 296 | func setCurrentPrice (newPrice) = { | |
266 | 297 | let account = toString(i.caller) | |
267 | 298 | let priceProvidingCount = (((isOracleProvideInt(oracleOne) + isOracleProvideInt(oracleTwo)) + isOracleProvideInt(oracleThree)) + 1) | |
268 | 299 | if (isBlocked) | |
269 | 300 | then throw("contract is blocked") | |
270 | 301 | else if (if (if ((account != oracleOne)) | |
271 | 302 | then (account != oracleTwo) | |
272 | 303 | else false) | |
273 | 304 | then (account != oracleThree) | |
274 | 305 | else false) | |
275 | 306 | then throw("permission denied") | |
276 | 307 | else if (if ((blockExpireProviding >= height)) | |
277 | 308 | then isOracleProvide(account) | |
278 | 309 | else false) | |
279 | 310 | then throw("price is already provided") | |
280 | 311 | else if (if ((height > blockExpireProviding)) | |
281 | 312 | then isPricePending | |
282 | 313 | else false) | |
283 | 314 | then throw("use finilizeCurrentPrice") | |
284 | 315 | else WriteSet([DataEntry(getOracleProvidePriceKey(account), newPrice), DataEntry(BlockExpireProvidingKey, if ((height > blockExpireProviding)) | |
285 | 316 | then (height + providingInterval) | |
286 | 317 | else blockExpireProviding), DataEntry(getOracleIsProvideKey(oracleOne), if ((height > blockExpireProviding)) | |
287 | 318 | then false | |
288 | 319 | else isOracleProvide(oracleOne)), DataEntry(getOracleIsProvideKey(oracleTwo), if ((height > blockExpireProviding)) | |
289 | 320 | then false | |
290 | 321 | else isOracleProvide(oracleTwo)), DataEntry(getOracleIsProvideKey(oracleThree), if ((height > blockExpireProviding)) | |
291 | 322 | then false | |
292 | 323 | else isOracleProvide(oracleThree)), DataEntry(getOracleIsProvideKey(account), true), DataEntry(IsPricePendingKey, if (if ((blockExpireProviding >= height)) | |
293 | 324 | then (priceProvidingCount >= 2) | |
294 | 325 | else false) | |
295 | 326 | then true | |
296 | 327 | else isPricePending)]) | |
297 | 328 | } | |
298 | 329 | ||
299 | 330 | ||
300 | 331 | ||
301 | 332 | @Callable(i) | |
302 | 333 | func finilizeCurrentPrice () = { | |
303 | 334 | let account = toString(i.caller) | |
304 | 335 | let priceProvidingCount = ((isOracleProvideInt(oracleOne) + isOracleProvideInt(oracleTwo)) + isOracleProvideInt(oracleThree)) | |
305 | 336 | let newPrice = ((((getOracleProvidePrice(oracleOne) * isOracleProvideInt(oracleOne)) + (getOracleProvidePrice(oracleTwo) * isOracleProvideInt(oracleTwo))) + (getOracleProvidePrice(oracleThree) * isOracleProvideInt(oracleThree))) / priceProvidingCount) | |
306 | 337 | if (isBlocked) | |
307 | 338 | then throw("contract is blocked") | |
308 | 339 | else if (if (if ((account != oracleOne)) | |
309 | 340 | then (account != oracleTwo) | |
310 | 341 | else false) | |
311 | 342 | then (account != oracleThree) | |
312 | 343 | else false) | |
313 | 344 | then throw("permission denied") | |
314 | 345 | else if (if (!(isPricePending)) | |
315 | 346 | then true | |
316 | 347 | else (blockExpireProviding >= height)) | |
317 | 348 | then throw("wait for the end of the price providing") | |
318 | 349 | else if ((2 > priceProvidingCount)) | |
319 | 350 | then throw("2/3 oracles need to set a price") | |
320 | 351 | else if (if ((newPrice >= (price + ((price * percentPriceOffset) / 100)))) | |
321 | 352 | then true | |
322 | 353 | else ((price - ((price * percentPriceOffset) / 100)) >= newPrice)) | |
323 | 354 | then WriteSet([DataEntry(IsBlockedKey, true), DataEntry(getBlackSwarmPriceKey(height), newPrice)]) | |
324 | 355 | else WriteSet([DataEntry(PriceKey, newPrice), DataEntry(getPriceHistoryKey(height), newPrice), DataEntry(IsPricePendingKey, false)]) | |
325 | 356 | } | |
326 | 357 | ||
327 | 358 | ||
328 | 359 | ||
329 | 360 | @Callable(i) | |
330 | 361 | func adminUnlock (newPrice) = { | |
331 | 362 | let account = toString(i.caller) | |
332 | 363 | let adminOneVote = if ((account != adminOne)) | |
333 | 364 | then getAdminVoteInt(adminOne) | |
334 | 365 | else 0 | |
335 | 366 | let adminTwoVote = if ((account != adminTwo)) | |
336 | 367 | then getAdminVoteInt(adminTwo) | |
337 | 368 | else 0 | |
338 | 369 | let adminThreeVote = if ((account != adminThree)) | |
339 | 370 | then getAdminVoteInt(adminThree) | |
340 | 371 | else 0 | |
341 | 372 | let adminOnePrice = if (((getAdminVotePrice(adminOne) * adminOneVote) == newPrice)) | |
342 | 373 | then 1 | |
343 | 374 | else 0 | |
344 | 375 | let adminTwoPrice = if (((getAdminVotePrice(adminTwo) * adminTwoVote) == newPrice)) | |
345 | 376 | then 1 | |
346 | 377 | else 0 | |
347 | 378 | let adminThreePrice = if (((getAdminVotePrice(adminThree) * adminThreeVote) == newPrice)) | |
348 | 379 | then 1 | |
349 | 380 | else 0 | |
350 | 381 | if (!(isBlocked)) | |
351 | 382 | then throw("Contract is not blocked") | |
352 | 383 | else if (if (((((adminOnePrice + adminTwoPrice) + adminThreePrice) + 1) >= 2)) | |
353 | 384 | then (blockExpireVote >= height) | |
354 | 385 | else false) | |
355 | 386 | then WriteSet([DataEntry(IsBlockedKey, false), DataEntry(PriceKey, newPrice), DataEntry(getPriceHistoryKey(height), newPrice), DataEntry(getAdminVoteKey(adminOne), false), DataEntry(getAdminVoteKey(adminTwo), false), DataEntry(getAdminVoteKey(adminThree), false), DataEntry(BlockExpireVoteKey, 0), DataEntry(BlockExpireProvidingKey, 0), DataEntry(IsPricePendingKey, false)]) | |
356 | 387 | else WriteSet([DataEntry(getAdminVotePriceKey(account), newPrice), DataEntry(BlockExpireVoteKey, if ((height > blockExpireVote)) | |
357 | 388 | then (height + voteInterval) | |
358 | 389 | else blockExpireVote), DataEntry(getAdminVoteKey(adminOne), if ((height > blockExpireVote)) | |
359 | 390 | then false | |
360 | 391 | else (adminOneVote == 1)), DataEntry(getAdminVoteKey(adminTwo), if ((height > blockExpireVote)) | |
361 | 392 | then false | |
362 | 393 | else (adminTwoVote == 1)), DataEntry(getAdminVoteKey(adminThree), if ((height > blockExpireVote)) | |
363 | 394 | then false | |
364 | 395 | else (adminThreeVote == 1)), DataEntry(getAdminVoteKey(account), true)]) | |
365 | 396 | } | |
366 | 397 | ||
367 | 398 | ||
368 | 399 | ||
369 | 400 | @Callable(i) | |
370 | 401 | func adminLock () = { | |
371 | 402 | let account = toString(i.caller) | |
372 | 403 | let adminOneVote = if ((account != adminOne)) | |
373 | 404 | then getAdminVoteInt(adminOne) | |
374 | 405 | else 1 | |
375 | 406 | let adminTwoVote = if ((account != adminTwo)) | |
376 | 407 | then getAdminVoteInt(adminTwo) | |
377 | 408 | else 1 | |
378 | 409 | let adminThreeVote = if ((account != adminThree)) | |
379 | 410 | then getAdminVoteInt(adminThree) | |
380 | 411 | else 1 | |
381 | 412 | if (isBlocked) | |
382 | 413 | then throw("Contract is blocked") | |
383 | 414 | else if ((((adminOneVote + adminTwoVote) + adminThreeVote) >= 2)) | |
384 | 415 | then WriteSet([DataEntry(IsBlockedKey, true), DataEntry(getAdminVoteKey(adminOne), false), DataEntry(getAdminVoteKey(adminTwo), false), DataEntry(getAdminVoteKey(adminThree), false), DataEntry(BlockExpireVoteKey, 0)]) | |
385 | 416 | else WriteSet([DataEntry(BlockExpireVoteKey, if ((height > blockExpireVote)) | |
386 | 417 | then (height + voteInterval) | |
387 | 418 | else blockExpireVote), DataEntry(getAdminVoteKey(adminOne), if ((height > blockExpireVote)) | |
388 | 419 | then false | |
389 | 420 | else (adminOneVote == 1)), DataEntry(getAdminVoteKey(adminTwo), if ((height > blockExpireVote)) | |
390 | 421 | then false | |
391 | 422 | else (adminTwoVote == 1)), DataEntry(getAdminVoteKey(adminThree), if ((height > blockExpireVote)) | |
392 | 423 | then false | |
393 | 424 | else (adminThreeVote == 1))]) | |
394 | 425 | } | |
395 | 426 | ||
396 | 427 | ||
397 | 428 | ||
398 | 429 | @Callable(i) | |
399 | 430 | func swapWavesToNeutrino () = { | |
400 | 431 | let pmt = extract(i.payment) | |
401 | 432 | if ((minSwapAmount > pmt.amount)) | |
402 | 433 | then throw("amount less min") | |
403 | 434 | else if (isDefined(pmt.assetId)) | |
404 | 435 | then throw("can use waves only") | |
405 | 436 | else if (isBlocked) | |
406 | 437 | then throw("contract is blocked") | |
407 | 438 | else { | |
408 | - | let account = toBase58String(i.caller.bytes) | |
409 | 439 | let amount = convertWavesToNeutrino(pmt.amount) | |
410 | - | | |
440 | + | TransferSet([ScriptTransfer(i.caller, amount, neutrinoAssetId)]) | |
411 | 441 | } | |
412 | 442 | } | |
413 | 443 | ||
414 | 444 | ||
415 | 445 | ||
416 | 446 | @Callable(i) | |
417 | 447 | func swapNeutrinoToWaves () = { | |
418 | 448 | let pmt = extract(i.payment) | |
419 | 449 | if ((minSwapAmount > pmt.amount)) | |
420 | 450 | then throw("amount less min") | |
421 | 451 | else if (isBlocked) | |
422 | 452 | then throw("contract is blocked") | |
423 | 453 | else if ((pmt.assetId != neutrinoAssetId)) | |
424 | 454 | then throw("can use neutrino only") | |
425 | 455 | else { | |
426 | 456 | let account = toBase58String(i.caller.bytes) | |
427 | 457 | let amount = convertNeutrinoToWaves(pmt.amount) | |
428 | 458 | WriteSet([DataEntry(getWavesBalanceKey(account), (getWavesBalance(account) + amount)), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceLockInterval))]) | |
429 | 459 | } | |
430 | 460 | } | |
431 | 461 | ||
432 | 462 | ||
433 | 463 | ||
434 | 464 | @Callable(i) | |
435 | 465 | func withdraw (account) = if ((getUnlockBalanceBlock(account) > height)) | |
436 | 466 | then throw("wait a couple of blocks for withdraw") | |
437 | 467 | else ScriptResult(WriteSet([DataEntry(getWavesBalanceKey(account), 0), DataEntry(getNeutrinoBalanceKey(account), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(account), getNeutrinoBalance(account), neutrinoAssetId), ScriptTransfer(addressFromStringValue(account), getWavesBalance(account), unit)])) | |
438 | 468 | ||
439 | 469 | ||
440 | 470 | ||
441 | 471 | @Callable(i) | |
442 | 472 | func generateBond () = { | |
443 | 473 | let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve)) | |
444 | 474 | let balanceAuction = assetBalance(addressFromStringValue(auctionContract), bondAssetId) | |
445 | 475 | let amount = (convertNeutrinoToBond(deficit) - balanceAuction) | |
446 | 476 | if (isBlocked) | |
447 | 477 | then throw("contract is blocked") | |
448 | 478 | else if ((amount > 0)) | |
449 | 479 | then TransferSet([ScriptTransfer(addressFromStringValue(auctionContract), amount, bondAssetId)]) | |
450 | 480 | else throw("bond were generated or do not need it") | |
451 | 481 | } | |
452 | 482 | ||
453 | 483 | ||
454 | 484 | ||
455 | 485 | @Callable(i) | |
456 | 486 | func setOrder () = { | |
457 | 487 | let pmt = extract(i.payment) | |
458 | 488 | let newOrderId = toBase58String(keccak256(((toBytes(pmt.amount) + i.caller.bytes) + toBytes(height)))) | |
459 | 489 | if ((pmt.assetId != bondAssetId)) | |
460 | 490 | then throw("can use bond only") | |
461 | 491 | else if ((getOrderOwner(newOrderId) != "")) | |
462 | 492 | then throw("order exists") | |
463 | 493 | else WriteSet([DataEntry(OrderbookKey, addOrder(newOrderId)), DataEntry(getOrderTotalKey(newOrderId), pmt.amount), DataEntry(getOrderOwnerKey(newOrderId), toString(i.caller)), DataEntry(getOrderHeightKey(newOrderId), height), DataEntry(getOrderStatusKey(newOrderId), NEW)]) | |
464 | 494 | } | |
465 | 495 | ||
466 | 496 | ||
467 | 497 | ||
468 | 498 | @Callable(i) | |
469 | 499 | func cancelOrder (orderId) = { | |
470 | 500 | let owner = getOrderOwner(orderId) | |
471 | 501 | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
472 | 502 | if ((owner != toString(i.caller))) | |
473 | 503 | then throw("permission denied") | |
474 | 504 | else ScriptResult(WriteSet([DataEntry(OrderbookKey, dropOrder(orderId)), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, bondAssetId)])) | |
475 | 505 | } | |
476 | 506 | ||
477 | 507 | ||
478 | 508 | ||
479 | 509 | @Callable(i) | |
480 | 510 | func executeOrder () = { | |
481 | 511 | let orderId = split(orderbook, LISTSPLITSYMBOL)[0] | |
482 | 512 | let orderTotal = getOrderTotal(orderId) | |
483 | 513 | let orderOwner = getOrderOwner(orderId) | |
484 | 514 | let filledTotal = getOrderFilledTotal(orderId) | |
485 | 515 | if (isBlocked) | |
486 | 516 | then throw("contract is blocked") | |
487 | 517 | else if ((0 >= surplus)) | |
488 | 518 | then throw("surplus is less than zero") | |
489 | - | else { | |
490 | - | let amount = (orderTotal - filledTotal) | |
491 | - | let surplusBond = convertNeutrinoToBond(surplus) | |
492 | - | let status = if ((surplusBond >= amount)) | |
493 | - | then FILLED | |
494 | - | else NEW | |
495 | - | let newFilledTotal = if ((surplusBond >= amount)) | |
496 | - | then orderTotal | |
497 | - | else surplusBond | |
498 | - | ScriptResult(WriteSet([DataEntry(OrderbookKey, dropOrder(orderId)), DataEntry(getOrderFilledTotalKey(orderId), (filledTotal + newFilledTotal)), DataEntry(getOrderStatusKey(orderId), status)]), TransferSet([ScriptTransfer(addressFromStringValue(orderOwner), convertBondToNeutrino(newFilledTotal), neutrinoAssetId)])) | |
499 | - | } | |
519 | + | else if ((orderOwner == "")) | |
520 | + | then { | |
521 | + | let newRpdCount = (rpdCount + 1) | |
522 | + | ScriptResult(WriteSet([DataEntry(RPDCountKey, newRpdCount), DataEntry(getRPDProfitKey(rpdCount), surplus), DataEntry(getNeutrinoRPDSnapshotBalanceKey(rpdCount), neutrinoRPDBalance)]), TransferSet([ScriptTransfer(addressFromStringValue(rpdContract), surplus, neutrinoAssetId)])) | |
523 | + | } | |
524 | + | else { | |
525 | + | let amount = (orderTotal - filledTotal) | |
526 | + | let surplusBond = convertNeutrinoToBond(surplus) | |
527 | + | let status = if ((surplusBond >= amount)) | |
528 | + | then FILLED | |
529 | + | else NEW | |
530 | + | let newFilledTotal = if ((surplusBond >= amount)) | |
531 | + | then orderTotal | |
532 | + | else surplusBond | |
533 | + | ScriptResult(WriteSet([DataEntry(OrderbookKey, dropOrder(orderId)), DataEntry(getOrderFilledTotalKey(orderId), (filledTotal + newFilledTotal)), DataEntry(getOrderStatusKey(orderId), status)]), TransferSet([ScriptTransfer(addressFromStringValue(orderOwner), convertBondToNeutrino(newFilledTotal), neutrinoAssetId)])) | |
534 | + | } | |
500 | 535 | } | |
501 | 536 | ||
502 | 537 |
github/deemru/w8io/169f3d6 172.93 ms ◑