tx · 3WdtoXxrKN8FJHSFjtMw7JXruf7WvLMMkoebNHmye1ga 3NAfzeA3URU6oCV6HvtAiNwqGXsTs87ZpHh: -0.04000000 Waves 2022.08.01 06:25 [2164893] smart account 3NAfzeA3URU6oCV6HvtAiNwqGXsTs87ZpHh > SELF 0.00000000 Waves
{ "type": 13, "id": "3WdtoXxrKN8FJHSFjtMw7JXruf7WvLMMkoebNHmye1ga", "fee": 4000000, "feeAssetId": null, "timestamp": 1659324350517, "version": 1, "sender": "3NAfzeA3URU6oCV6HvtAiNwqGXsTs87ZpHh", "senderPublicKey": "HiTi1JT7GQRqLNxg4yZhD1mV42y1Mv2AYvRx92JQRbwX", "proofs": [ "3skzbUwKAeeNacpxGMMWKtScJ3wFonMFgV2SMzZ6KBBHPCB5NFuCtyoitBhx9FEQYekYHPk8NyRUsydsPYow1zfC" ], "script": "base64:BgIUCAISBQoDCAEBEgMKAQgSBAoCCAFLAAZFVUxFUjgA1onPgQEABU1VTFQ2AMCEPQAGTVVMVFg2CQC2AgEAwIQ9AAVNVUxUOACAwtcvAAZNVUxUWDgJALYCAQCAwtcvAAZNVUxUMTIAgKCUpY0dAAZNVUxUMTgJALYCAQCAgJC7utat8A0AA1NFUAICX18AB1dBVkVTSUQJANkEAQIFV0FWRVMBEmtleU5ldXRyaW5vQXNzZXRJZAACEW5ldXRyaW5vX2Fzc2V0X2lkAQ5rZXlOc2J0QXNzZXRJZAACDWJvbmRfYXNzZXRfaWQBDmtleVN1cmZBc3NldElkAAINc3VyZl9hc3NldF9pZAEQa2V5QmFsYW5jZUxvY2tlZAACDWJhbGFuY2VfbG9ja18BFWtleVdhdmVzTG9ja2VkQmFsYW5jZQAJAKwCAgkBEGtleUJhbGFuY2VMb2NrZWQAAgV3YXZlcwEYa2V5TmV1dHJpbm9Mb2NrZWRCYWxhbmNlAAkArAICCQEQa2V5QmFsYW5jZUxvY2tlZAACCG5ldXRyaW5vARVrZXlNaW5XYXZlc1N3YXBBbW91bnQAAhVtaW5f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vVGltZXN0YW1wAQULc3RhcnRIZWlnaHQEDnN0YXJ0SGVpZ2h0TmV3AwkAZwIAAAUJbmV3QW1vdW50BQtzdGFydEhlaWdodAQIaGFsZkxpZmUJAQxnZXRJbnRPckZhaWwCBRNuc2J0U3Rha2luZ0NvbnRyYWN0CQELa2V5SGFsZkxpZmUACQEFYXNJbnQBCQD8BwQFDG1hdGhDb250cmFjdAITbWVyZ2VTdGFrZXNSRUFET05MWQkAzAgCBQdhbW91bnQwCQDMCAIFC3N0YXJ0SGVpZ2h0CQDMCAIFCW5ld0Ftb3VudAkAzAgCBQZoZWlnaHQJAMwIAgUIaGFsZkxpZmUFA25pbAUDbmlsBBFzdGFydFRpbWVzdGFtcE5ldwkBC3RvVGltZXN0YW1wAQUOc3RhcnRIZWlnaHROZXcJAJQKAgUDbmlsCQC5CQIJAMwIAgIIJWQlZCVkJWQJAMwIAgkApAMBBQtzdGFydEhlaWdodAkAzAgCCQCkAwEFDnN0YXJ0VGltZXN0YW1wCQDMCAIJAKQDAQUOc3RhcnRIZWlnaHROZXcJAMwIAgkApAMBBRFzdGFydFRpbWVzdGFtcE5ldwUDbmlsBQNTRVAAaL7Dpg==", "chainId": 84, "height": 2164893, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FK6eVKTqW53KuVNDux73cRrEuewqy2D8hrswEbEKKQLb Next: GN2hXZakTmm845Y69u16E1PsbCbZAmn2YL1JS2PL1JRu Diff:
Old | New | Differences | |
---|---|---|---|
224 | 224 | ||
225 | 225 | @Callable(i) | |
226 | 226 | func gnsbtInfoREADONLY (userAddressStrOrEmpty,additionalNsbtToStakeOrZero,additionalSurfToStakeOrZero) = { | |
227 | + | let userAddressOrThis = if ((userAddressStrOrEmpty != "")) | |
228 | + | then addressFromStringValue(userAddressStrOrEmpty) | |
229 | + | else this | |
227 | 230 | let currentPrice = getIntegerValue(controlContract, keyPrice()) | |
228 | 231 | let gnsbtFromNsbtDiff = additionalNsbtToStakeOrZero | |
229 | 232 | let gnsbtFromSurfDiff = asInt(invoke(gnsbtControllerContract, "gnsbtFromSurfSYSREADONLY", [additionalSurfToStakeOrZero], nil)) | |
230 | 233 | let gNsbtDiff = (gnsbtFromNsbtDiff + gnsbtFromSurfDiff) | |
231 | - | let $ | |
232 | - | let limitMaxUsdn = $ | |
233 | - | let limitSpent = $ | |
234 | - | let blcks2LmtReset = $ | |
235 | - | let gnsbtAmt = $ | |
236 | - | let gnsbtAmtTotal = $ | |
237 | - | let $ | |
238 | - | let limitMaxUsdnNEW = $ | |
239 | - | let limitSpentNEW = $ | |
240 | - | let blcks2LmtResetNEW = $ | |
241 | - | let gnsbtAmtNEW = $ | |
242 | - | let gnsbtAmtTotalNEW = $ | |
234 | + | let $t063906577 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOrEmpty, 0], nil)) | |
235 | + | let limitMaxUsdn = $t063906577._1 | |
236 | + | let limitSpent = $t063906577._2 | |
237 | + | let blcks2LmtReset = $t063906577._3 | |
238 | + | let gnsbtAmt = $t063906577._4 | |
239 | + | let gnsbtAmtTotal = $t063906577._5 | |
240 | + | let $t065816791 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOrEmpty, gNsbtDiff], nil)) | |
241 | + | let limitMaxUsdnNEW = $t065816791._1 | |
242 | + | let limitSpentNEW = $t065816791._2 | |
243 | + | let blcks2LmtResetNEW = $t065816791._3 | |
244 | + | let gnsbtAmtNEW = $t065816791._4 | |
245 | + | let gnsbtAmtTotalNEW = $t065816791._5 | |
243 | 246 | let limitMaxWaves = convertNeutrinoToWaves(limitMaxUsdn, currentPrice) | |
244 | 247 | let limitMaxWavesNEW = convertNeutrinoToWaves(limitMaxUsdnNEW, currentPrice) | |
245 | 248 | let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", [userAddressStrOrEmpty], nil)) | |
247 | 250 | let gnsbtTotal = asInt(gnsbtData[1]) | |
248 | 251 | let nsbtData = asAnyList(gnsbtData[2]) | |
249 | 252 | let surfData = asAnyList(gnsbtData[3]) | |
250 | - | let nsbtBalance = asInt(nsbtData[0]) | |
251 | - | let surfBalance = asInt(surfData[0]) | |
252 | - | let nsbtBalanceNew = (nsbtBalance + additionalNsbtToStakeOrZero) | |
253 | - | let surfBalanceNew = (surfBalance + additionalSurfToStakeOrZero) | |
253 | + | let nsbtBalance = if ((userAddressStrOrEmpty != "")) | |
254 | + | then assetBalance(userAddressOrThis, nsbtAssetId) | |
255 | + | else 0 | |
256 | + | let surfBalance = if ((userAddressStrOrEmpty != "")) | |
257 | + | then assetBalance(userAddressOrThis, surfAssetId) | |
258 | + | else 0 | |
259 | + | let nsbtBalanceNew = (nsbtBalance - additionalNsbtToStakeOrZero) | |
260 | + | let surfBalanceNew = (surfBalance - additionalSurfToStakeOrZero) | |
254 | 261 | let gnsbtAmtFromNsbt = asInt(nsbtData[2]) | |
255 | 262 | let gnsbtAmtFromSurf = asInt(surfData[2]) | |
256 | 263 | let gnsbtAmtFromNsbtNEW = (gnsbtAmtFromNsbt + gnsbtFromNsbtDiff) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let EULER8 = 271828182 | |
5 | 5 | ||
6 | 6 | let MULT6 = 1000000 | |
7 | 7 | ||
8 | 8 | let MULTX6 = toBigInt(1000000) | |
9 | 9 | ||
10 | 10 | let MULT8 = 100000000 | |
11 | 11 | ||
12 | 12 | let MULTX8 = toBigInt(100000000) | |
13 | 13 | ||
14 | 14 | let MULT12 = 1000000000000 | |
15 | 15 | ||
16 | 16 | let MULT18 = toBigInt(1000000000000000000) | |
17 | 17 | ||
18 | 18 | let SEP = "__" | |
19 | 19 | ||
20 | 20 | let WAVESID = fromBase58String("WAVES") | |
21 | 21 | ||
22 | 22 | func keyNeutrinoAssetId () = "neutrino_asset_id" | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func keyNsbtAssetId () = "bond_asset_id" | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func keySurfAssetId () = "surf_asset_id" | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func keyBalanceLocked () = "balance_lock_" | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func keyWavesLockedBalance () = (keyBalanceLocked() + "waves") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func keyNeutrinoLockedBalance () = (keyBalanceLocked() + "neutrino") | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func keyMinWavesSwapAmount () = "min_waves_swap_amount" | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func keyMinNeutrinoSwapAmount () = "min_neutrino_swap_amount" | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func keyWavesOutFeePart () = "wavesOut_swap_feePart" | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func keyNeutrinoOutFeePart () = "neutrinoOut_swap_feePart" | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func keySwapAmountAParam () = "%s%s__config__swapAParam" | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func keySwapAmountBParam () = "%s%s__config__swapBParam" | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func keyNsbtLockContract () = "%s__nsbtLockContract" | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func keyMathContract () = "%s__mathContract" | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func keyBalanceWavesLockInterval () = "balance_waves_lock_interval" | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func keyBalanceNeutrinoLockInterval () = "balance_neutrino_lock_interval" | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func keyPrice () = "price" | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func keyLockParamStartBlock (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "start"], SEP) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func keyHalfLife () = "%s__halfLife" | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func keyMinLockAmount () = "%s__minLockAmount" | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func keyMinWavesForNsbtBuy () = "min_waves_nsbt_buy" | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func keyMinNsbtSell () = "min_nsbt_sell" | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func asAnyList (val) = match val { | |
104 | 104 | case valAnyList: List[Any] => | |
105 | 105 | valAnyList | |
106 | 106 | case _ => | |
107 | 107 | throw("fail to cast into List[Any]") | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func asInt (val) = match val { | |
112 | 112 | case valInt: Int => | |
113 | 113 | valInt | |
114 | 114 | case _ => | |
115 | 115 | throw("fail to cast into Int") | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func asString (val) = match val { | |
120 | 120 | case valStr: String => | |
121 | 121 | valStr | |
122 | 122 | case _ => | |
123 | 123 | throw("fail to cast into String") | |
124 | 124 | } | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func asTuple2Ints (val) = match val { | |
128 | 128 | case v: (Int, Int) => | |
129 | 129 | v | |
130 | 130 | case _ => | |
131 | 131 | throw("fail to cast into Tuple2 ints") | |
132 | 132 | } | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func asSwapParamsSTRUCT (val) = match val { | |
136 | 136 | case struct: (Int, Int, Int, Int, Int) => | |
137 | 137 | struct | |
138 | 138 | case _ => | |
139 | 139 | throw("fail to cast into Int") | |
140 | 140 | } | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func toTimestamp (start) = if ((0 > start)) | |
144 | 144 | then -1 | |
145 | 145 | else match blockInfoByHeight(start) { | |
146 | 146 | case block: BlockInfo => | |
147 | 147 | block.timestamp | |
148 | 148 | case _ => | |
149 | 149 | -1 | |
150 | 150 | } | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult)) | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18)) | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | let IdxControlCfgNeutrinoDapp = 1 | |
160 | 160 | ||
161 | 161 | let IdxControlCfgAuctionDapp = 2 | |
162 | 162 | ||
163 | 163 | let IdxControlCfgRpdDapp = 3 | |
164 | 164 | ||
165 | 165 | let IdxControlCfgMathDapp = 4 | |
166 | 166 | ||
167 | 167 | let IdxControlCfgLiquidationDapp = 5 | |
168 | 168 | ||
169 | 169 | let IdxControlCfgRestDapp = 6 | |
170 | 170 | ||
171 | 171 | let IdxControlCfgNodeRegistryDapp = 7 | |
172 | 172 | ||
173 | 173 | let IdxControlCfgNsbtStakingDapp = 8 | |
174 | 174 | ||
175 | 175 | let IdxControlCfgMediatorDapp = 9 | |
176 | 176 | ||
177 | 177 | let IdxControlCfgSurfStakingDapp = 10 | |
178 | 178 | ||
179 | 179 | let IdxControlCfgGnsbtControllerDapp = 11 | |
180 | 180 | ||
181 | 181 | func keyControlAddress () = "%s%s__config__controlAddress" | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | func keyControlCfg () = "%s__controlConfig" | |
185 | 185 | ||
186 | 186 | ||
187 | 187 | func readControlCfgOrFail (control) = split(getStringOrFail(control, keyControlCfg()), SEP) | |
188 | 188 | ||
189 | 189 | ||
190 | 190 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx")) | |
194 | 194 | ||
195 | 195 | let controlCfg = readControlCfgOrFail(controlContract) | |
196 | 196 | ||
197 | 197 | let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp) | |
198 | 198 | ||
199 | 199 | let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp) | |
200 | 200 | ||
201 | 201 | let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp) | |
202 | 202 | ||
203 | 203 | let liquidationContract = getContractAddressOrFail(controlCfg, IdxControlCfgLiquidationDapp) | |
204 | 204 | ||
205 | 205 | let rpdContract = getContractAddressOrFail(controlCfg, IdxControlCfgRpdDapp) | |
206 | 206 | ||
207 | 207 | let nsbtStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgNsbtStakingDapp) | |
208 | 208 | ||
209 | 209 | let surfStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgSurfStakingDapp) | |
210 | 210 | ||
211 | 211 | let gnsbtControllerContract = getContractAddressOrFail(controlCfg, IdxControlCfgGnsbtControllerDapp) | |
212 | 212 | ||
213 | 213 | let neutrinoAssetIdString = getStringOrFail(neutrinoContract, keyNeutrinoAssetId()) | |
214 | 214 | ||
215 | 215 | let neutrinoAssetId = fromBase58String(neutrinoAssetIdString) | |
216 | 216 | ||
217 | 217 | let nsbtAssetIdStr = getStringValue(neutrinoContract, keyNsbtAssetId()) | |
218 | 218 | ||
219 | 219 | let nsbtAssetId = fromBase58String(nsbtAssetIdStr) | |
220 | 220 | ||
221 | 221 | let surfAssetIdStr = getStringValue(auctionContract, keySurfAssetId()) | |
222 | 222 | ||
223 | 223 | let surfAssetId = fromBase58String(surfAssetIdStr) | |
224 | 224 | ||
225 | 225 | @Callable(i) | |
226 | 226 | func gnsbtInfoREADONLY (userAddressStrOrEmpty,additionalNsbtToStakeOrZero,additionalSurfToStakeOrZero) = { | |
227 | + | let userAddressOrThis = if ((userAddressStrOrEmpty != "")) | |
228 | + | then addressFromStringValue(userAddressStrOrEmpty) | |
229 | + | else this | |
227 | 230 | let currentPrice = getIntegerValue(controlContract, keyPrice()) | |
228 | 231 | let gnsbtFromNsbtDiff = additionalNsbtToStakeOrZero | |
229 | 232 | let gnsbtFromSurfDiff = asInt(invoke(gnsbtControllerContract, "gnsbtFromSurfSYSREADONLY", [additionalSurfToStakeOrZero], nil)) | |
230 | 233 | let gNsbtDiff = (gnsbtFromNsbtDiff + gnsbtFromSurfDiff) | |
231 | - | let $ | |
232 | - | let limitMaxUsdn = $ | |
233 | - | let limitSpent = $ | |
234 | - | let blcks2LmtReset = $ | |
235 | - | let gnsbtAmt = $ | |
236 | - | let gnsbtAmtTotal = $ | |
237 | - | let $ | |
238 | - | let limitMaxUsdnNEW = $ | |
239 | - | let limitSpentNEW = $ | |
240 | - | let blcks2LmtResetNEW = $ | |
241 | - | let gnsbtAmtNEW = $ | |
242 | - | let gnsbtAmtTotalNEW = $ | |
234 | + | let $t063906577 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOrEmpty, 0], nil)) | |
235 | + | let limitMaxUsdn = $t063906577._1 | |
236 | + | let limitSpent = $t063906577._2 | |
237 | + | let blcks2LmtReset = $t063906577._3 | |
238 | + | let gnsbtAmt = $t063906577._4 | |
239 | + | let gnsbtAmtTotal = $t063906577._5 | |
240 | + | let $t065816791 = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStrOrEmpty, gNsbtDiff], nil)) | |
241 | + | let limitMaxUsdnNEW = $t065816791._1 | |
242 | + | let limitSpentNEW = $t065816791._2 | |
243 | + | let blcks2LmtResetNEW = $t065816791._3 | |
244 | + | let gnsbtAmtNEW = $t065816791._4 | |
245 | + | let gnsbtAmtTotalNEW = $t065816791._5 | |
243 | 246 | let limitMaxWaves = convertNeutrinoToWaves(limitMaxUsdn, currentPrice) | |
244 | 247 | let limitMaxWavesNEW = convertNeutrinoToWaves(limitMaxUsdnNEW, currentPrice) | |
245 | 248 | let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", [userAddressStrOrEmpty], nil)) | |
246 | 249 | let gnsbtUser = asInt(gnsbtData[0]) | |
247 | 250 | let gnsbtTotal = asInt(gnsbtData[1]) | |
248 | 251 | let nsbtData = asAnyList(gnsbtData[2]) | |
249 | 252 | let surfData = asAnyList(gnsbtData[3]) | |
250 | - | let nsbtBalance = asInt(nsbtData[0]) | |
251 | - | let surfBalance = asInt(surfData[0]) | |
252 | - | let nsbtBalanceNew = (nsbtBalance + additionalNsbtToStakeOrZero) | |
253 | - | let surfBalanceNew = (surfBalance + additionalSurfToStakeOrZero) | |
253 | + | let nsbtBalance = if ((userAddressStrOrEmpty != "")) | |
254 | + | then assetBalance(userAddressOrThis, nsbtAssetId) | |
255 | + | else 0 | |
256 | + | let surfBalance = if ((userAddressStrOrEmpty != "")) | |
257 | + | then assetBalance(userAddressOrThis, surfAssetId) | |
258 | + | else 0 | |
259 | + | let nsbtBalanceNew = (nsbtBalance - additionalNsbtToStakeOrZero) | |
260 | + | let surfBalanceNew = (surfBalance - additionalSurfToStakeOrZero) | |
254 | 261 | let gnsbtAmtFromNsbt = asInt(nsbtData[2]) | |
255 | 262 | let gnsbtAmtFromSurf = asInt(surfData[2]) | |
256 | 263 | let gnsbtAmtFromNsbtNEW = (gnsbtAmtFromNsbt + gnsbtFromNsbtDiff) | |
257 | 264 | let gnsbtAmtFromSurfNEW = (gnsbtAmtFromSurf + gnsbtFromSurfDiff) | |
258 | 265 | let gnsbtFromNsbtTotal = asInt(nsbtData[3]) | |
259 | 266 | let gnsbtFromSurfTotal = asInt(surfData[3]) | |
260 | 267 | let gnsbtFromNsbtTotalNEW = (gnsbtFromNsbtTotal + gnsbtFromNsbtDiff) | |
261 | 268 | let gnsbtFromSurfTotalNEW = (gnsbtFromSurfTotal + gnsbtFromSurfDiff) | |
262 | 269 | let votingPower = fraction(gnsbtAmtFromNsbt, MULT6, (gnsbtFromNsbtTotal + gnsbtFromSurfTotal)) | |
263 | 270 | let votingPowerNew = fraction(gnsbtAmtFromNsbtNEW, MULT6, (gnsbtFromNsbtTotalNEW + gnsbtFromSurfTotal)) | |
264 | 271 | let votingPowerMax = fraction((gnsbtAmtFromNsbt + gnsbtAmtFromSurf), MULT6, (gnsbtFromNsbtTotal + gnsbtFromSurfTotal)) | |
265 | 272 | let votingPowreMaxNew = fraction((gnsbtAmtFromNsbtNEW + gnsbtAmtFromSurfNEW), MULT6, (gnsbtFromNsbtTotalNEW + gnsbtFromSurfTotal)) | |
266 | 273 | let votingPowerEta = (height + (1440 * 7)) | |
267 | 274 | let votingPowerEtaNew = (height + (1440 * 14)) | |
268 | 275 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d", toString(nsbtBalance), toString(surfBalance), toString(nsbtBalanceNew), toString(surfBalanceNew), toString(gnsbtAmtFromNsbt), toString(gnsbtAmtFromSurf), toString(gnsbtAmtFromNsbtNEW), toString(gnsbtAmtFromSurfNEW), toString(gnsbtFromNsbtTotal), toString(gnsbtFromSurfTotal), toString(gnsbtFromNsbtTotalNEW), toString(gnsbtFromSurfTotalNEW), toString(limitMaxUsdn), toString(limitMaxWaves), toString(limitMaxUsdnNEW), toString(limitMaxWavesNEW), toString(blcks2LmtReset), toString(blcks2LmtResetNEW), toString(votingPower), toString(votingPowerNew), toString(votingPowerMax), toString(votingPowreMaxNew), toString(votingPowerEta), toString(votingPowerEtaNew)], SEP)) | |
269 | 276 | } | |
270 | 277 | ||
271 | 278 | ||
272 | 279 | ||
273 | 280 | @Callable(i) | |
274 | 281 | func rewardInfoREADONLY (userAddressStrOrEmpty) = { | |
275 | 282 | let rewardsData = asAnyList(invoke(gnsbtControllerContract, "gnsbtRewardsSYSREADONLY", [userAddressStrOrEmpty], nil)) | |
276 | 283 | $Tuple2(nil, makeString(["%s%s", asString(rewardsData[0]), asString(rewardsData[1])], SEP)) | |
277 | 284 | } | |
278 | 285 | ||
279 | 286 | ||
280 | 287 | ||
281 | 288 | @Callable(i) | |
282 | 289 | func mergeNsbtREADONLY (userAddressMandatory,newAmount) = { | |
283 | 290 | let nsbtData = asAnyList(invoke(nsbtStakingContract, "nsbtStakingSYSREADONLY", [userAddressMandatory], nil)) | |
284 | 291 | let amount0 = asInt(nsbtData[0]) | |
285 | 292 | let startHeight = if ((0 >= amount0)) | |
286 | 293 | then -1 | |
287 | 294 | else asInt(nsbtData[2]) | |
288 | 295 | let startTimestamp = toTimestamp(startHeight) | |
289 | 296 | let startHeightNew = if ((0 >= newAmount)) | |
290 | 297 | then startHeight | |
291 | 298 | else { | |
292 | 299 | let halfLife = getIntOrFail(nsbtStakingContract, keyHalfLife()) | |
293 | 300 | asInt(invoke(mathContract, "mergeStakesREADONLY", [amount0, startHeight, newAmount, height, halfLife], nil)) | |
294 | 301 | } | |
295 | 302 | let startTimestampNew = toTimestamp(startHeightNew) | |
296 | 303 | $Tuple2(nil, makeString(["%d%d%d%d", toString(startHeight), toString(startTimestamp), toString(startHeightNew), toString(startTimestampNew)], SEP)) | |
297 | 304 | } | |
298 | 305 | ||
299 | 306 |
github/deemru/w8io/026f985 54.44 ms ◑