tx · EAWBESPVWVrG6ZnmYRcgBJfuq1dAHLFc2wUR69FJGdJD 3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd: -0.01400000 Waves 2022.03.03 00:41 [1946913] smart account 3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd > SELF 0.00000000 Waves
{ "type": 13, "id": "EAWBESPVWVrG6ZnmYRcgBJfuq1dAHLFc2wUR69FJGdJD", "fee": 1400000, "feeAssetId": null, "timestamp": 1646257328585, "version": 1, "sender": "3N5NAftzfcw3gAt8nc35bNr9UdPTVgC81fd", "senderPublicKey": "CdnTmMHxT68Qa4MtHEnAiUhsdKTi2YkHPGn92ThinVNt", "proofs": [ "3pA8i3UmyqFocFWjP2F8g6rHWoKig8eXjvBXHfCo3ERn4LqJKEFDSEe8Vxc2VDxj6ari9fhkDCytKSDXZLYKJUi8", "4WCaCj6pw3FQVHypdDgU2oo49QzboHDitcXChhtHWgMKozbYHNL77rtDdP7Jyo5QkixzbxeKx1HFpaytdfU61nEH", "2PmjZv3penn58mM6pqLE4UXf4Hvf1FzbKQ9zBSxezeaAEd8GrdMCrK7cHd7eGiLCMun16wWoQ3sP9ycq1cu48XyW" ], "script": "base64:AAIFAAAAAAAAAAkIAhIAEgMKAQgAAABBAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkCAAAAAAEAAAAWZ2V0Qm9vbEJ5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQbAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5BwEAAAAYZ2V0U3RyaW5nQnlBZGRyZXNzQW5kS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AAAgAAAAAAAAAAAAkAAGcAAAACBQAAAAVjb3VudAAAAAAAAAAAA5ciyOs=", "chainId": 84, "height": 1946913, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HT1SWdXQyF1rUVTTxivueGAx5BAidt7SyKFXPFRAnfTh Next: 55tTXqErqwjBKRGrwM5AXWAFqjf3Ps8PsGJJgSRvJmuL Diff:
Old | New | Differences | |
---|---|---|---|
177 | 177 | func orderData (orderId,totalWavelets,filledWavelets,owner,status,roi,price,currentPrice) = [IntegerEntry(getOrderPriceKey(orderId), price), IntegerEntry(getOrderTotalKey(orderId), totalWavelets), IntegerEntry(getOrderFilledTotalKey(orderId), filledWavelets), StringEntry(getOrderOwnerKey(orderId), owner), IntegerEntry(getOrderHeightKey(orderId), height), StringEntry(getOrderStatusKey(orderId), status), IntegerEntry(("debug_order_currentPrice_" + orderId), currentPrice), IntegerEntry(getRoiByOrderIdKey(orderId), roi)] | |
178 | 178 | ||
179 | 179 | ||
180 | - | func toStr (name,curveResult) = (((((((((((((((((((((((((((((((((((name + "[nsbtAmountRaw=") + toString(asInt(curveResult[0]))) + " usdnPayment=") + toString(asInt(curveResult[1]))) + " wRaw=") + toString(asInt(curveResult[2]))) + " uRaw=") + toString(asInt(curveResult[3]))) + " mRaw=") + toString(asInt(curveResult[4]))) + " sRaw=") + toString(asInt(curveResult[5]))) + " nsbtCurveParam_a=") + toString(asInt(curveResult[6]))) + " nsbtCurveParam_b=") + toString(asInt(curveResult[7]))) + " wReservesInUsdn=") + toString(asInt(curveResult[8]))) + " price=") + toString(asInt(curveResult[9]))) + " multBR=") + toString(asInt(curveResult[10]))) + " multPower=") + toString(asInt(curveResult[11]))) + " multExpInPower=") + | |
180 | + | func toStr (name,curveResult) = (((((((((((((((((((((((((((((((((((name + "[nsbtAmountRaw=") + toString(asInt(curveResult[0]))) + " usdnPayment=") + toString(asInt(curveResult[1]))) + " wRaw=") + toString(asInt(curveResult[2]))) + " uRaw=") + toString(asInt(curveResult[3]))) + " mRaw=") + toString(asInt(curveResult[4]))) + " sRaw=") + toString(asInt(curveResult[5]))) + " nsbtCurveParam_a=") + toString(asInt(curveResult[6]))) + " nsbtCurveParam_b=") + toString(asInt(curveResult[7]))) + " wReservesInUsdn=") + toString(asInt(curveResult[8]))) + " price=") + toString(asInt(curveResult[9]))) + " multBR=") + toString(asInt(curveResult[10]))) + " multPower=") + toString(asInt(curveResult[11]))) + " multExpInPower=") + asString(curveResult[12])) + " multK=") + asString(curveResult[13])) + " step1=") + asString(curveResult[14])) + " step2=") + asString(curveResult[15])) + " step3=") + asString(curveResult[16])) + "]") | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | @Callable(i) | |
214 | 214 | let roi = 0 | |
215 | 215 | let amountLeased = invoke(neutrinoContract, "acceptWaves", nil, i.payments) | |
216 | 216 | if ((amountLeased == amountLeased)) | |
217 | - | then if (true) | |
218 | - | then throw(toStr("curveResult", curveResult)) | |
219 | - | else $Tuple2((orderData(toBase58String(i.transactionId), pmtAmount, pmtAmount, toString(ownerAddress), FILLED, roi, nsbt2WavesPriceRaw, currentPrice) ++ [ScriptTransfer(ownerAddress, nsbtAmount, nsbtAssetId), StringEntry("debug_curveResult", toStr("curveResult", curveResult))]), nsbtAmount) | |
217 | + | then $Tuple2((orderData(toBase58String(i.transactionId), pmtAmount, pmtAmount, toString(ownerAddress), FILLED, roi, nsbt2WavesPriceRaw, currentPrice) ++ [ScriptTransfer(ownerAddress, nsbtAmount, nsbtAssetId), StringEntry("debug_curveResult", toStr("curveResult", curveResult))]), nsbtAmount) | |
220 | 218 | else throw("Strict value is not equal to itself.") | |
221 | 219 | } | |
222 | 220 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func getBoolByAddressAndKey (address,key) = valueOrElse(getBoolean(address, key), false) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func getStringByAddressAndKey (address,key) = valueOrElse(getString(address, key), "") | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(address, key), 0) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func asAnyList (val) = match val { | |
20 | 20 | case valAnyLyst: List[Any] => | |
21 | 21 | valAnyLyst | |
22 | 22 | case _ => | |
23 | 23 | throw("fail to cast into List[Any]") | |
24 | 24 | } | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func asString (val) = match val { | |
28 | 28 | case valStr: String => | |
29 | 29 | valStr | |
30 | 30 | case _ => | |
31 | 31 | throw("fail to cast into String") | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func asInt (val) = match val { | |
36 | 36 | case valInt: Int => | |
37 | 37 | valInt | |
38 | 38 | case _ => | |
39 | 39 | throw("fail to cast into Int") | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | let WAVELET = 100000000 | |
44 | 44 | ||
45 | 45 | let PAULI = 1000000 | |
46 | 46 | ||
47 | 47 | let BIGPAULI = toBigInt(1000000) | |
48 | 48 | ||
49 | 49 | let PRICELET = 1000000 | |
50 | 50 | ||
51 | 51 | let MULT = 100000000 | |
52 | 52 | ||
53 | 53 | let BIGMULT16 = toBigInt(10000000000000000) | |
54 | 54 | ||
55 | 55 | let SCALE8 = 8 | |
56 | 56 | ||
57 | 57 | let SCALE16 = 16 | |
58 | 58 | ||
59 | 59 | let MINORDERTOTAL = (10 * WAVELET) | |
60 | 60 | ||
61 | 61 | let MAXROI = 95 | |
62 | 62 | ||
63 | 63 | let CANCELED = "canceled" | |
64 | 64 | ||
65 | 65 | let NEW = "new" | |
66 | 66 | ||
67 | 67 | let FILLED = "filled" | |
68 | 68 | ||
69 | 69 | let PriceKey = "price" | |
70 | 70 | ||
71 | 71 | let NsbtAssetIdKey = "bond_asset_id" | |
72 | 72 | ||
73 | 73 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
74 | 74 | ||
75 | 75 | let BalanceLockedkKey = "balance_lock_" | |
76 | 76 | ||
77 | 77 | let WavesLockedBalanceKey = (BalanceLockedkKey + "waves") | |
78 | 78 | ||
79 | 79 | let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino") | |
80 | 80 | ||
81 | 81 | let FirstOrderKey = "order_first" | |
82 | 82 | ||
83 | 83 | let MathContractKey = "math_contract" | |
84 | 84 | ||
85 | 85 | let MinWavesForNsbtBuyKey = "min_waves_nsbt_buy" | |
86 | 86 | ||
87 | 87 | func getRoiByOrderIdKey (orderId) = ("debug_order_roi_" + orderId) | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func getOrderPriceKey (orderId) = ("order_price_" + orderId) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func getOrderTotalKey (orderId) = ("order_total_" + orderId) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func getOrderOwnerKey (orderId) = ("order_owner_" + orderId) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func getOrderHeightKey (orderId) = ("order_height_" + orderId) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func getOrderStatusKey (orderId) = ("order_status_" + orderId) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func getPrevOrderKey (orderId) = ("order_prev_" + orderId) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func getNextOrderKey (orderId) = ("order_next_" + orderId) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func convertBondToWaves (amount,price) = convertNeutrinoToWaves(amount, price) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), BIGMULT16, toBigInt(origScaleMult)) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), BIGMULT16)) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | let neutrinoContract = Address(base58'3N9be2mwrA52WJho6DiesZkk4351GvpnWuj') | |
133 | 133 | ||
134 | 134 | let controlContract = Address(base58'3MrwvfA9VRYwhHy4NuWPQGdxCtZdhH4LMMa') | |
135 | 135 | ||
136 | 136 | let liquidationContract = Address(base58'3N24ZPUAMhFm76N3vbNiiDtFqfUnmBHTc5N') | |
137 | 137 | ||
138 | 138 | let mathContract = getStringByKey(MathContractKey) | |
139 | 139 | ||
140 | 140 | let neutrinoAssetId = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' | |
141 | 141 | ||
142 | 142 | let nsbtAssetId = base58'F3iaxzruFeKujfVfYSZEkejpjh67wmRfPCRHiNmWKp3Z' | |
143 | 143 | ||
144 | 144 | let isBlocked = getBoolByAddressAndKey(controlContract, "is_blocked") | |
145 | 145 | ||
146 | 146 | let minWavesAmountNsbtBuy = valueOrElse(getInteger(this, MinWavesForNsbtBuyKey), 10) | |
147 | 147 | ||
148 | 148 | let firstOrder = getStringByKey(FirstOrderKey) | |
149 | 149 | ||
150 | 150 | func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id)) | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id)) | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func getPrevOrder (id) = getStringByKey(getPrevOrderKey(id)) | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func getNextOrder (id) = getStringByKey(getNextOrderKey(id)) | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func getReversePrice (price) = ((PRICELET * PRICELET) / price) | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func calcNsbt2WavesPriceRaw (spentWavesRaw,receivedNsbtRaw) = fraction(spentWavesRaw, (PAULI * PRICELET), receivedNsbtRaw) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func orderData (orderId,totalWavelets,filledWavelets,owner,status,roi,price,currentPrice) = [IntegerEntry(getOrderPriceKey(orderId), price), IntegerEntry(getOrderTotalKey(orderId), totalWavelets), IntegerEntry(getOrderFilledTotalKey(orderId), filledWavelets), StringEntry(getOrderOwnerKey(orderId), owner), IntegerEntry(getOrderHeightKey(orderId), height), StringEntry(getOrderStatusKey(orderId), status), IntegerEntry(("debug_order_currentPrice_" + orderId), currentPrice), IntegerEntry(getRoiByOrderIdKey(orderId), roi)] | |
178 | 178 | ||
179 | 179 | ||
180 | - | func toStr (name,curveResult) = (((((((((((((((((((((((((((((((((((name + "[nsbtAmountRaw=") + toString(asInt(curveResult[0]))) + " usdnPayment=") + toString(asInt(curveResult[1]))) + " wRaw=") + toString(asInt(curveResult[2]))) + " uRaw=") + toString(asInt(curveResult[3]))) + " mRaw=") + toString(asInt(curveResult[4]))) + " sRaw=") + toString(asInt(curveResult[5]))) + " nsbtCurveParam_a=") + toString(asInt(curveResult[6]))) + " nsbtCurveParam_b=") + toString(asInt(curveResult[7]))) + " wReservesInUsdn=") + toString(asInt(curveResult[8]))) + " price=") + toString(asInt(curveResult[9]))) + " multBR=") + toString(asInt(curveResult[10]))) + " multPower=") + toString(asInt(curveResult[11]))) + " multExpInPower=") + | |
180 | + | func toStr (name,curveResult) = (((((((((((((((((((((((((((((((((((name + "[nsbtAmountRaw=") + toString(asInt(curveResult[0]))) + " usdnPayment=") + toString(asInt(curveResult[1]))) + " wRaw=") + toString(asInt(curveResult[2]))) + " uRaw=") + toString(asInt(curveResult[3]))) + " mRaw=") + toString(asInt(curveResult[4]))) + " sRaw=") + toString(asInt(curveResult[5]))) + " nsbtCurveParam_a=") + toString(asInt(curveResult[6]))) + " nsbtCurveParam_b=") + toString(asInt(curveResult[7]))) + " wReservesInUsdn=") + toString(asInt(curveResult[8]))) + " price=") + toString(asInt(curveResult[9]))) + " multBR=") + toString(asInt(curveResult[10]))) + " multPower=") + toString(asInt(curveResult[11]))) + " multExpInPower=") + asString(curveResult[12])) + " multK=") + asString(curveResult[13])) + " step1=") + asString(curveResult[14])) + " step2=") + asString(curveResult[15])) + " step3=") + asString(curveResult[16])) + "]") | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | @Callable(i) | |
184 | 184 | func buyNsbt () = { | |
185 | 185 | let pmt = value(i.payments[0]) | |
186 | 186 | let pmtAmount = pmt.amount | |
187 | 187 | let wavesPay = pmtAmount | |
188 | 188 | if (isBlocked) | |
189 | 189 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles") | |
190 | 190 | else if (isDefined(pmt.assetId)) | |
191 | 191 | then throw("can use waves only") | |
192 | 192 | else if (((minWavesAmountNsbtBuy * WAVELET) > pmtAmount)) | |
193 | 193 | then throw((("min " + toString(minWavesAmountNsbtBuy)) + " waves expected")) | |
194 | 194 | else { | |
195 | 195 | let ownerAddress = i.caller | |
196 | 196 | let neutrinoMetrics = asAnyList(invoke(addressFromStringValue(mathContract), "calcNeutinoMetricsMATH", nil, nil)) | |
197 | 197 | if ((neutrinoMetrics == neutrinoMetrics)) | |
198 | 198 | then { | |
199 | 199 | let currentPrice = asInt(neutrinoMetrics[0]) | |
200 | 200 | let reserve = asInt(neutrinoMetrics[3]) | |
201 | 201 | let neutrinoSupply = asInt(neutrinoMetrics[5]) | |
202 | 202 | let nsbtSupply = asInt(neutrinoMetrics[9]) | |
203 | 203 | let nsbtSupplyMAX = value(assetInfo(nsbtAssetId)).quantity | |
204 | 204 | let curveResult = asAnyList(invoke(addressFromStringValue(mathContract), "curveFunctionMATH", [reserve, neutrinoSupply, currentPrice, nsbtSupplyMAX, nsbtSupply, wavesPay], nil)) | |
205 | 205 | if ((curveResult == curveResult)) | |
206 | 206 | then { | |
207 | 207 | let nsbtAmount = asInt(curveResult[0]) | |
208 | 208 | if ((0 >= nsbtAmount)) | |
209 | 209 | then throw("nsbtAmount <= 0") | |
210 | 210 | else if ((wavesPay > (nsbtAmount * 9223372))) | |
211 | 211 | then throw(((("Nsbt2Waves price exceeds MAX_INT: " + toString(wavesPay)) + "/") + toString(nsbtAmount))) | |
212 | 212 | else { | |
213 | 213 | let nsbt2WavesPriceRaw = calcNsbt2WavesPriceRaw(wavesPay, nsbtAmount) | |
214 | 214 | let roi = 0 | |
215 | 215 | let amountLeased = invoke(neutrinoContract, "acceptWaves", nil, i.payments) | |
216 | 216 | if ((amountLeased == amountLeased)) | |
217 | - | then if (true) | |
218 | - | then throw(toStr("curveResult", curveResult)) | |
219 | - | else $Tuple2((orderData(toBase58String(i.transactionId), pmtAmount, pmtAmount, toString(ownerAddress), FILLED, roi, nsbt2WavesPriceRaw, currentPrice) ++ [ScriptTransfer(ownerAddress, nsbtAmount, nsbtAssetId), StringEntry("debug_curveResult", toStr("curveResult", curveResult))]), nsbtAmount) | |
217 | + | then $Tuple2((orderData(toBase58String(i.transactionId), pmtAmount, pmtAmount, toString(ownerAddress), FILLED, roi, nsbt2WavesPriceRaw, currentPrice) ++ [ScriptTransfer(ownerAddress, nsbtAmount, nsbtAssetId), StringEntry("debug_curveResult", toStr("curveResult", curveResult))]), nsbtAmount) | |
220 | 218 | else throw("Strict value is not equal to itself.") | |
221 | 219 | } | |
222 | 220 | } | |
223 | 221 | else throw("Strict value is not equal to itself.") | |
224 | 222 | } | |
225 | 223 | else throw("Strict value is not equal to itself.") | |
226 | 224 | } | |
227 | 225 | } | |
228 | 226 | ||
229 | 227 | ||
230 | 228 | ||
231 | 229 | @Callable(i) | |
232 | 230 | func cancelOrder (orderId) = { | |
233 | 231 | let owner = getOrderOwner(orderId) | |
234 | 232 | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
235 | 233 | let caller = toString(i.caller) | |
236 | 234 | let nextOrder = getNextOrder(orderId) | |
237 | 235 | let prevOrder = getPrevOrder(orderId) | |
238 | 236 | if ((getOrderStatus(orderId) != NEW)) | |
239 | 237 | then throw("invalid order status") | |
240 | 238 | else [StringEntry(FirstOrderKey, if ((firstOrder == orderId)) | |
241 | 239 | then nextOrder | |
242 | 240 | else firstOrder), StringEntry(getNextOrderKey(prevOrder), nextOrder), StringEntry(getPrevOrderKey(nextOrder), prevOrder), StringEntry(getOrderStatusKey(orderId), CANCELED), ScriptTransfer(i.caller, amount, unit)] | |
243 | 241 | } | |
244 | 242 | ||
245 | 243 | ||
246 | 244 | @Verifier(tx) | |
247 | 245 | func verify () = { | |
248 | 246 | let pubKeyAdminsList = ["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
249 | 247 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
250 | 248 | then 1 | |
251 | 249 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
252 | 250 | then 1 | |
253 | 251 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
254 | 252 | then 1 | |
255 | 253 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
256 | 254 | then 2 | |
257 | 255 | else 0)) | |
258 | 256 | (count >= 3) | |
259 | 257 | } | |
260 | 258 |
github/deemru/w8io/026f985 47.36 ms ◑