tx · BiJZqwsb8TzNFBkn62N2iP3H3Lh9RsKrcqwrpvPnkwfK

3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi:  -0.01400000 Waves

2022.04.05 18:13 [1995452] smart account 3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi > SELF 0.00000000 Waves

{ "type": 13, "id": "BiJZqwsb8TzNFBkn62N2iP3H3Lh9RsKrcqwrpvPnkwfK", "fee": 1400000, "feeAssetId": null, "timestamp": 1649171595706, "version": 1, "sender": "3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi", "senderPublicKey": "4qGVXRFATZNzo2RZZ5UYHXojGyJgSRBwtgJcCU8rJe5A", "proofs": [ "58iGEKJA7xgPKxQDZFtzoqmgpvufboryicXPsU2VVKBG6W8bXfcWRbtdcgDs6fvFLzvHQgb5RkbAenaxnENMUqGB" ], "script": "base64:AAIFAAAAAAAAADMIAhIFCgMICAESAwoBARIHCgUBAQEBARIDCgEBEgMKAQESABIFCgMBAQESBwoFAQEBAQEAAABCAAAAAAtyZXZpc2lvbk51bQIAAAAoOTYyMDA4NDJhZTQwMzEzOThmYmExOGEwNmI4Yzk2MjRhMGQ0M2NmMAAAAAAHV0FWRUxFVAAAAAAABfXhAAAAAAAFUEFVTEkAAAAAAAAPQkAAAAAACEJJR1BBVUxJCQABNgAAAAEAAAAAAAAPQkAAAAAACFBSSUNFTEVUAAAAAAAAD0JAAAAAAARNVUxUAAAAAAAF9eEAAAAAAAlCSUdNVUxUMTYJAAE2AAAAAQAAI4byb8EAAAAAAAAJTVVMVFNDQUxFAAAAAAAAAAAIAAAAAAdTQ0FMRTE2AAAAAAAAAAAQAAAAAANTRVACAAAAAl9fAAAAAAVIQUxGOAAAAAAAAvrwgAAAAAALRVVMRVJOVU1CRVIJAAE2AAAAAQAAYJKhE9jVdAAAAAAGc2NhbGU2AAAAAAAAD0JAAAAAAAxzY2FsZTZCaWdJbnQJAAE2AAAAAQAAAAAAAA9CQAAAAAAMc2NhbGU4QmlnSW50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QAAAAEJAAGRAAAAAgUAAAAQcHViS2V5QWRtaW5zTGlzdAAAAAAAAAAAAwAAAAAAAAAAAgAAAAAAAAAAAAkAAGcAAAACBQAAAAVjb3VudAAAAAAAAAAAA9U4rUI=", "chainId": 84, "height": 1995452, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5LQET3pBXKVNvZRW6v9Gjt9EyMRGBB9ndrPrrrP2kmaV Next: 8t7P7J53q6p5Ktr38CWp5cxA5cMEKZgMiP93G9yfKpkH Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let revisionNum = "96200842ae4031398fba18a06b8c9624a0d43cf0"
5+
46 let WAVELET = 100000000
57
68 let PAULI = 1000000
7173
7274
7375 func keySwapAmountAParam () = "%s%s__config__swapAParam"
76+
77+
78+func keySwapAmountBParam () = "%s%s__config__swapBParam"
7479
7580
7681 func keyNeutrinoAssetId () = "neutrino_asset_id"
169174
170175 let nsbtAssetId = fromBase58String(getStringValue(neutrinoContract, keyBondAssetId()))
171176
172-func calcContractNsbtPriceInternal (nsbtSupplyDELTA) = {
173- let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil))
174- let price = asInt(neutrinoMetrics[nMetricIdxPrice])
175- let wRaw = asInt(neutrinoMetrics[nMetricIdxReserve])
176- let uRaw = (asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) - nsbtSupplyDELTA)
177- let sRaw = (asInt(neutrinoMetrics[nMetricIdxNsbtSupply]) + nsbtSupplyDELTA)
178- let mRaw = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply])
179- let kCalcArray = asAnyList(invoke(this, "calculateKREADONLY", [wRaw, uRaw, price, mRaw, sRaw], nil))
180- let multKX16 = parseBigIntValue(asString(kCalcArray[kResultIdxMultKStr]))
181- let multStep1X16 = fraction(toBigInt(mRaw), BIGMULT16, toBigInt((mRaw - sRaw)))
182- let multStep2X16 = fraction(multStep1X16, multStep1X16, BIGMULT16)
183- let multNsbt2usdnPriceX16 = fraction(multKX16, multStep2X16, BIGMULT16)
184- let nsbt2usdnPrice = toInt(fraction(multNsbt2usdnPriceX16, toBigInt(PAULI), BIGMULT16))
185- let nsbt2wavesPrice = fraction(nsbt2usdnPrice, PAULI, price)
186- $Tuple2(nil, [nsbt2usdnPrice, nsbt2wavesPrice])
187- }
188-
189-
190177 @Callable(i)
191178 func constructor (neutrinoAddress,nsbtLockAddress,swapAmountAParam) = if ((i.caller != this))
192179 then throw("not authorized")
197184 @Callable(i)
198185 func calcSwapLimitREADONLY (gNsbtAmount) = {
199186 let limitParamA = toBigInt(getIntOrFail(this, keySwapAmountAParam()))
187+ let limitParamB = toBigInt(getIntOrFail(this, keySwapAmountBParam()))
200188 let gNsbtAmountScale16 = toX16(gNsbtAmount, scale6)
201- let limitPowPart = pow(gNsbtAmountScale16, 16, EULERNUMBER, 16, 8, CEILING)
189+ let limitPowPart = pow(gNsbtAmountScale16, 16, limitParamB, 16, 8, CEILING)
202190 let limit = fraction(limitParamA, limitPowPart, scale10BigInt)
203191 $Tuple2(nil, toInt(limit))
204192 }
248236
249237
250238 @Callable(i)
251-func calcContractNsbtPriceSYSREADONLY (nsbtSupplyDELTA) = calcContractNsbtPriceInternal(nsbtSupplyDELTA)
239+func calcContractNsbtPriceSYSREADONLY (nsbtSupplyDELTA) = {
240+ let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil))
241+ let price = asInt(neutrinoMetrics[nMetricIdxPrice])
242+ let wRaw = asInt(neutrinoMetrics[nMetricIdxReserve])
243+ let uRaw = (asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) - nsbtSupplyDELTA)
244+ let sRaw = (asInt(neutrinoMetrics[nMetricIdxNsbtSupply]) + nsbtSupplyDELTA)
245+ let mRaw = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply])
246+ let kCalcArray = asAnyList(invoke(this, "calculateKREADONLY", [wRaw, uRaw, price, mRaw, sRaw], nil))
247+ let multKX16 = parseBigIntValue(asString(kCalcArray[kResultIdxMultKStr]))
248+ let multStep1X16 = fraction(toBigInt(mRaw), BIGMULT16, toBigInt((mRaw - sRaw)))
249+ let multStep2X16 = fraction(multStep1X16, multStep1X16, BIGMULT16)
250+ let multNsbt2usdnPriceX16 = fraction(multKX16, multStep2X16, BIGMULT16)
251+ let nsbt2usdnPrice = toInt(fraction(multNsbt2usdnPriceX16, toBigInt(PAULI), BIGMULT16))
252+ let nsbt2wavesPrice = fraction(nsbt2usdnPrice, PAULI, price)
253+ $Tuple2(nil, [nsbt2usdnPrice, nsbt2wavesPrice])
254+ }
252255
253256
254257
288291 }
289292
290293
294+@Verifier(tx)
295+func verify () = {
296+ let pubKeyAdminsList = ["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"]
297+ let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0])))
298+ then 1
299+ else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1])))
300+ then 1
301+ else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2])))
302+ then 1
303+ else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3])))
304+ then 2
305+ else 0))
306+ (count >= 3)
307+ }
308+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let revisionNum = "96200842ae4031398fba18a06b8c9624a0d43cf0"
5+
46 let WAVELET = 100000000
57
68 let PAULI = 1000000
79
810 let BIGPAULI = toBigInt(1000000)
911
1012 let PRICELET = 1000000
1113
1214 let MULT = 100000000
1315
1416 let BIGMULT16 = toBigInt(10000000000000000)
1517
1618 let MULTSCALE = 8
1719
1820 let SCALE16 = 16
1921
2022 let SEP = "__"
2123
2224 let HALF8 = 50000000
2325
2426 let EULERNUMBER = toBigInt(27182818284590452)
2527
2628 let scale6 = 1000000
2729
2830 let scale6BigInt = toBigInt(1000000)
2931
3032 let scale8BigInt = toBigInt(100000000)
3133
3234 let scale10BigInt = toBigInt(10000000000)
3335
3436 let kResultIdxA = 0
3537
3638 let kResultIdxPaulB = 1
3739
3840 let kResultIdxWReservesInUsdn = 2
3941
4042 let kResultIdxMultBR = 3
4143
4244 let kResultIdxMultPower = 4
4345
4446 let kResultIdxMultExpInPowerStr = 5
4547
4648 let kResultIdxMultKStr = 6
4749
4850 let nMetricIdxPrice = 0
4951
5052 let nMetricIdxUsdnLockedBalance = 1
5153
5254 let nMetricIdxWavesLockedBalance = 2
5355
5456 let nMetricIdxReserve = 3
5557
5658 let nMetricIdxReserveInUsdn = 4
5759
5860 let nMetricIdxUsdnSupply = 5
5961
6062 let nMetricIdxSurplus = 6
6163
6264 let nMetricIdxSurplusPercent = 7
6365
6466 let nMetricIdxBR = 8
6567
6668 let nMetricIdxNsbtSupply = 9
6769
6870 let nMetricIdxMaxNsbtSupply = 10
6971
7072 func keyNeutrinoAddress () = "%s%s__config__neutrinoAddress"
7173
7274
7375 func keySwapAmountAParam () = "%s%s__config__swapAParam"
76+
77+
78+func keySwapAmountBParam () = "%s%s__config__swapBParam"
7479
7580
7681 func keyNeutrinoAssetId () = "neutrino_asset_id"
7782
7883
7984 func keyLiquidationContractAddress () = "liquidation_contract"
8085
8186
8287 func keyAuctionContract () = "auction_contract"
8388
8489
8590 func keyContolContract () = "control_contract"
8691
8792
8893 func keyBondAssetId () = "bond_asset_id"
8994
9095
9196 func keyBalanceLocked () = "balance_lock_"
9297
9398
9499 func keyWavesLockedBalance () = (keyBalanceLocked() + "waves")
95100
96101
97102 func keyNeutrinoLockedBalance () = (keyBalanceLocked() + "neutrino")
98103
99104
100105 func swapsTimeframeKEY () = "swaps_timeframe"
101106
102107
103108 func keyUserLastQuickSwapHeight (userAddress) = makeString(["%s%s", "userLastQuickSwapHeight", userAddress], SEP)
104109
105110
106111 func keyQuickSwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "quickSwapUserSpentInPeriod", userAddress], SEP)
107112
108113
109114 func keyPrice () = "price"
110115
111116
112117 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
113118
114119
115120 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
116121
117122
118123 func getNumberByKey (address,key) = valueOrElse(getInteger(address, key), 0)
119124
120125
121126 func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
122127
123128
124129 func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI)
125130
126131
127132 func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET)
128133
129134
130135 func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), BIGMULT16, toBigInt(origScaleMult))
131136
132137
133138 func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), BIGMULT16))
134139
135140
136141 func asAnyList (val) = match val {
137142 case valAnyLyst: List[Any] =>
138143 valAnyLyst
139144 case _ =>
140145 throw("fail to cast into List[Any]")
141146 }
142147
143148
144149 func asInt (val) = match val {
145150 case valInt: Int =>
146151 valInt
147152 case _ =>
148153 throw("fail to cast into Int")
149154 }
150155
151156
152157 func asString (val) = match val {
153158 case valStr: String =>
154159 valStr
155160 case _ =>
156161 throw("fail to cast into String")
157162 }
158163
159164
160165 let neutrinoContract = addressFromStringValue(getStringOrFail(this, keyNeutrinoAddress()))
161166
162167 let controlContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyContolContract()))
163168
164169 let auctionContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyAuctionContract()))
165170
166171 let liquidationContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyLiquidationContractAddress()))
167172
168173 let neutrinoAssetId = fromBase58String(getStringOrFail(neutrinoContract, keyNeutrinoAssetId()))
169174
170175 let nsbtAssetId = fromBase58String(getStringValue(neutrinoContract, keyBondAssetId()))
171176
172-func calcContractNsbtPriceInternal (nsbtSupplyDELTA) = {
173- let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil))
174- let price = asInt(neutrinoMetrics[nMetricIdxPrice])
175- let wRaw = asInt(neutrinoMetrics[nMetricIdxReserve])
176- let uRaw = (asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) - nsbtSupplyDELTA)
177- let sRaw = (asInt(neutrinoMetrics[nMetricIdxNsbtSupply]) + nsbtSupplyDELTA)
178- let mRaw = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply])
179- let kCalcArray = asAnyList(invoke(this, "calculateKREADONLY", [wRaw, uRaw, price, mRaw, sRaw], nil))
180- let multKX16 = parseBigIntValue(asString(kCalcArray[kResultIdxMultKStr]))
181- let multStep1X16 = fraction(toBigInt(mRaw), BIGMULT16, toBigInt((mRaw - sRaw)))
182- let multStep2X16 = fraction(multStep1X16, multStep1X16, BIGMULT16)
183- let multNsbt2usdnPriceX16 = fraction(multKX16, multStep2X16, BIGMULT16)
184- let nsbt2usdnPrice = toInt(fraction(multNsbt2usdnPriceX16, toBigInt(PAULI), BIGMULT16))
185- let nsbt2wavesPrice = fraction(nsbt2usdnPrice, PAULI, price)
186- $Tuple2(nil, [nsbt2usdnPrice, nsbt2wavesPrice])
187- }
188-
189-
190177 @Callable(i)
191178 func constructor (neutrinoAddress,nsbtLockAddress,swapAmountAParam) = if ((i.caller != this))
192179 then throw("not authorized")
193180 else [StringEntry(keyNeutrinoAddress(), neutrinoAddress), IntegerEntry(keySwapAmountAParam(), swapAmountAParam)]
194181
195182
196183
197184 @Callable(i)
198185 func calcSwapLimitREADONLY (gNsbtAmount) = {
199186 let limitParamA = toBigInt(getIntOrFail(this, keySwapAmountAParam()))
187+ let limitParamB = toBigInt(getIntOrFail(this, keySwapAmountBParam()))
200188 let gNsbtAmountScale16 = toX16(gNsbtAmount, scale6)
201- let limitPowPart = pow(gNsbtAmountScale16, 16, EULERNUMBER, 16, 8, CEILING)
189+ let limitPowPart = pow(gNsbtAmountScale16, 16, limitParamB, 16, 8, CEILING)
202190 let limit = fraction(limitParamA, limitPowPart, scale10BigInt)
203191 $Tuple2(nil, toInt(limit))
204192 }
205193
206194
207195
208196 @Callable(i)
209197 func calculateKREADONLY (wRaw,uRaw,price,mRaw,sRaw) = {
210198 let EXP = toBigInt(2718281)
211199 let EXPSCALE = 6
212200 let a = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_a"), 3)
213201 let paulB = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_b"), ((3 * PAULI) / 10))
214202 let wReservesInUsdn = convertWavesToNeutrino(wRaw, price)
215203 let multBR = fraction(wReservesInUsdn, MULT, uRaw)
216204 if ((multBR > 10678564816))
217205 then throw("BR > 10678.564816% will overflow exponent")
218206 else {
219207 let multPower = (a * (multBR - MULT))
220208 let multExpInPower = pow(EXP, EXPSCALE, toBigInt(multPower), MULTSCALE, SCALE16, DOWN)
221209 let multK = fraction(toBigInt(paulB), multExpInPower, BIGPAULI)
222210 $Tuple2(nil, [a, paulB, wReservesInUsdn, multBR, multPower, toString(multExpInPower), toString(multK)])
223211 }
224212 }
225213
226214
227215
228216 @Callable(i)
229217 func curveFunctionREADONLY (wavesPayRaw) = {
230218 let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil))
231219 let price = asInt(neutrinoMetrics[nMetricIdxPrice])
232220 let wRaw = asInt(neutrinoMetrics[nMetricIdxReserve])
233221 let uRaw = asInt(neutrinoMetrics[nMetricIdxUsdnSupply])
234222 let sRaw = asInt(neutrinoMetrics[nMetricIdxNsbtSupply])
235223 let mRaw = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply])
236224 let kCalcArray = asAnyList(invoke(this, "calculateKREADONLY", [wRaw, uRaw, price, mRaw, sRaw], nil))
237225 let multK = parseBigIntValue(asString(kCalcArray[kResultIdxMultKStr]))
238226 let usdnPay = convertWavesToNeutrino(wavesPayRaw, price)
239227 let bigMaxNsbtSupply = toBigInt(mRaw)
240228 let bigNsbtSupply = toBigInt((mRaw - sRaw))
241229 let step1 = fraction(toBigInt(usdnPay), BIGMULT16, multK)
242230 let step2 = fraction(step1, bigNsbtSupply, bigMaxNsbtSupply)
243231 let step3 = toInt(fraction(bigNsbtSupply, bigMaxNsbtSupply, (step2 + bigMaxNsbtSupply)))
244232 let nsbtAmountRaw = ((mRaw - sRaw) - step3)
245233 $Tuple2(nil, [nsbtAmountRaw, usdnPay, wRaw, uRaw, mRaw, sRaw, asInt(kCalcArray[kResultIdxA]), asInt(kCalcArray[kResultIdxPaulB]), asInt(kCalcArray[kResultIdxWReservesInUsdn]), price, asInt(kCalcArray[kResultIdxMultBR]), asInt(kCalcArray[kResultIdxMultPower]), kCalcArray[kResultIdxMultExpInPowerStr], kCalcArray[kResultIdxMultKStr], toString(step1), toString(step2), step3])
246234 }
247235
248236
249237
250238 @Callable(i)
251-func calcContractNsbtPriceSYSREADONLY (nsbtSupplyDELTA) = calcContractNsbtPriceInternal(nsbtSupplyDELTA)
239+func calcContractNsbtPriceSYSREADONLY (nsbtSupplyDELTA) = {
240+ let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil))
241+ let price = asInt(neutrinoMetrics[nMetricIdxPrice])
242+ let wRaw = asInt(neutrinoMetrics[nMetricIdxReserve])
243+ let uRaw = (asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) - nsbtSupplyDELTA)
244+ let sRaw = (asInt(neutrinoMetrics[nMetricIdxNsbtSupply]) + nsbtSupplyDELTA)
245+ let mRaw = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply])
246+ let kCalcArray = asAnyList(invoke(this, "calculateKREADONLY", [wRaw, uRaw, price, mRaw, sRaw], nil))
247+ let multKX16 = parseBigIntValue(asString(kCalcArray[kResultIdxMultKStr]))
248+ let multStep1X16 = fraction(toBigInt(mRaw), BIGMULT16, toBigInt((mRaw - sRaw)))
249+ let multStep2X16 = fraction(multStep1X16, multStep1X16, BIGMULT16)
250+ let multNsbt2usdnPriceX16 = fraction(multKX16, multStep2X16, BIGMULT16)
251+ let nsbt2usdnPrice = toInt(fraction(multNsbt2usdnPriceX16, toBigInt(PAULI), BIGMULT16))
252+ let nsbt2wavesPrice = fraction(nsbt2usdnPrice, PAULI, price)
253+ $Tuple2(nil, [nsbt2usdnPrice, nsbt2wavesPrice])
254+ }
252255
253256
254257
255258 @Callable(i)
256259 func calcNeutinoMetricsREADONLY () = {
257260 let currentPrice = getIntegerValue(controlContract, keyPrice())
258261 let neutrinoLockedBalance = valueOrElse(getInteger(neutrinoContract, keyNeutrinoLockedBalance()), 0)
259262 let wavesLockedBalance = valueOrElse(getInteger(neutrinoContract, keyWavesLockedBalance()), 0)
260263 let reserve = (wavesBalance(neutrinoContract).regular - wavesLockedBalance)
261264 let reservesInUsdn = convertWavesToNeutrino(reserve, currentPrice)
262265 let neutrinoSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId))
263266 let surplus = (reservesInUsdn - neutrinoSupply)
264267 let deficit = (neutrinoSupply - reservesInUsdn)
265268 let surplusPercent = if ((neutrinoSupply == 0))
266269 then 0
267270 else (fraction(surplus, PAULI, neutrinoSupply) * 100)
268271 let BR = if ((neutrinoSupply == 0))
269272 then 0
270273 else fraction(reservesInUsdn, PAULI, neutrinoSupply)
271274 let nsbtSupplyMAX = value(assetInfo(nsbtAssetId)).quantity
272275 let nsbtSupply = (nsbtSupplyMAX - assetBalance(auctionContract, nsbtAssetId))
273276 $Tuple2(nil, [currentPrice, neutrinoLockedBalance, wavesLockedBalance, reserve, reservesInUsdn, neutrinoSupply, surplus, surplusPercent, BR, nsbtSupply, nsbtSupplyMAX])
274277 }
275278
276279
277280
278281 @Callable(i)
279282 func getUnstakeComissionAmountREADONLY (amount,startHeight,halfLife) = $Tuple2(nil, fraction(amount, pow(2, 0, fraction(-((height - startHeight)), MULT, halfLife), 8, 8, HALFUP), MULT))
280283
281284
282285
283286 @Callable(i)
284287 func mergeStakesREADONLY (amount1,height1,amount2,height2,halfLife) = {
285288 let w = fraction(amount2, pow(2, 0, fraction((height2 - height1), MULT, halfLife), 8, 8, HALFUP), MULT)
286289 let v = fraction((amount1 + amount2), MULT, (amount1 + w))
287290 $Tuple2(nil, (height1 + ((HALF8 - (halfLife * log(v, 8, 2, 0, 8, HALFUP))) / MULT)))
288291 }
289292
290293
294+@Verifier(tx)
295+func verify () = {
296+ let pubKeyAdminsList = ["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"]
297+ let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0])))
298+ then 1
299+ else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1])))
300+ then 1
301+ else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2])))
302+ then 1
303+ else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3])))
304+ then 2
305+ else 0))
306+ (count >= 3)
307+ }
308+

github/deemru/w8io/026f985 
50.11 ms