tx · 8t7P7J53q6p5Ktr38CWp5cxA5cMEKZgMiP93G9yfKpkH

3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi:  -0.04000000 Waves

2022.07.01 23:38 [2121074] smart account 3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi > SELF 0.00000000 Waves

{ "type": 13, "id": "8t7P7J53q6p5Ktr38CWp5cxA5cMEKZgMiP93G9yfKpkH", "fee": 4000000, "feeAssetId": null, "timestamp": 1656707907672, "version": 1, "sender": "3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi", "senderPublicKey": "4qGVXRFATZNzo2RZZ5UYHXojGyJgSRBwtgJcCU8rJe5A", "proofs": [ "5vWUpSASftDfRCoU6AwhvyHZMAdezY8FiUhnY9tVsWw6NvbkFgaocMoauyp6RFfsctNo79keCopbB8oXGYwNaBrL", "5KWmKH2WCGYWRLjYqjYAS646WFpqBKnP4NPv4ZPzCNsr1K5ZMDXYTpqMBjiXxSDwDHB86i7ZGpJNaZ8f5zpWZB6F", "5Wfu3ALvZWvBnNjKNRmvpQT6A3cDGqW2K3m9mLTMpA312ShkC81kDe1atyiT1rdgKtA29QZaZa9u53JUadAimh2b" ], "script": "base64:AAIFAAAAAAAAADkIAhIFCgMICAESAwoBARIHCgUBAQEBARIDCgEBEgQKAgECEgMKAQESABIFCgMBAQESBwoFAQEBAQEAAABCAAAAAAtyZXZpc2lvbk51bQIAAAAAAAAAAAlNVUxUU0NBTEUAAAAAAAAAAAgAAAAAB1NDQUxFMTYAAAAAAAAAABAAAAAAA1NFUAIAAAACX18AAAAABUhBTEY4AAAAAAAC+vCAAAAAAAhFVUxFUlgxNgkAATYAAAABAABgkqET2NV0AAAAAARUV09YCQABNgAAAAEAAAAAAAAAAAIAAAAABU1VTFQ2AAAAAAAAD0JAAAAAAAZNVUxUWDYJAAE2AAAAAQAAAAAAAA9CQAAAAAAFTVVMVDgAAAAAAAX14QAAAAAABk1VTFRYOAkAATYAAAABAAAAAAAF9eEAAAAAAAdNVU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ACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAADAAAAAAAAAAACAAAAAAAAAAAACQAAZwAAAAIFAAAABWNvdW50AAAAAAAAAAADW4w/9Q==", "chainId": 84, "height": 2121074, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BiJZqwsb8TzNFBkn62N2iP3H3Lh9RsKrcqwrpvPnkwfK Next: BA5Pkt9JZmSJNHoeBr5W2pa6q26a4wZkC5gnvtMWsWYw Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let revisionNum = "96200842ae4031398fba18a06b8c9624a0d43cf0"
5-
6-let WAVELET = 100000000
7-
8-let PAULI = 1000000
9-
10-let BIGPAULI = toBigInt(1000000)
11-
12-let PRICELET = 1000000
13-
14-let MULT = 100000000
15-
16-let BIGMULT16 = toBigInt(10000000000000000)
4+let revisionNum = ""
175
186 let MULTSCALE = 8
197
2311
2412 let HALF8 = 50000000
2513
26-let EULERNUMBER = toBigInt(27182818284590452)
14+let EULERX16 = toBigInt(27182818284590452)
2715
28-let scale6 = 1000000
16+let TWOX = toBigInt(2)
2917
30-let scale6BigInt = toBigInt(1000000)
18+let MULT6 = 1000000
3119
32-let scale8BigInt = toBigInt(100000000)
20+let MULTX6 = toBigInt(1000000)
3321
34-let scale10BigInt = toBigInt(10000000000)
22+let MULT8 = 100000000
23+
24+let MULTX8 = toBigInt(100000000)
25+
26+let MULTX10 = toBigInt(10000000000)
27+
28+let MULTX16 = toBigInt(10000000000000000)
29+
30+let WAVESID = fromBase58String("WAVES")
3531
3632 let kResultIdxA = 0
3733
9086 func keyContolContract () = "control_contract"
9187
9288
93-func keyBondAssetId () = "bond_asset_id"
89+func keyNsbtAssetId () = "bond_asset_id"
90+
91+
92+func keySurfAssetId () = "surf_asset_id"
9493
9594
9695 func keyBalanceLocked () = "balance_lock_"
126125 func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
127126
128127
129-func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI)
128+func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price)
130129
131130
132-func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET)
131+func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8)
133132
134133
135-func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), BIGMULT16, toBigInt(origScaleMult))
134+func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULTX16, toBigInt(origScaleMult))
136135
137136
138-func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), BIGMULT16))
137+func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULTX16))
139138
140139
141140 func asAnyList (val) = match val {
172171
173172 let neutrinoAssetId = fromBase58String(getStringOrFail(neutrinoContract, keyNeutrinoAssetId()))
174173
175-let nsbtAssetId = fromBase58String(getStringValue(neutrinoContract, keyBondAssetId()))
174+let nsbtAssetId = fromBase58String(getStringValue(neutrinoContract, keyNsbtAssetId()))
175+
176+let surfAssetId = fromBase58String(getStringValue(auctionContract, keySurfAssetId()))
176177
177178 @Callable(i)
178179 func constructor (neutrinoAddress,nsbtLockAddress,swapAmountAParam) = if ((i.caller != this))
185186 func calcSwapLimitREADONLY (gNsbtAmount) = {
186187 let limitParamA = toBigInt(getIntOrFail(this, keySwapAmountAParam()))
187188 let limitParamB = toBigInt(getIntOrFail(this, keySwapAmountBParam()))
188- let gNsbtAmountScale16 = toX16(gNsbtAmount, scale6)
189+ let gNsbtAmountScale16 = toX16(gNsbtAmount, MULT6)
189190 let limitPowPart = pow(gNsbtAmountScale16, 16, limitParamB, 16, 8, CEILING)
190- let limit = fraction(limitParamA, limitPowPart, scale10BigInt)
191+ let limit = fraction(limitParamA, limitPowPart, MULTX10)
191192 $Tuple2(nil, toInt(limit))
192193 }
193194
198199 let EXP = toBigInt(2718281)
199200 let EXPSCALE = 6
200201 let a = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_a"), 3)
201- let paulB = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_b"), ((3 * PAULI) / 10))
202+ let paulB = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_b"), ((3 * MULT6) / 10))
202203 let wReservesInUsdn = convertWavesToNeutrino(wRaw, price)
203- let multBR = fraction(wReservesInUsdn, MULT, uRaw)
204+ let multBR = fraction(wReservesInUsdn, MULT8, uRaw)
204205 if ((multBR > 10678564816))
205206 then throw("BR > 10678.564816% will overflow exponent")
206207 else {
207- let multPower = (a * (multBR - MULT))
208+ let multPower = (a * (multBR - MULT8))
208209 let multExpInPower = pow(EXP, EXPSCALE, toBigInt(multPower), MULTSCALE, SCALE16, DOWN)
209- let multK = fraction(toBigInt(paulB), multExpInPower, BIGPAULI)
210+ let multK = fraction(toBigInt(paulB), multExpInPower, MULTX6)
210211 $Tuple2(nil, [a, paulB, wReservesInUsdn, multBR, multPower, toString(multExpInPower), toString(multK)])
211212 }
212213 }
226227 let usdnPay = convertWavesToNeutrino(wavesPayRaw, price)
227228 let bigMaxNsbtSupply = toBigInt(mRaw)
228229 let bigNsbtSupply = toBigInt((mRaw - sRaw))
229- let step1 = fraction(toBigInt(usdnPay), BIGMULT16, multK)
230+ let step1 = fraction(toBigInt(usdnPay), MULTX16, multK)
230231 let step2 = fraction(step1, bigNsbtSupply, bigMaxNsbtSupply)
231232 let step3 = toInt(fraction(bigNsbtSupply, bigMaxNsbtSupply, (step2 + bigMaxNsbtSupply)))
232233 let nsbtAmountRaw = ((mRaw - sRaw) - step3)
233234 $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])
235+ }
236+
237+
238+
239+@Callable(i)
240+func surfFunctionREADONLY (amount,assetId) = {
241+ let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil))
242+ let price = asInt(neutrinoMetrics[nMetricIdxPrice])
243+ let priceBig = toBigInt(price)
244+ let reserve = asInt(neutrinoMetrics[nMetricIdxReserve])
245+ let reserveBig = toBigInt(reserve)
246+ let supply = asInt(neutrinoMetrics[nMetricIdxUsdnSupply])
247+ let supplyBig = toBigInt(supply)
248+ let BR = asInt(neutrinoMetrics[nMetricIdxBR])
249+ if ((BR >= MULT6))
250+ then throw((("BR = " + toString(BR)) + ", cannot buy SURF"))
251+ else {
252+ let maxWavesPay = (fraction(supply, MULT8, price) - reserve)
253+ let maxUsdnPay = (supply - fraction(reserve, price, MULT8))
254+ let useAmount = if ((assetId == neutrinoAssetId))
255+ then if ((amount > maxUsdnPay))
256+ then maxUsdnPay
257+ else amount
258+ else if ((assetId == WAVESID))
259+ then if ((amount > maxWavesPay))
260+ then maxWavesPay
261+ else amount
262+ else 0
263+ let amountBig = toBigInt(useAmount)
264+ if ((assetId == neutrinoAssetId))
265+ then $Tuple2(nil, [toInt(fraction(fraction(amountBig, MULTX8, priceBig), (supplyBig - (amountBig / TWOX)), reserveBig)), 0, useAmount, reserve, supply, BR, reserve, (supply - useAmount), fraction(convertWavesToNeutrino(reserve, price), MULT6, (supply - useAmount)), 0, (amount - useAmount)])
266+ else if ((assetId == WAVESID))
267+ then $Tuple2(nil, [toInt(fraction(supplyBig, log(fraction((reserveBig + amountBig), MULTX16, reserveBig), 16, EULERX16, 16, 16, HALFUP), MULTX16)), useAmount, 0, reserve, supply, BR, (reserve + useAmount), supply, fraction(convertWavesToNeutrino((reserve + useAmount), price), MULT6, supply), (amount - useAmount), 0])
268+ else throw("Unsupported asset")
269+ }
234270 }
235271
236272
245281 let mRaw = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply])
246282 let kCalcArray = asAnyList(invoke(this, "calculateKREADONLY", [wRaw, uRaw, price, mRaw, sRaw], nil))
247283 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)
284+ let multStep1X16 = fraction(toBigInt(mRaw), MULTX16, toBigInt((mRaw - sRaw)))
285+ let multStep2X16 = fraction(multStep1X16, multStep1X16, MULTX16)
286+ let multNsbt2usdnPriceX16 = fraction(multKX16, multStep2X16, MULTX16)
287+ let nsbt2usdnPrice = toInt(fraction(multNsbt2usdnPriceX16, toBigInt(MULT6), MULTX16))
288+ let nsbt2wavesPrice = fraction(nsbt2usdnPrice, MULT6, price)
253289 $Tuple2(nil, [nsbt2usdnPrice, nsbt2wavesPrice])
254290 }
255291
267303 let deficit = (neutrinoSupply - reservesInUsdn)
268304 let surplusPercent = if ((neutrinoSupply == 0))
269305 then 0
270- else (fraction(surplus, PAULI, neutrinoSupply) * 100)
306+ else (fraction(surplus, MULT6, neutrinoSupply) * 100)
271307 let BR = if ((neutrinoSupply == 0))
272308 then 0
273- else fraction(reservesInUsdn, PAULI, neutrinoSupply)
309+ else fraction(reservesInUsdn, MULT6, neutrinoSupply)
274310 let nsbtSupplyMAX = value(assetInfo(nsbtAssetId)).quantity
275311 let nsbtSupply = (nsbtSupplyMAX - assetBalance(auctionContract, nsbtAssetId))
276312 $Tuple2(nil, [currentPrice, neutrinoLockedBalance, wavesLockedBalance, reserve, reservesInUsdn, neutrinoSupply, surplus, surplusPercent, BR, nsbtSupply, nsbtSupplyMAX])
279315
280316
281317 @Callable(i)
282-func getUnstakeComissionAmountREADONLY (amount,startHeight,halfLife) = $Tuple2(nil, fraction(amount, pow(2, 0, fraction(-((height - startHeight)), MULT, halfLife), 8, 8, HALFUP), MULT))
318+func getUnstakeComissionAmountREADONLY (amount,startHeight,halfLife) = $Tuple2(nil, fraction(amount, pow(2, 0, fraction(-((height - startHeight)), MULT8, halfLife), 8, 8, HALFUP), MULT8))
283319
284320
285321
286322 @Callable(i)
287323 func mergeStakesREADONLY (amount1,height1,amount2,height2,halfLife) = {
288- let w = fraction(amount2, pow(2, 0, fraction((height2 - height1), MULT, halfLife), 8, 8, HALFUP), MULT)
289- let v = fraction((amount1 + amount2), MULT, (amount1 + w))
290- $Tuple2(nil, (height1 + ((HALF8 - (halfLife * log(v, 8, 2, 0, 8, HALFUP))) / MULT)))
324+ let w = fraction(amount2, pow(2, 0, fraction((height2 - height1), MULT8, halfLife), 8, 8, HALFUP), MULT8)
325+ let v = fraction((amount1 + amount2), MULT8, (amount1 + w))
326+ $Tuple2(nil, (height1 + ((HALF8 - (halfLife * log(v, 8, 2, 0, 8, HALFUP))) / MULT8)))
291327 }
292328
293329
294330 @Verifier(tx)
295331 func verify () = {
296- let pubKeyAdminsList = ["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"]
332+ let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"], SEP)
333+ let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP)
297334 let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0])))
298335 then 1
299336 else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1])))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let revisionNum = "96200842ae4031398fba18a06b8c9624a0d43cf0"
5-
6-let WAVELET = 100000000
7-
8-let PAULI = 1000000
9-
10-let BIGPAULI = toBigInt(1000000)
11-
12-let PRICELET = 1000000
13-
14-let MULT = 100000000
15-
16-let BIGMULT16 = toBigInt(10000000000000000)
4+let revisionNum = ""
175
186 let MULTSCALE = 8
197
208 let SCALE16 = 16
219
2210 let SEP = "__"
2311
2412 let HALF8 = 50000000
2513
26-let EULERNUMBER = toBigInt(27182818284590452)
14+let EULERX16 = toBigInt(27182818284590452)
2715
28-let scale6 = 1000000
16+let TWOX = toBigInt(2)
2917
30-let scale6BigInt = toBigInt(1000000)
18+let MULT6 = 1000000
3119
32-let scale8BigInt = toBigInt(100000000)
20+let MULTX6 = toBigInt(1000000)
3321
34-let scale10BigInt = toBigInt(10000000000)
22+let MULT8 = 100000000
23+
24+let MULTX8 = toBigInt(100000000)
25+
26+let MULTX10 = toBigInt(10000000000)
27+
28+let MULTX16 = toBigInt(10000000000000000)
29+
30+let WAVESID = fromBase58String("WAVES")
3531
3632 let kResultIdxA = 0
3733
3834 let kResultIdxPaulB = 1
3935
4036 let kResultIdxWReservesInUsdn = 2
4137
4238 let kResultIdxMultBR = 3
4339
4440 let kResultIdxMultPower = 4
4541
4642 let kResultIdxMultExpInPowerStr = 5
4743
4844 let kResultIdxMultKStr = 6
4945
5046 let nMetricIdxPrice = 0
5147
5248 let nMetricIdxUsdnLockedBalance = 1
5349
5450 let nMetricIdxWavesLockedBalance = 2
5551
5652 let nMetricIdxReserve = 3
5753
5854 let nMetricIdxReserveInUsdn = 4
5955
6056 let nMetricIdxUsdnSupply = 5
6157
6258 let nMetricIdxSurplus = 6
6359
6460 let nMetricIdxSurplusPercent = 7
6561
6662 let nMetricIdxBR = 8
6763
6864 let nMetricIdxNsbtSupply = 9
6965
7066 let nMetricIdxMaxNsbtSupply = 10
7167
7268 func keyNeutrinoAddress () = "%s%s__config__neutrinoAddress"
7369
7470
7571 func keySwapAmountAParam () = "%s%s__config__swapAParam"
7672
7773
7874 func keySwapAmountBParam () = "%s%s__config__swapBParam"
7975
8076
8177 func keyNeutrinoAssetId () = "neutrino_asset_id"
8278
8379
8480 func keyLiquidationContractAddress () = "liquidation_contract"
8581
8682
8783 func keyAuctionContract () = "auction_contract"
8884
8985
9086 func keyContolContract () = "control_contract"
9187
9288
93-func keyBondAssetId () = "bond_asset_id"
89+func keyNsbtAssetId () = "bond_asset_id"
90+
91+
92+func keySurfAssetId () = "surf_asset_id"
9493
9594
9695 func keyBalanceLocked () = "balance_lock_"
9796
9897
9998 func keyWavesLockedBalance () = (keyBalanceLocked() + "waves")
10099
101100
102101 func keyNeutrinoLockedBalance () = (keyBalanceLocked() + "neutrino")
103102
104103
105104 func swapsTimeframeKEY () = "swaps_timeframe"
106105
107106
108107 func keyUserLastQuickSwapHeight (userAddress) = makeString(["%s%s", "userLastQuickSwapHeight", userAddress], SEP)
109108
110109
111110 func keyQuickSwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "quickSwapUserSpentInPeriod", userAddress], SEP)
112111
113112
114113 func keyPrice () = "price"
115114
116115
117116 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
118117
119118
120119 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
121120
122121
123122 func getNumberByKey (address,key) = valueOrElse(getInteger(address, key), 0)
124123
125124
126125 func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
127126
128127
129-func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI)
128+func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price)
130129
131130
132-func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET)
131+func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8)
133132
134133
135-func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), BIGMULT16, toBigInt(origScaleMult))
134+func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULTX16, toBigInt(origScaleMult))
136135
137136
138-func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), BIGMULT16))
137+func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULTX16))
139138
140139
141140 func asAnyList (val) = match val {
142141 case valAnyLyst: List[Any] =>
143142 valAnyLyst
144143 case _ =>
145144 throw("fail to cast into List[Any]")
146145 }
147146
148147
149148 func asInt (val) = match val {
150149 case valInt: Int =>
151150 valInt
152151 case _ =>
153152 throw("fail to cast into Int")
154153 }
155154
156155
157156 func asString (val) = match val {
158157 case valStr: String =>
159158 valStr
160159 case _ =>
161160 throw("fail to cast into String")
162161 }
163162
164163
165164 let neutrinoContract = addressFromStringValue(getStringOrFail(this, keyNeutrinoAddress()))
166165
167166 let controlContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyContolContract()))
168167
169168 let auctionContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyAuctionContract()))
170169
171170 let liquidationContract = addressFromStringValue(getStringOrFail(neutrinoContract, keyLiquidationContractAddress()))
172171
173172 let neutrinoAssetId = fromBase58String(getStringOrFail(neutrinoContract, keyNeutrinoAssetId()))
174173
175-let nsbtAssetId = fromBase58String(getStringValue(neutrinoContract, keyBondAssetId()))
174+let nsbtAssetId = fromBase58String(getStringValue(neutrinoContract, keyNsbtAssetId()))
175+
176+let surfAssetId = fromBase58String(getStringValue(auctionContract, keySurfAssetId()))
176177
177178 @Callable(i)
178179 func constructor (neutrinoAddress,nsbtLockAddress,swapAmountAParam) = if ((i.caller != this))
179180 then throw("not authorized")
180181 else [StringEntry(keyNeutrinoAddress(), neutrinoAddress), IntegerEntry(keySwapAmountAParam(), swapAmountAParam)]
181182
182183
183184
184185 @Callable(i)
185186 func calcSwapLimitREADONLY (gNsbtAmount) = {
186187 let limitParamA = toBigInt(getIntOrFail(this, keySwapAmountAParam()))
187188 let limitParamB = toBigInt(getIntOrFail(this, keySwapAmountBParam()))
188- let gNsbtAmountScale16 = toX16(gNsbtAmount, scale6)
189+ let gNsbtAmountScale16 = toX16(gNsbtAmount, MULT6)
189190 let limitPowPart = pow(gNsbtAmountScale16, 16, limitParamB, 16, 8, CEILING)
190- let limit = fraction(limitParamA, limitPowPart, scale10BigInt)
191+ let limit = fraction(limitParamA, limitPowPart, MULTX10)
191192 $Tuple2(nil, toInt(limit))
192193 }
193194
194195
195196
196197 @Callable(i)
197198 func calculateKREADONLY (wRaw,uRaw,price,mRaw,sRaw) = {
198199 let EXP = toBigInt(2718281)
199200 let EXPSCALE = 6
200201 let a = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_a"), 3)
201- let paulB = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_b"), ((3 * PAULI) / 10))
202+ let paulB = valueOrElse(getInteger(auctionContract, "nsbtCurveParam_b"), ((3 * MULT6) / 10))
202203 let wReservesInUsdn = convertWavesToNeutrino(wRaw, price)
203- let multBR = fraction(wReservesInUsdn, MULT, uRaw)
204+ let multBR = fraction(wReservesInUsdn, MULT8, uRaw)
204205 if ((multBR > 10678564816))
205206 then throw("BR > 10678.564816% will overflow exponent")
206207 else {
207- let multPower = (a * (multBR - MULT))
208+ let multPower = (a * (multBR - MULT8))
208209 let multExpInPower = pow(EXP, EXPSCALE, toBigInt(multPower), MULTSCALE, SCALE16, DOWN)
209- let multK = fraction(toBigInt(paulB), multExpInPower, BIGPAULI)
210+ let multK = fraction(toBigInt(paulB), multExpInPower, MULTX6)
210211 $Tuple2(nil, [a, paulB, wReservesInUsdn, multBR, multPower, toString(multExpInPower), toString(multK)])
211212 }
212213 }
213214
214215
215216
216217 @Callable(i)
217218 func curveFunctionREADONLY (wavesPayRaw) = {
218219 let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil))
219220 let price = asInt(neutrinoMetrics[nMetricIdxPrice])
220221 let wRaw = asInt(neutrinoMetrics[nMetricIdxReserve])
221222 let uRaw = asInt(neutrinoMetrics[nMetricIdxUsdnSupply])
222223 let sRaw = asInt(neutrinoMetrics[nMetricIdxNsbtSupply])
223224 let mRaw = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply])
224225 let kCalcArray = asAnyList(invoke(this, "calculateKREADONLY", [wRaw, uRaw, price, mRaw, sRaw], nil))
225226 let multK = parseBigIntValue(asString(kCalcArray[kResultIdxMultKStr]))
226227 let usdnPay = convertWavesToNeutrino(wavesPayRaw, price)
227228 let bigMaxNsbtSupply = toBigInt(mRaw)
228229 let bigNsbtSupply = toBigInt((mRaw - sRaw))
229- let step1 = fraction(toBigInt(usdnPay), BIGMULT16, multK)
230+ let step1 = fraction(toBigInt(usdnPay), MULTX16, multK)
230231 let step2 = fraction(step1, bigNsbtSupply, bigMaxNsbtSupply)
231232 let step3 = toInt(fraction(bigNsbtSupply, bigMaxNsbtSupply, (step2 + bigMaxNsbtSupply)))
232233 let nsbtAmountRaw = ((mRaw - sRaw) - step3)
233234 $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])
235+ }
236+
237+
238+
239+@Callable(i)
240+func surfFunctionREADONLY (amount,assetId) = {
241+ let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil))
242+ let price = asInt(neutrinoMetrics[nMetricIdxPrice])
243+ let priceBig = toBigInt(price)
244+ let reserve = asInt(neutrinoMetrics[nMetricIdxReserve])
245+ let reserveBig = toBigInt(reserve)
246+ let supply = asInt(neutrinoMetrics[nMetricIdxUsdnSupply])
247+ let supplyBig = toBigInt(supply)
248+ let BR = asInt(neutrinoMetrics[nMetricIdxBR])
249+ if ((BR >= MULT6))
250+ then throw((("BR = " + toString(BR)) + ", cannot buy SURF"))
251+ else {
252+ let maxWavesPay = (fraction(supply, MULT8, price) - reserve)
253+ let maxUsdnPay = (supply - fraction(reserve, price, MULT8))
254+ let useAmount = if ((assetId == neutrinoAssetId))
255+ then if ((amount > maxUsdnPay))
256+ then maxUsdnPay
257+ else amount
258+ else if ((assetId == WAVESID))
259+ then if ((amount > maxWavesPay))
260+ then maxWavesPay
261+ else amount
262+ else 0
263+ let amountBig = toBigInt(useAmount)
264+ if ((assetId == neutrinoAssetId))
265+ then $Tuple2(nil, [toInt(fraction(fraction(amountBig, MULTX8, priceBig), (supplyBig - (amountBig / TWOX)), reserveBig)), 0, useAmount, reserve, supply, BR, reserve, (supply - useAmount), fraction(convertWavesToNeutrino(reserve, price), MULT6, (supply - useAmount)), 0, (amount - useAmount)])
266+ else if ((assetId == WAVESID))
267+ then $Tuple2(nil, [toInt(fraction(supplyBig, log(fraction((reserveBig + amountBig), MULTX16, reserveBig), 16, EULERX16, 16, 16, HALFUP), MULTX16)), useAmount, 0, reserve, supply, BR, (reserve + useAmount), supply, fraction(convertWavesToNeutrino((reserve + useAmount), price), MULT6, supply), (amount - useAmount), 0])
268+ else throw("Unsupported asset")
269+ }
234270 }
235271
236272
237273
238274 @Callable(i)
239275 func calcContractNsbtPriceSYSREADONLY (nsbtSupplyDELTA) = {
240276 let neutrinoMetrics = asAnyList(invoke(this, "calcNeutinoMetricsREADONLY", nil, nil))
241277 let price = asInt(neutrinoMetrics[nMetricIdxPrice])
242278 let wRaw = asInt(neutrinoMetrics[nMetricIdxReserve])
243279 let uRaw = (asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) - nsbtSupplyDELTA)
244280 let sRaw = (asInt(neutrinoMetrics[nMetricIdxNsbtSupply]) + nsbtSupplyDELTA)
245281 let mRaw = asInt(neutrinoMetrics[nMetricIdxMaxNsbtSupply])
246282 let kCalcArray = asAnyList(invoke(this, "calculateKREADONLY", [wRaw, uRaw, price, mRaw, sRaw], nil))
247283 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)
284+ let multStep1X16 = fraction(toBigInt(mRaw), MULTX16, toBigInt((mRaw - sRaw)))
285+ let multStep2X16 = fraction(multStep1X16, multStep1X16, MULTX16)
286+ let multNsbt2usdnPriceX16 = fraction(multKX16, multStep2X16, MULTX16)
287+ let nsbt2usdnPrice = toInt(fraction(multNsbt2usdnPriceX16, toBigInt(MULT6), MULTX16))
288+ let nsbt2wavesPrice = fraction(nsbt2usdnPrice, MULT6, price)
253289 $Tuple2(nil, [nsbt2usdnPrice, nsbt2wavesPrice])
254290 }
255291
256292
257293
258294 @Callable(i)
259295 func calcNeutinoMetricsREADONLY () = {
260296 let currentPrice = getIntegerValue(controlContract, keyPrice())
261297 let neutrinoLockedBalance = valueOrElse(getInteger(neutrinoContract, keyNeutrinoLockedBalance()), 0)
262298 let wavesLockedBalance = valueOrElse(getInteger(neutrinoContract, keyWavesLockedBalance()), 0)
263299 let reserve = (wavesBalance(neutrinoContract).regular - wavesLockedBalance)
264300 let reservesInUsdn = convertWavesToNeutrino(reserve, currentPrice)
265301 let neutrinoSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId))
266302 let surplus = (reservesInUsdn - neutrinoSupply)
267303 let deficit = (neutrinoSupply - reservesInUsdn)
268304 let surplusPercent = if ((neutrinoSupply == 0))
269305 then 0
270- else (fraction(surplus, PAULI, neutrinoSupply) * 100)
306+ else (fraction(surplus, MULT6, neutrinoSupply) * 100)
271307 let BR = if ((neutrinoSupply == 0))
272308 then 0
273- else fraction(reservesInUsdn, PAULI, neutrinoSupply)
309+ else fraction(reservesInUsdn, MULT6, neutrinoSupply)
274310 let nsbtSupplyMAX = value(assetInfo(nsbtAssetId)).quantity
275311 let nsbtSupply = (nsbtSupplyMAX - assetBalance(auctionContract, nsbtAssetId))
276312 $Tuple2(nil, [currentPrice, neutrinoLockedBalance, wavesLockedBalance, reserve, reservesInUsdn, neutrinoSupply, surplus, surplusPercent, BR, nsbtSupply, nsbtSupplyMAX])
277313 }
278314
279315
280316
281317 @Callable(i)
282-func getUnstakeComissionAmountREADONLY (amount,startHeight,halfLife) = $Tuple2(nil, fraction(amount, pow(2, 0, fraction(-((height - startHeight)), MULT, halfLife), 8, 8, HALFUP), MULT))
318+func getUnstakeComissionAmountREADONLY (amount,startHeight,halfLife) = $Tuple2(nil, fraction(amount, pow(2, 0, fraction(-((height - startHeight)), MULT8, halfLife), 8, 8, HALFUP), MULT8))
283319
284320
285321
286322 @Callable(i)
287323 func mergeStakesREADONLY (amount1,height1,amount2,height2,halfLife) = {
288- let w = fraction(amount2, pow(2, 0, fraction((height2 - height1), MULT, halfLife), 8, 8, HALFUP), MULT)
289- let v = fraction((amount1 + amount2), MULT, (amount1 + w))
290- $Tuple2(nil, (height1 + ((HALF8 - (halfLife * log(v, 8, 2, 0, 8, HALFUP))) / MULT)))
324+ let w = fraction(amount2, pow(2, 0, fraction((height2 - height1), MULT8, halfLife), 8, 8, HALFUP), MULT8)
325+ let v = fraction((amount1 + amount2), MULT8, (amount1 + w))
326+ $Tuple2(nil, (height1 + ((HALF8 - (halfLife * log(v, 8, 2, 0, 8, HALFUP))) / MULT8)))
291327 }
292328
293329
294330 @Verifier(tx)
295331 func verify () = {
296- let pubKeyAdminsList = ["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"]
332+ let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"], SEP)
333+ let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP)
297334 let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0])))
298335 then 1
299336 else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1])))
300337 then 1
301338 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2])))
302339 then 1
303340 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3])))
304341 then 2
305342 else 0))
306343 (count >= 3)
307344 }
308345

github/deemru/w8io/026f985 
61.94 ms