tx · EHA9aiUZuunrmyR7BDmv4kwwLP6TPtsLbu1AFKZsveMN 3Mz5Ya4WEXatCfa2JKqqCe4g3deCrFaBxiL: -0.01400000 Waves 2019.09.24 23:12 [690886] smart account 3Mz5Ya4WEXatCfa2JKqqCe4g3deCrFaBxiL > SELF 0.00000000 Waves
{ "type": 13, "id": "EHA9aiUZuunrmyR7BDmv4kwwLP6TPtsLbu1AFKZsveMN", "fee": 1400000, "feeAssetId": null, "timestamp": 1569355984920, "version": 1, "sender": "3Mz5Ya4WEXatCfa2JKqqCe4g3deCrFaBxiL", "senderPublicKey": "CmDpND6JVW2kuJjY4zyXaTHga2fTuCGbo3G9aySpdybJ", "proofs": [ "3VGVgXu5ivGMC2WzyPUTsPcgCgaDwWmM6o6gGX7xYxUWgkUXxEUsZC5N5rhoVjSzHvYyGsSwPNVgxhdnA3aZZyP9" ], "script": "base64:AAIDAAAAAAAAAAAAAAAzAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAADGdldEJvb2xCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGwAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAHQm9vbGVhbgQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQcBAAAAGGdldE51bWJlckJ5S2V5QW5kQWRkcmVzcwAAAAIAAAAHYWRkcmVzcwAAAANrZXkE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NmZXIAAAADCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEFAAAACm9yZGVyT3duZXIJAQAAABVjb252ZXJ0Qm9uZFRvTmV1dHJpbm8AAAABBQAAAA5uZXdGaWxsZWRUb3RhbAUAAAAPbmV1dHJpbm9Bc3NldElkBQAAAANuaWwAAAAAPsof6g==", "chainId": 84, "height": 690886, "spentComplexity": 0 } View: original | compacted Prev: none Next: 3jn389JsnYPnD7Tyt9tZ1d2DWHX2A9EyS8uZJFJuBNnc Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func getNumberByKey (key) = match getInteger(this, key) { | |
5 | + | case a: Int => | |
6 | + | a | |
7 | + | case _ => | |
8 | + | 0 | |
9 | + | } | |
10 | + | ||
11 | + | ||
12 | + | func getStringByKey (key) = match getString(this, key) { | |
13 | + | case a: String => | |
14 | + | a | |
15 | + | case _ => | |
16 | + | "" | |
17 | + | } | |
18 | + | ||
19 | + | ||
20 | + | func getBoolByKey (key) = match getBoolean(this, key) { | |
21 | + | case a: Boolean => | |
22 | + | a | |
23 | + | case _ => | |
24 | + | false | |
25 | + | } | |
26 | + | ||
27 | + | ||
28 | + | func getNumberByKeyAndAddress (address,key) = match getInteger(addressFromStringValue(address), key) { | |
29 | + | case a: Int => | |
30 | + | a | |
31 | + | case _ => | |
32 | + | 0 | |
33 | + | } | |
34 | + | ||
35 | + | ||
36 | + | func getStringByKeyAndAddress (address,key) = match getString(addressFromStringValue(address), key) { | |
37 | + | case a: String => | |
38 | + | a | |
39 | + | case _ => | |
40 | + | "" | |
41 | + | } | |
42 | + | ||
43 | + | ||
44 | + | func getBoolByKeyAndAddress (address,key) = match getBoolean(addressFromStringValue(address), key) { | |
45 | + | case a: Boolean => | |
46 | + | a | |
47 | + | case _ => | |
48 | + | false | |
49 | + | } | |
50 | + | ||
51 | + | ||
52 | + | let ListSplitSymbol = "_" | |
53 | + | ||
54 | + | let BalanceLockBlock = 0 | |
55 | + | ||
56 | + | let ListDataSplitSymbol = "+" | |
57 | + | ||
58 | + | let Wavelet = 100000000 | |
59 | + | ||
60 | + | let MinimalBondOrder = (10 * Wavelet) | |
61 | + | ||
62 | + | let MinimalSurplus = (10 * Wavelet) | |
63 | + | ||
64 | + | let ApplyBlockTimeout = 10 | |
65 | + | ||
66 | + | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
67 | + | ||
68 | + | let BondAssetIdKey = "bond_asset_id" | |
69 | + | ||
70 | + | let AuctionContractKey = "auction_contract" | |
71 | + | ||
72 | + | let PriceKey = "price" | |
73 | + | ||
74 | + | let NeutrinoBalanceKey = "neutrino_" | |
75 | + | ||
76 | + | let WavesBalanceKey = "waves_" | |
77 | + | ||
78 | + | let BalanceBlockKey = "balance_block_" | |
79 | + | ||
80 | + | let OrderbookKey = "orderbook" | |
81 | + | ||
82 | + | let OrderTotalKey = "order_total_" | |
83 | + | ||
84 | + | let OrderOwnerKey = "order_owner_" | |
85 | + | ||
86 | + | let OrderHeightKey = "order_height_" | |
87 | + | ||
88 | + | let OrderFilledTotalKey = "order_filled_total_" | |
89 | + | ||
90 | + | let OrderStatusKey = "order_status_" | |
91 | + | ||
92 | + | let OracleKey = "oracle" | |
93 | + | ||
94 | + | let neutrinoAssetId = fromBase58String(getStringByKey(NeutrinoAssetIdKey)) | |
95 | + | ||
96 | + | let auctionContract = getStringByKey(AuctionContractKey) | |
97 | + | ||
98 | + | let price = getNumberByKey(PriceKey) | |
99 | + | ||
100 | + | let reserve = wavesBalance(this) | |
101 | + | ||
102 | + | let orderbook = getStringByKey(OrderbookKey) | |
103 | + | ||
104 | + | let bondAssetId = fromBase58String(getStringByKey(BondAssetIdKey)) | |
105 | + | ||
106 | + | let oracle = getStringByKey(OracleKey) | |
107 | + | ||
108 | + | let bondSupply = { | |
109 | + | let info = extract(assetInfo(bondAssetId)) | |
110 | + | (info.quantity - assetBalance(this, bondAssetId)) | |
111 | + | } | |
112 | + | ||
113 | + | let neutrinoSupply = { | |
114 | + | let info = extract(assetInfo(neutrinoAssetId)) | |
115 | + | (info.quantity - assetBalance(this, neutrinoAssetId)) | |
116 | + | } | |
117 | + | ||
118 | + | func getWavesBalance (owner) = getNumberByKey((WavesBalanceKey + owner)) | |
119 | + | ||
120 | + | ||
121 | + | func getNeutrinoBalance (owner) = getNumberByKey((NeutrinoBalanceKey + owner)) | |
122 | + | ||
123 | + | ||
124 | + | func getBalanceBlock (owner) = getNumberByKey((BalanceBlockKey + owner)) | |
125 | + | ||
126 | + | ||
127 | + | func getOrderTotal (id) = getNumberByKey((OrderTotalKey + id)) | |
128 | + | ||
129 | + | ||
130 | + | func getOrderOwner (id) = getStringByKey((OrderOwnerKey + id)) | |
131 | + | ||
132 | + | ||
133 | + | func getOrderFilledTotal (id) = getNumberByKey((OrderFilledTotalKey + id)) | |
134 | + | ||
135 | + | ||
136 | + | func convertNeutrinoToWaves (amount) = ((amount * 100) / price) | |
137 | + | ||
138 | + | ||
139 | + | func convertWavesToNeutrino (amount) = ((amount * price) / 100) | |
140 | + | ||
141 | + | ||
142 | + | func convertNeutrinoToBond (amount) = (amount / Wavelet) | |
143 | + | ||
144 | + | ||
145 | + | func convertBondToNeutrino (amount) = (amount * Wavelet) | |
146 | + | ||
147 | + | ||
148 | + | func convertWavesToBond (amount) = convertNeutrinoToBond(convertWavesToNeutrino(amount)) | |
149 | + | ||
150 | + | ||
151 | + | let surplus = (convertWavesToNeutrino(reserve) - neutrinoSupply) | |
152 | + | ||
153 | + | let CANCELED = "canceled" | |
154 | + | ||
155 | + | let NEW = "new" | |
156 | + | ||
157 | + | let FILLED = "filled" | |
158 | + | ||
159 | + | @Callable(i) | |
160 | + | func setCurrentPrice (price) = { | |
161 | + | let account = toString(i.caller) | |
162 | + | if ((account != oracle)) | |
163 | + | then throw("permission denied") | |
164 | + | else WriteSet([DataEntry(PriceKey, price), DataEntry(((PriceKey + ListSplitSymbol) + toString(height)), price)]) | |
165 | + | } | |
166 | + | ||
167 | + | ||
168 | + | ||
169 | + | @Callable(i) | |
170 | + | func swapWavesToNeutrino () = { | |
171 | + | let pmt = extract(i.payment) | |
172 | + | if (isDefined(pmt.assetId)) | |
173 | + | then throw("can use waves only") | |
174 | + | else { | |
175 | + | let account = toBase58String(i.caller.bytes) | |
176 | + | let amount = convertWavesToNeutrino(pmt.amount) | |
177 | + | WriteSet([DataEntry((NeutrinoBalanceKey + toString(i.caller)), (amount + getNeutrinoBalance(account))), DataEntry((BalanceBlockKey + toString(i.caller)), height)]) | |
178 | + | } | |
179 | + | } | |
180 | + | ||
181 | + | ||
182 | + | ||
183 | + | @Callable(i) | |
184 | + | func swapNeutrinoToWaves () = { | |
185 | + | let pmt = extract(i.payment) | |
186 | + | if ((pmt.assetId != neutrinoAssetId)) | |
187 | + | then throw("can use neutrino only") | |
188 | + | else { | |
189 | + | let account = toBase58String(i.caller.bytes) | |
190 | + | let amount = convertNeutrinoToWaves(pmt.amount) | |
191 | + | WriteSet([DataEntry((WavesBalanceKey + toString(i.caller)), (amount + getWavesBalance(account))), DataEntry((BalanceBlockKey + toString(i.caller)), height)]) | |
192 | + | } | |
193 | + | } | |
194 | + | ||
195 | + | ||
196 | + | ||
197 | + | @Callable(i) | |
198 | + | func withdraw (account) = if (((getBalanceBlock(account) + BalanceLockBlock) >= height)) | |
199 | + | then throw("wait a couple of blocks for withdraw") | |
200 | + | else ScriptResult(WriteSet([DataEntry((WavesBalanceKey + account), 0), DataEntry((NeutrinoBalanceKey + account), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(account), getNeutrinoBalance(account), neutrinoAssetId), ScriptTransfer(addressFromStringValue(account), getWavesBalance(account), unit)])) | |
201 | + | ||
202 | + | ||
203 | + | ||
204 | + | @Callable(i) | |
205 | + | func generateBond () = { | |
206 | + | let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve)) | |
207 | + | let balanceAuction = assetBalance(addressFromStringValue(auctionContract), bondAssetId) | |
208 | + | let amount = (convertNeutrinoToBond(deficit) - balanceAuction) | |
209 | + | if ((amount > 0)) | |
210 | + | then TransferSet([ScriptTransfer(addressFromStringValue(auctionContract), amount, bondAssetId)]) | |
211 | + | else throw("bond were generated or do not need it") | |
212 | + | } | |
213 | + | ||
214 | + | ||
215 | + | ||
216 | + | @Callable(i) | |
217 | + | func setOrder () = { | |
218 | + | let pmt = extract(i.payment) | |
219 | + | let newOrderId = toBase58String(keccak256(((toBytes(pmt.amount) + i.caller.bytes) + toBytes(height)))) | |
220 | + | if ((pmt.assetId != bondAssetId)) | |
221 | + | then throw("can use bond only") | |
222 | + | else if ((getOrderOwner(newOrderId) != "")) | |
223 | + | then throw("order exists") | |
224 | + | else WriteSet([DataEntry(OrderbookKey, ((orderbook + newOrderId) + ListSplitSymbol)), DataEntry((OrderTotalKey + newOrderId), pmt.amount), DataEntry((OrderOwnerKey + newOrderId), toString(i.caller)), DataEntry((OrderHeightKey + newOrderId), height), DataEntry((OrderStatusKey + newOrderId), NEW)]) | |
225 | + | } | |
226 | + | ||
227 | + | ||
228 | + | ||
229 | + | @Callable(i) | |
230 | + | func cancelOrder (orderId) = { | |
231 | + | let owner = getOrderOwner(orderId) | |
232 | + | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
233 | + | if ((owner != toString(i.caller))) | |
234 | + | then throw("permission denied") | |
235 | + | else { | |
236 | + | let parts = split(orderbook, (orderId + ListSplitSymbol)) | |
237 | + | ScriptResult(WriteSet([DataEntry(OrderbookKey, (parts[0] + parts[1])), DataEntry((OrderStatusKey + orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, bondAssetId)])) | |
238 | + | } | |
239 | + | } | |
240 | + | ||
241 | + | ||
242 | + | ||
243 | + | @Callable(i) | |
244 | + | func executeOrder () = { | |
245 | + | let orderId = split(orderbook, ListSplitSymbol)[0] | |
246 | + | let orderTotal = getOrderTotal(orderId) | |
247 | + | let orderOwner = getOrderOwner(orderId) | |
248 | + | let filledTotal = getOrderFilledTotal(orderId) | |
249 | + | if ((0 >= surplus)) | |
250 | + | then throw("surplus is less than zero") | |
251 | + | else { | |
252 | + | let amount = (orderTotal - filledTotal) | |
253 | + | let surplusBond = convertNeutrinoToBond(surplus) | |
254 | + | let status = if ((surplusBond >= amount)) | |
255 | + | then FILLED | |
256 | + | else NEW | |
257 | + | let newFilledTotal = if ((surplusBond >= amount)) | |
258 | + | then orderTotal | |
259 | + | else surplusBond | |
260 | + | ScriptResult(WriteSet([DataEntry(OrderbookKey, split(orderbook, (orderId + ListSplitSymbol))[1]), DataEntry((OrderFilledTotalKey + orderId), (filledTotal + newFilledTotal)), DataEntry((OrderStatusKey + orderId), status)]), TransferSet([ScriptTransfer(addressFromStringValue(orderOwner), convertBondToNeutrino(newFilledTotal), neutrinoAssetId)])) | |
261 | + | } | |
262 | + | } | |
263 | + | ||
264 | + |
github/deemru/w8io/169f3d6 18.91 ms ◑