tx · GSixjZM77jD9t73PGiGGDBwjzCF9F7UB2yJvVsCzyTTu

3N3wgpZuw6MWRgf7XouSYL26EZSHCBYKgd6:  -0.10000000 Waves

2020.04.01 12:02 [934871] smart account 3N3wgpZuw6MWRgf7XouSYL26EZSHCBYKgd6 > SELF 0.00000000 Waves

{ "type": 13, "id": "GSixjZM77jD9t73PGiGGDBwjzCF9F7UB2yJvVsCzyTTu", "fee": 10000000, "feeAssetId": null, "timestamp": 1585731768297, "version": 1, "sender": "3N3wgpZuw6MWRgf7XouSYL26EZSHCBYKgd6", "senderPublicKey": "9ZPbyU1ZXeXBHtwUPjdeVo3xNdu7TqRN7S81nrZznxs3", "proofs": [ "dDpMUGgBo156MqqZePXPKnGhbFsoE2L96vAWcdX4t9Xa5MHce2FJMM9aBe1j6An4Ff62RQMYmZpbHXw95L6wU3o" ], "script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAANwEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAAAQAAABZnZXRCb29sQnlBZGRyZXNzQW5kS2V5AAAAAgAAAAdhZGRyZXNzAAAAA2tleQQAAAAHJG1hdGNoMAkABBsAAAACBQAAAAdhZGRyZXNzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAB0Jvb2xlYW4EAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEHAQAAABhnZXRTdHJpbmdCeUFkZHJlc3NBbmRLZXkAAA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lZmljaXQEAAAACmJvbmRBbW91bnQDCQAAZwAAAAIFAAAAD2RlZmljaXRQb3NpdGl2ZQUAAAALYm9uZEJhbGFuY2UFAAAAC2JvbmRCYWxhbmNlBQAAAA9kZWZpY2l0UG9zaXRpdmUEAAAADHJldHVybkFtb3VudAMJAABnAAAAAgUAAAAPZGVmaWNpdFBvc2l0aXZlBQAAAAtib25kQmFsYW5jZQAAAAAAAAAAAAkAAGUAAAACBQAAAAtib25kQmFsYW5jZQUAAAAPZGVmaWNpdFBvc2l0aXZlCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAA1GaXJzdE9yZGVyS2V5BQAAAANhcmcJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABFnZXRPcmRlclN0YXR1c0tleQAAAAEFAAAACmZpcnN0T3JkZXIJAAEsAAAAAgUAAAADYXJnAgAAAAN6enoFAAAAA25pbAAAAABYqhED", "chainId": 84, "height": 934871, "spentComplexity": 0 } View: original | compacted Prev: DNW9BGWX21mm6EJMpLnYHGNQNSTAprq333SLJ91z4sYp Next: G89ozM5oMdzQVFmVCeZfciDrGBswoSB3gpk2jssadzfi Diff:
OldNewDifferences
162162
163163
164164 @Callable(i)
165-func sellBond () = {
165+func sellBond (arg) = {
166166 let bondBalance = assetBalance(this, bondAssetId)
167167 let deficitPositive = if ((0 >= deficit))
168168 then 0
173173 let returnAmount = if ((deficitPositive >= bondBalance))
174174 then 0
175175 else (bondBalance - deficitPositive)
176- WriteSet([DataEntry(FirstOrderKey, "test006"), DataEntry(getOrderStatusKey(firstOrder), "test--6"), DataEntry((getOrderStatusKey(firstOrder) + "_index_"), "6")])
176+ WriteSet([DataEntry(FirstOrderKey, arg), DataEntry(getOrderStatusKey(firstOrder), (arg + "zzz"))])
177177 }
178178
179179
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getNumberByKey (key) = match getInteger(this, key) {
55 case a: Int =>
66 a
77 case _ =>
88 0
99 }
1010
1111
1212 func getStringByKey (key) = match getString(this, key) {
1313 case a: String =>
1414 a
1515 case _ =>
1616 ""
1717 }
1818
1919
2020 func getBoolByAddressAndKey (address,key) = match getBoolean(address, key) {
2121 case a: Boolean =>
2222 a
2323 case _ =>
2424 false
2525 }
2626
2727
2828 func getStringByAddressAndKey (address,key) = match getString(address, key) {
2929 case a: String =>
3030 a
3131 case _ =>
3232 ""
3333 }
3434
3535
3636 func getNumberByAddressAndKey (address,key) = match getInteger(address, key) {
3737 case a: Int =>
3838 a
3939 case _ =>
4040 0
4141 }
4242
4343
4444 let WAVELET = 100000000
4545
4646 let PAULI = 1000000
4747
4848 let PERCENTACCURACY = 1000
4949
5050 let MINORDERTOTAL = (10 * WAVELET)
5151
5252 let MAXROI = 100
5353
5454 let CANCELED = "canceled"
5555
5656 let NEW = "new"
5757
5858 let FILLED = "filled"
5959
6060 let NeutrinoContractKey = "neutrino_contract"
6161
6262 let PriceKey = "price"
6363
6464 let BondAssetIdKey = "bond_asset_id"
6565
6666 let NeutrinoAssetIdKey = "neutrino_asset_id"
6767
6868 let ControlContractKey = "control_contract"
6969
7070 let BalanceLockedkKey = "balance_lock_"
7171
7272 let WavesLockedBalanceKey = (BalanceLockedkKey + "waves")
7373
7474 let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino")
7575
7676 let LiquidationContractKey = "liquidation_contract"
7777
7878 let FirstOrderKey = "order_first"
7979
8080 func getRoiByOrderIdKey (orderId) = ("debug_order_roi_" + orderId)
8181
8282
8383 func getOrderPriceKey (orderId) = ("order_price_" + orderId)
8484
8585
8686 func getOrderTotalKey (orderId) = ("order_total_" + orderId)
8787
8888
8989 func getOrderOwnerKey (orderId) = ("order_owner_" + orderId)
9090
9191
9292 func getOrderHeightKey (orderId) = ("order_height_" + orderId)
9393
9494
9595 func getOrderStatusKey (orderId) = ("order_status_" + orderId)
9696
9797
9898 func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId)
9999
100100
101101 func getPrevOrderKey (orderId) = ("order_prev_" + orderId)
102102
103103
104104 func getNextOrderKey (orderId) = ("order_next_" + orderId)
105105
106106
107107 func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, 100, price), WAVELET, PAULI)
108108
109109
110110 func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 100), PAULI, WAVELET)
111111
112112
113113 func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price)
114114
115115
116116 func convertBondToWaves (amount,price) = convertNeutrinoToWaves(amount, price)
117117
118118
119119 let neutrinoContract = addressFromStringValue("3PC9BfRwJWWiw9AREE2B3eWzCks3CYtg4yo")
120120
121121 let controlContract = addressFromStringValue("3P5Bfd58PPfNvBM2Hy8QfbcDqMeNtzg7KfP")
122122
123123 let liquidationContract = addressFromStringValue("3P4PCxsJqMzQBALo8zANHtBDZRRquobHQp7")
124124
125125 let neutrinoAssetId = fromBase58String("DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p")
126126
127127 let bondAssetId = fromBase58String("6nSpVyNH7yM69eg446wrQR94ipbbcmZMU1ENPwanC97g")
128128
129129 let isBlocked = getBoolByAddressAndKey(controlContract, "is_blocked")
130130
131131 let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey)
132132
133133 let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey)
134134
135135 let reserve = (wavesBalance(neutrinoContract) - getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey))
136136
137137 let neutrinoSupply = (((neutrinoLockedBalance + extract(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId))
138138
139139 let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, currentPrice))
140140
141141 let firstOrder = getStringByKey(FirstOrderKey)
142142
143143 func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id))
144144
145145
146146 func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id))
147147
148148
149149 func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id))
150150
151151
152152 func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id))
153153
154154
155155 func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id))
156156
157157
158158 func getPrevOrder (id) = getStringByKey(getPrevOrderKey(id))
159159
160160
161161 func getNextOrder (id) = getStringByKey(getNextOrderKey(id))
162162
163163
164164 @Callable(i)
165-func sellBond () = {
165+func sellBond (arg) = {
166166 let bondBalance = assetBalance(this, bondAssetId)
167167 let deficitPositive = if ((0 >= deficit))
168168 then 0
169169 else deficit
170170 let bondAmount = if ((deficitPositive >= bondBalance))
171171 then bondBalance
172172 else deficitPositive
173173 let returnAmount = if ((deficitPositive >= bondBalance))
174174 then 0
175175 else (bondBalance - deficitPositive)
176- WriteSet([DataEntry(FirstOrderKey, "test006"), DataEntry(getOrderStatusKey(firstOrder), "test--6"), DataEntry((getOrderStatusKey(firstOrder) + "_index_"), "6")])
176+ WriteSet([DataEntry(FirstOrderKey, arg), DataEntry(getOrderStatusKey(firstOrder), (arg + "zzz"))])
177177 }
178178
179179

github/deemru/w8io/169f3d6 
28.96 ms