tx · Hfb4fzh8zcLJ28wvGRPX8eYLgmyiMVhyvidNQZGLSvYg 3MydqRdWHFcvU4ZogmgkGNHt8fqYiCRazbn: -0.10000000 Waves 2020.03.31 12:58 [933476] smart account 3MydqRdWHFcvU4ZogmgkGNHt8fqYiCRazbn > SELF 0.00000000 Waves
{ "type": 13, "id": "Hfb4fzh8zcLJ28wvGRPX8eYLgmyiMVhyvidNQZGLSvYg", "fee": 10000000, "feeAssetId": null, "timestamp": 1585648683278, "version": 1, "sender": "3MydqRdWHFcvU4ZogmgkGNHt8fqYiCRazbn", "senderPublicKey": "J4hU7VqLs2JAJXwFnjicQ97XShyZEqt8REC8fJHkTdKd", "proofs": [ "2L6Q9VkqYHXb3JtT2VHxd4Q1HENUbVEJnHbHeGK7y1n7V24NamZ46uMyMZg2Kkfh7eCPBM3r3Cwn3gmUMQ92yfMY" ], "script": "base64:AAIDAAAAAAAAACAIARIDCgEIEgASABIAEgASBAoCCAESABIDCgEIEgASAAAAAE0BAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAABAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAMZ2V0Qm9vbEJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQbAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAdCb29sZWFuBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBwEAAAAYZ2V0TnVtYmVyQnlBZGRyZX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eQAAAAIJAQAAABtnZXROZXV0cmlub0xvY2tlZEJhbGFuY2VLZXkAAAABBQAAAAdhY2NvdW50CAUAAAADcG10AAAABmFtb3VudAUAAAADbmlsAAAAABtBAcY=", "chainId": 84, "height": 933476, "spentComplexity": 0 } View: original | compacted Prev: FyBK84mdAfYxPHWrbS5QjpYdWTmmRKK7dmfaFdUwUkD9 Next: none Diff:
Old | New | Differences | |
---|---|---|---|
213 | 213 | ||
214 | 214 | ||
215 | 215 | @Callable(i) | |
216 | - | func getNeutrinoSupply () = WriteSet([DataEntry(key1, neutrinoSupply)]) | |
216 | + | func getNeutrinoSupply (assetId) = { | |
217 | + | let a = extract(assetInfo(neutrinoAssetId)).quantity | |
218 | + | WriteSet([DataEntry(key1, a)]) | |
219 | + | } | |
217 | 220 | ||
218 | 221 | ||
219 | 222 |
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 | 28 | func getNumberByAddressAndKey (address,key) = match getInteger(addressFromStringValue(address), key) { | |
29 | 29 | case a: Int => | |
30 | 30 | a | |
31 | 31 | case _ => | |
32 | 32 | 0 | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func getStringByAddressAndKey (address,key) = match getString(addressFromStringValue(address), key) { | |
37 | 37 | case a: String => | |
38 | 38 | a | |
39 | 39 | case _ => | |
40 | 40 | "" | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func getBoolByAddressAndKey (address,key) = match getBoolean(addressFromStringValue(address), key) { | |
45 | 45 | case a: Boolean => | |
46 | 46 | a | |
47 | 47 | case _ => | |
48 | 48 | false | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | let SENDTXEXPIRE = 30 | |
53 | 53 | ||
54 | 54 | let LISTSPLITSYMBOL = "_" | |
55 | 55 | ||
56 | 56 | let LISTDATASYMBOL = "+" | |
57 | 57 | ||
58 | 58 | let WAVELET = 100000000 | |
59 | 59 | ||
60 | 60 | let PAULI = 1000000 | |
61 | 61 | ||
62 | 62 | let DEFICITOFFSET = 5 | |
63 | 63 | ||
64 | 64 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
65 | 65 | ||
66 | 66 | let BondAssetIdKey = "bond_asset_id" | |
67 | 67 | ||
68 | 68 | let AuctionContractKey = "auction_contract" | |
69 | 69 | ||
70 | 70 | let LiquidationContractKey = "liquidation_contract" | |
71 | 71 | ||
72 | 72 | let RPDContractKey = "rpd_contract" | |
73 | 73 | ||
74 | 74 | let ContolContractKey = "control_contract" | |
75 | 75 | ||
76 | 76 | let BalanceWavesLockIntervalKey = "balance_waves_lock_interval" | |
77 | 77 | ||
78 | 78 | let BalanceNeutrinoLockIntervalKey = "balance_neutrino_lock_interval" | |
79 | 79 | ||
80 | 80 | let MinWavesSwapAmountKey = "min_waves_swap_amount" | |
81 | 81 | ||
82 | 82 | let MinNeutrinoSwapAmountKey = "min_neutrino_swap_amount" | |
83 | 83 | ||
84 | 84 | let NodeOracleProviderPubKeyKey = "node_oracle_provider" | |
85 | 85 | ||
86 | 86 | let key1 = "this_NeutrinoSupply" | |
87 | 87 | ||
88 | 88 | let key2 = "this_Surplus" | |
89 | 89 | ||
90 | 90 | let key3 = "this_Deficit" | |
91 | 91 | ||
92 | 92 | let RPDBalanceKey = "rpd_balance" | |
93 | 93 | ||
94 | 94 | func getRPDContractBalanceKey (assetId) = ((RPDBalanceKey + "_") + toBase58String(assetId)) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | let PriceKey = "price" | |
98 | 98 | ||
99 | 99 | let PriceIndexKey = "price_index" | |
100 | 100 | ||
101 | 101 | let IsBlockedKey = "is_blocked" | |
102 | 102 | ||
103 | 103 | func getPriceHistoryKey (block) = ((PriceKey + "_") + toString(block)) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func getHeightPriceByIndexKey (index) = ((PriceIndexKey + "_") + toString(index)) | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | let BalanceLockedkKey = "balance_lock_" | |
110 | 110 | ||
111 | 111 | let WavesLockedBalanceKey = (BalanceLockedkKey + "waves") | |
112 | 112 | ||
113 | 113 | let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino") | |
114 | 114 | ||
115 | 115 | func getRPDSnapshotContractBalanceKey (count,assetId) = ((((RPDBalanceKey + "_") + toBase58String(assetId)) + "_") + toString(count)) | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func getCancelLeaseTxReserveFeeKey (hash) = (("cancel_lease_tx_reserve_fee" + "_") + hash) | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func getWavesLockedBalanceKey (owner) = ((WavesLockedBalanceKey + "_") + owner) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func getNeutrinoLockedBalanceKey (owner) = ((NeutrinoLockedBalanceKey + "_") + owner) | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func getBalanceUnlockBlockKey (owner) = ("balance_unlock_block_" + owner) | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func getRPDProfitKey (count) = (("rpd_profit" + "_") + toString(count)) | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, 100, price), WAVELET, PAULI) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 100), PAULI, WAVELET) | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price) | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func convertJsonArrayToList (jsonArray) = split(jsonArray, ",") | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | let liquidationContract = getStringByKey(LiquidationContractKey) | |
146 | 146 | ||
147 | 147 | let neutrinoAssetIdString = getStringByKey(NeutrinoAssetIdKey) | |
148 | 148 | ||
149 | 149 | let neutrinoAssetId = fromBase58String(neutrinoAssetIdString) | |
150 | 150 | ||
151 | 151 | let auctionContract = getStringByKey(AuctionContractKey) | |
152 | 152 | ||
153 | 153 | let rpdContract = getStringByKey(RPDContractKey) | |
154 | 154 | ||
155 | 155 | let controlContract = getStringByKey(ContolContractKey) | |
156 | 156 | ||
157 | 157 | let priceIndex = getNumberByAddressAndKey(controlContract, PriceIndexKey) | |
158 | 158 | ||
159 | 159 | let isBlocked = getBoolByAddressAndKey(controlContract, IsBlockedKey) | |
160 | 160 | ||
161 | 161 | let nodeOracleProviderPubKey = fromBase58String(getStringByKey(NodeOracleProviderPubKeyKey)) | |
162 | 162 | ||
163 | 163 | let balanceWavesLockInterval = getNumberByKey(BalanceWavesLockIntervalKey) | |
164 | 164 | ||
165 | 165 | let balanceNeutrinoLockInterval = getNumberByKey(BalanceNeutrinoLockIntervalKey) | |
166 | 166 | ||
167 | 167 | let minWavesSwapAmount = getNumberByKey(MinWavesSwapAmountKey) | |
168 | 168 | ||
169 | 169 | let minNeutrinoSwapAmount = getNumberByKey(MinNeutrinoSwapAmountKey) | |
170 | 170 | ||
171 | 171 | let bondAssetId = fromBase58String("Qh28HvUAcFboD1GsAcyURQjNW6mdpuGvXVgFS9e3CzC") | |
172 | 172 | ||
173 | 173 | let deprecatedBondAssetId = fromBase58String("EyizrdEpB9yuh45Zv3f2UfxKLjcecrmvcq5DSP9fEwum") | |
174 | 174 | ||
175 | 175 | let neutrinoContract = this | |
176 | 176 | ||
177 | 177 | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
178 | 178 | ||
179 | 179 | let neutrinoLockedBalance = getNumberByKey(NeutrinoLockedBalanceKey) | |
180 | 180 | ||
181 | 181 | let wavesLockedBalance = getNumberByKey(WavesLockedBalanceKey) | |
182 | 182 | ||
183 | 183 | let reserve = (wavesBalance(neutrinoContract) - wavesLockedBalance) | |
184 | 184 | ||
185 | 185 | let neutrinoSupply = (((neutrinoLockedBalance + extract(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(addressFromStringValue(liquidationContract), neutrinoAssetId)) | |
186 | 186 | ||
187 | 187 | let surplus = (convertWavesToNeutrino(reserve, currentPrice) - neutrinoSupply) | |
188 | 188 | ||
189 | 189 | let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, currentPrice)) | |
190 | 190 | ||
191 | 191 | func getRPDContractBalance (assetId) = getNumberByAddressAndKey(rpdContract, getRPDContractBalanceKey(assetId)) | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func getPriceHistory (block) = getNumberByAddressAndKey(controlContract, getPriceHistoryKey(block)) | |
195 | 195 | ||
196 | 196 | ||
197 | 197 | func getHeightPriceByIndex (index) = getNumberByAddressAndKey(controlContract, getHeightPriceByIndexKey(index)) | |
198 | 198 | ||
199 | 199 | ||
200 | 200 | func getCancelLeaseTxReserveFee (hash) = getNumberByKey(getCancelLeaseTxReserveFeeKey(hash)) | |
201 | 201 | ||
202 | 202 | ||
203 | 203 | func getWavesLockedBalance (owner) = getNumberByKey(getWavesLockedBalanceKey(owner)) | |
204 | 204 | ||
205 | 205 | ||
206 | 206 | func getNeutrinoLockedBalance (owner) = getNumberByKey(getNeutrinoLockedBalanceKey(owner)) | |
207 | 207 | ||
208 | 208 | ||
209 | 209 | func getUnlockBalanceBlock (owner) = getNumberByKey(getBalanceUnlockBlockKey(owner)) | |
210 | 210 | ||
211 | 211 | ||
212 | 212 | func getRPDProfit (count) = getNumberByKey(getRPDProfitKey(count)) | |
213 | 213 | ||
214 | 214 | ||
215 | 215 | @Callable(i) | |
216 | - | func getNeutrinoSupply () = WriteSet([DataEntry(key1, neutrinoSupply)]) | |
216 | + | func getNeutrinoSupply (assetId) = { | |
217 | + | let a = extract(assetInfo(neutrinoAssetId)).quantity | |
218 | + | WriteSet([DataEntry(key1, a)]) | |
219 | + | } | |
217 | 220 | ||
218 | 221 | ||
219 | 222 | ||
220 | 223 | @Callable(i) | |
221 | 224 | func getSurplus () = WriteSet([DataEntry(key2, surplus)]) | |
222 | 225 | ||
223 | 226 | ||
224 | 227 | ||
225 | 228 | @Callable(i) | |
226 | 229 | func getDeficit () = WriteSet([DataEntry(key3, deficit)]) | |
227 | 230 | ||
228 | 231 | ||
229 | 232 | ||
230 | 233 | @Callable(i) | |
231 | 234 | func swapWavesToNeutrino () = { | |
232 | 235 | let pmt = extract(i.payment) | |
233 | 236 | let account = toString(i.caller) | |
234 | 237 | if ((minWavesSwapAmount > pmt.amount)) | |
235 | 238 | then throw((("The specified Waves amount is less than the required minimum of " + toString(minWavesSwapAmount)) + " wavelets.")) | |
236 | 239 | else if (isDefined(pmt.assetId)) | |
237 | 240 | then throw("Only Waves token is allowed for swapping.") | |
238 | 241 | else if (isBlocked) | |
239 | 242 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
240 | 243 | else if ((getUnlockBalanceBlock(account) > height)) | |
241 | 244 | then throw((("await " + toString((getUnlockBalanceBlock(account) - height))) + " blocks")) | |
242 | 245 | else if (if ((getNeutrinoLockedBalance(account) != 0)) | |
243 | 246 | then true | |
244 | 247 | else (getWavesLockedBalance(account) != 0)) | |
245 | 248 | then throw("please withdraw locked funds first") | |
246 | 249 | else WriteSet([DataEntry(getWavesLockedBalanceKey(account), pmt.amount), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceWavesLockInterval)), DataEntry(WavesLockedBalanceKey, (wavesLockedBalance + pmt.amount))]) | |
247 | 250 | } | |
248 | 251 | ||
249 | 252 | ||
250 | 253 | ||
251 | 254 | @Callable(i) | |
252 | 255 | func swapNeutrinoToWaves () = { | |
253 | 256 | let pmt = extract(i.payment) | |
254 | 257 | let account = toString(i.caller) | |
255 | 258 | if ((minNeutrinoSwapAmount > pmt.amount)) | |
256 | 259 | then throw((("The specified Neutrino amount is less than the required minimum of " + toString(minNeutrinoSwapAmount)) + " Neutrino cents.")) | |
257 | 260 | else if (isBlocked) | |
258 | 261 | then throw("The contract is blocked by EMERGENCY SHUTDOWN. Please wait for reactivation by emergency oracles.") | |
259 | 262 | else if ((pmt.assetId != neutrinoAssetId)) | |
260 | 263 | then throw("Only appropriate Neutrino tokens are allowed for swapping.") | |
261 | 264 | else if ((getUnlockBalanceBlock(account) > height)) | |
262 | 265 | then throw((("await " + toString((getUnlockBalanceBlock(account) - height))) + " blocks")) | |
263 | 266 | else if (if ((getNeutrinoLockedBalance(account) != 0)) | |
264 | 267 | then true | |
265 | 268 | else (getWavesLockedBalance(account) != 0)) | |
266 | 269 | then throw("please withdraw locked funds first") | |
267 | 270 | else WriteSet([DataEntry(getNeutrinoLockedBalanceKey(account), pmt.amount), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceNeutrinoLockInterval)), DataEntry(NeutrinoLockedBalanceKey, (neutrinoLockedBalance + pmt.amount))]) | |
268 | 271 | } | |
269 | 272 | ||
270 | 273 | ||
271 | 274 | ||
272 | 275 | @Callable(i) | |
273 | 276 | func withdraw (account,index) = { | |
274 | 277 | let unlockHeight = getUnlockBalanceBlock(account) | |
275 | 278 | let userWavesLockedBalance = getWavesLockedBalance(account) | |
276 | 279 | let userNeutrinoLockedBalance = getNeutrinoLockedBalance(account) | |
277 | 280 | let indexHeight = getHeightPriceByIndex(index) | |
278 | 281 | let prevIndexHeight = getHeightPriceByIndex((index - 1)) | |
279 | 282 | let priceByIndex = getPriceHistory(indexHeight) | |
280 | 283 | let neutrinoAmount = convertWavesToNeutrino(userWavesLockedBalance, priceByIndex) | |
281 | 284 | let wavesAmount = convertNeutrinoToWaves(userNeutrinoLockedBalance, priceByIndex) | |
282 | 285 | if (isBlocked) | |
283 | 286 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
284 | 287 | else if ((unlockHeight > height)) | |
285 | 288 | then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw WAVES funds")) | |
286 | 289 | else if (if (if ((index > priceIndex)) | |
287 | 290 | then true | |
288 | 291 | else (unlockHeight > indexHeight)) | |
289 | 292 | then true | |
290 | 293 | else if ((prevIndexHeight != 0)) | |
291 | 294 | then (prevIndexHeight >= unlockHeight) | |
292 | 295 | else false) | |
293 | 296 | then throw(((((((((("invalid price history index: index=" + toString(index)) + " priceIndex=") + toString(priceIndex)) + " indexHeight=") + toString(indexHeight)) + " unlockHeight=") + toString(unlockHeight)) + " prevIndexHeight=") + toString(prevIndexHeight))) | |
294 | 297 | else if (if ((0 >= neutrinoAmount)) | |
295 | 298 | then (0 >= wavesAmount) | |
296 | 299 | else false) | |
297 | 300 | then throw("balance equals zero") | |
298 | 301 | else ScriptResult(WriteSet([DataEntry(getWavesLockedBalanceKey(account), 0), DataEntry(getNeutrinoLockedBalanceKey(account), 0), DataEntry(WavesLockedBalanceKey, (wavesLockedBalance - userWavesLockedBalance)), DataEntry(NeutrinoLockedBalanceKey, (neutrinoLockedBalance - userNeutrinoLockedBalance))]), TransferSet([ScriptTransfer(addressFromStringValue(account), wavesAmount, unit), ScriptTransfer(addressFromStringValue(account), neutrinoAmount, neutrinoAssetId)])) | |
299 | 302 | } | |
300 | 303 | ||
301 | 304 | ||
302 | 305 | ||
303 | 306 | @Callable(i) | |
304 | 307 | func transferToAuction () = { | |
305 | 308 | let deficitBondAmount = (deficit - assetBalance(addressFromStringValue(auctionContract), bondAssetId)) | |
306 | 309 | let minDeficit = fraction(neutrinoSupply, DEFICITOFFSET, 100) | |
307 | 310 | let surplusWithLiquidation = (surplus - assetBalance(addressFromStringValue(liquidationContract), neutrinoAssetId)) | |
308 | 311 | if (isBlocked) | |
309 | 312 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
310 | 313 | else if (if ((deficitBondAmount > minDeficit)) | |
311 | 314 | then (deficitBondAmount > 0) | |
312 | 315 | else false) | |
313 | 316 | then TransferSet([ScriptTransfer(addressFromStringValue(auctionContract), deficitBondAmount, bondAssetId)]) | |
314 | 317 | else if ((surplusWithLiquidation >= (1 * PAULI))) | |
315 | 318 | then TransferSet([ScriptTransfer(addressFromStringValue(liquidationContract), surplusWithLiquidation, neutrinoAssetId)]) | |
316 | 319 | else throw(((((((("bond were generated or do not need it. Deficit:" + toString(deficitBondAmount)) + "|") + toString(minDeficit)) + ". Surplus:") + toString(surplusWithLiquidation)) + "|") + toString(surplus))) | |
317 | 320 | } | |
318 | 321 | ||
319 | 322 | ||
320 | 323 | ||
321 | 324 | @Callable(i) | |
322 | 325 | func transfer (account) = { | |
323 | 326 | let pmt = extract(i.payment) | |
324 | 327 | TransferSet([ScriptTransfer(addressFromStringValue(account), pmt.amount, pmt.assetId)]) | |
325 | 328 | } | |
326 | 329 | ||
327 | 330 | ||
328 | 331 | ||
329 | 332 | @Callable(i) | |
330 | 333 | func migrationUSDNB2NSBTSwap () = { | |
331 | 334 | let pmt = extract(i.payment) | |
332 | 335 | let account = i.caller | |
333 | 336 | if ((deprecatedBondAssetId != pmt.assetId)) | |
334 | 337 | then throw("error: attempt to swap not USDNB tokens") | |
335 | 338 | else TransferSet([ScriptTransfer(account, (pmt.amount * PAULI), bondAssetId)]) | |
336 | 339 | } | |
337 | 340 | ||
338 | 341 | ||
339 | 342 | ||
340 | 343 | @Callable(i) | |
341 | 344 | func testTransfer () = { | |
342 | 345 | let pmt = extract(i.payment) | |
343 | 346 | let account = toString(i.caller) | |
344 | 347 | WriteSet([DataEntry(getNeutrinoLockedBalanceKey(account), pmt.amount)]) | |
345 | 348 | } | |
346 | 349 | ||
347 | 350 |
github/deemru/w8io/169f3d6 43.14 ms ◑