tx · 2QoWuWcA2umuD9Yu51yKg4ebM7PwtNseQGWN3tSmTdMY

3NBEuUXKfGqe1ZKUfx8b8YsguJKYLhy2bTJ:  -0.03700000 Waves

2023.04.28 09:59 [2554085] smart account 3NBEuUXKfGqe1ZKUfx8b8YsguJKYLhy2bTJ > SELF 0.00000000 Waves

{ "type": 13, "id": "2QoWuWcA2umuD9Yu51yKg4ebM7PwtNseQGWN3tSmTdMY", "fee": 3700000, "feeAssetId": null, "timestamp": 1682665178769, "version": 2, "chainId": 84, "sender": "3NBEuUXKfGqe1ZKUfx8b8YsguJKYLhy2bTJ", "senderPublicKey": "2NgVCitn1k18yzwhrzdQXHDEygzSkjbXS4A1koTt14db", "proofs": [ "J4oVTbePcWbTYQNMoqfWCbLubuvTScg9ZE5S9twQ9qAzKrK5sijba5fUehnvjFx7H8XYLai6EThtwsAJAQV7zjo" ], "script": "base64:BgIxCAISAwoBCBIAEgMKAQESABIAEgASAwoBARIDCgEBEgASABIDCgEIEgMKAQgSAwoBCFQADWtfdG90YWxTdXBwbHkCDWtfdG90YWxTdXBwbHkAD2tfcmV3YXJkQmFsYW5jZQIPa19yZXdhcmRCYWxhbmNlAA9rX2xvY2tlZEJhbGFuY2UCD2tfbG9ja2VkQmFsYW5jZQANa19mcmVlQmFsYW5jZQINa19mcmVlQmFsYW5jZQAGa19yYXRlAgZrX3JhdGUAEGtfbGFzdFVwZGF0ZVRpbWUCEGtfbGFzdFVwZGF0ZVRpbWUAFmtfcmV3YXJkUGVyVG9rZW5TdG9yZWQCFmtfcmV3YXJkUGVyVG9rZW5TdG9yZWQADGtfcmV3YXJkUmF0ZQIMa19yZXdhcmRSYXRlAA5rX3BlcmlvZEZpbmlzaAIOa19wZXJpb2RGaW5pc2gAFGtfdXNlclJld2FyZFBlclRva2VuAhRrX3VzZXJSZXdhcmRQZXJUb2tlbgAMa191c2VyUmV3YXJkAgxrX3VzZXJSZXdhcmQACWtfYmFsYW5jZQIJa19iYWxhbmNlAA5rX2F2ZX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2ZSgxMDYyKQEJAQV2YWx1ZQEFDmNvb3JkaW5hdG9yU3RyBQ9rX2FkbWluX2FkZHJlc3MDCQEJaXNEZWZpbmVkAQUFYWRtaW4JAQt2YWx1ZU9yRWxzZQIJAJsIAgkBEUBleHRyTmF0aXZlKDEwNjIpAQkBBXZhbHVlAQUFYWRtaW4JAKwCAgkArAICCQCsAgICB3N0YXR1c18JAKUIAQUEdGhpcwIBXwkA2AQBCAUCdHgCaWQHCQACAQIudW5hYmxlIHRvIHZlcmlmeTogYWRtaW4gbm90IHNldCBpbiBjb29yZGluYXRvcgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tlebTXJAI=", "height": 2554085, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FZPZdns2cWgvkQjdyteNN77MTtKLjxnJosJeijrK53zZ Next: FgEFR76dKziUVmoiVZAmv74D6YtFhGG2nrJJTfs8H1f Diff:
OldNewDifferences
5252 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
5353
5454
55-func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set")
55+func coordinator () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, k_coordinatorAddress), "Coordinator not set")), "Coordinator address invalid")
56+
57+
58+func adminAddress () = addressFromString(valueOrErrorMessage(getString(coordinator(), k_admin_address), "Admin address not set"))
5659
5760
5861 func isWhitelist (_address) = valueOrElse(getBoolean(coordinator(), toCompositeKey(k_amm, _address)), false)
5962
6063
61-func governanceAsset () = fromBase58String(getStringValue(coordinator(), k_governance_asset))
64+func governanceAsset () = fromBase58String(valueOrErrorMessage(getString(coordinator(), k_governance_asset), "Governance asset not set"))
6265
6366
64-func adminAddress () = addressFromString(valueOrErrorMessage(getString(coordinator(), k_admin_address), "Admin address not set"))
67+func quoteAsset () = fromBase58String(valueOrErrorMessage(getString(coordinator(), k_quote_asset), "Quote asset not set"))
6568
6669
67-func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset))
68-
69-
70-func managerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_manager_address)), "Manager not set")
70+func managerAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_manager_address), "Manager address not set")), "Manager address invalid")
7171
7272
7373 let DECIMAL_UNIT = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10))
173173 func getWithdrawLimitLeft (_staker) = {
174174 let currentDate = currentTimestamp()
175175 let lastWithdrawDate = lastWithdrawnDate(_staker)
176- let $t049645285 = if (((currentDate - lastWithdrawDate) > WITHDRAW_PERIOD))
176+ let $t049895310 = if (((currentDate - lastWithdrawDate) > WITHDRAW_PERIOD))
177177 then $Tuple3(currentDate, withdrawLimit(_staker), 0)
178178 else $Tuple3(lastWithdrawDate, (withdrawLimit(_staker) - withdrawnInPeriod(_staker)), withdrawnInPeriod(_staker))
179- let newLastWithdrawnDate = $t049645285._1
180- let withdrawLimitLeft = $t049645285._2
181- let alreadyWithdrawnInPeriod = $t049645285._3
179+ let newLastWithdrawnDate = $t049895310._1
180+ let withdrawLimitLeft = $t049895310._2
181+ let alreadyWithdrawnInPeriod = $t049895310._3
182182 $Tuple3(newLastWithdrawnDate, withdrawLimitLeft, alreadyWithdrawnInPeriod)
183183 }
184184
215215 func updateReward (_staker,_balanceDelta) = {
216216 let newRewardPerTokenStored = rewardPerToken(_balanceDelta)
217217 let newLastUpdateTime = currentTimestampSec()
218- let $t065076699 = if ((_staker != ""))
218+ let $t065326724 = if ((_staker != ""))
219219 then $Tuple2(earned(_staker, _balanceDelta), newRewardPerTokenStored)
220220 else $Tuple2(0, 0)
221- let stakerEarned = $t065076699._1
222- let stakerRewardPerTokenPaid = $t065076699._2
221+ let stakerEarned = $t065326724._1
222+ let stakerRewardPerTokenPaid = $t065326724._2
223223 $Tuple4(newRewardPerTokenStored, newLastUpdateTime, stakerEarned, stakerRewardPerTokenPaid)
224224 }
225225
226226
227-func updateUserBalance (_user,_change) = [IntegerEntry(toCompositeKey(k_balance, _user), (balanceOf(_user) + _change))]
227+func updateUserBalance (_user,_change) = if (((balanceOf(_user) + _change) >= 0))
228+ then [IntegerEntry(toCompositeKey(k_balance, _user), (balanceOf(_user) + _change))]
229+ else throw(((("Vault: can not update user balance. Balance: " + toString(balanceOf(_user))) + " change: ") + toString(_change)))
228230
229231
230232 func setUserWithdrawLimit (_user,_rate) = [IntegerEntry(toCompositeKey(k_withdraw_limit, _user), _rate)]
293295 else !(initialized()))
294296 then throw("Invalid call to stake")
295297 else {
296- let $t0995210181 = updateReward(_staker, 0)
297- let newRewardPerTokenStored = $t0995210181._1
298- let newLastUpdateTime = $t0995210181._2
299- let stakerEarned = $t0995210181._3
300- let stakerRewardPerTokenPaid = $t0995210181._4
298+ let $t01017610405 = updateReward(_staker, 0)
299+ let newRewardPerTokenStored = $t01017610405._1
300+ let newLastUpdateTime = $t01017610405._2
301+ let stakerEarned = $t01017610405._3
302+ let stakerRewardPerTokenPaid = $t01017610405._4
301303 let currentRate = rate()
302304 let prevAverageRate = averageRate(_staker)
303305 let vAmount = divd(_amount, currentRate)
324326 else !(initialized()))
325327 then throw("Invalid call to unStake")
326328 else {
327- let $t01153411750 = updateReward(_staker, 0)
328- let newRewardPerTokenStored = $t01153411750._1
329- let newLastUpdateTime = $t01153411750._2
330- let stakerEarned = $t01153411750._3
331- let stakerRewardPerTokenPaid = $t01153411750._4
332- let $t01175711924 = getWithdrawLimitLeft(_staker)
333- let newLastWithdrawnDate = $t01175711924._1
334- let withdrawLimitLeft = $t01175711924._2
335- let alreadyWithdrawnInPeriod = $t01175711924._3
329+ let $t01175811974 = updateReward(_staker, 0)
330+ let newRewardPerTokenStored = $t01175811974._1
331+ let newLastUpdateTime = $t01175811974._2
332+ let stakerEarned = $t01175811974._3
333+ let stakerRewardPerTokenPaid = $t01175811974._4
334+ let $t01198112148 = getWithdrawLimitLeft(_staker)
335+ let newLastWithdrawnDate = $t01198112148._1
336+ let withdrawLimitLeft = $t01198112148._2
337+ let alreadyWithdrawnInPeriod = $t01198112148._3
336338 let vAmount = divd(amountOfQuoteAsset, rate())
337339 if ((vAmount > withdrawLimitLeft))
338340 then throw("Invalid call to unStake: withdraw over limit")
355357 @Callable(i)
356358 func withdrawRewards () = {
357359 let _staker = toString(i.caller)
358- let $t01326013405 = updateReward(_staker, 0)
359- let newRewardPerTokenStored = $t01326013405._1
360- let newLastUpdateTime = $t01326013405._2
361- let stakerEarned = $t01326013405._3
362- let stakerRewardPerTokenPaid = $t01326013405._4
360+ let $t01348413629 = updateReward(_staker, 0)
361+ let newRewardPerTokenStored = $t01348413629._1
362+ let newLastUpdateTime = $t01348413629._2
363+ let stakerEarned = $t01348413629._3
364+ let stakerRewardPerTokenPaid = $t01348413629._4
363365 if (if ((0 >= stakerEarned))
364366 then true
365367 else !(initialized()))
419421 @Callable(i)
420422 func exchangeFreeAndLocked (_amount) = if (if (!(initialized()))
421423 then true
422- else !(isWhitelist(toString(i.caller))))
424+ else if (!(isWhitelist(toString(i.caller))))
425+ then (i.caller != adminAddress())
426+ else false)
423427 then throw("Invalid exchangeFreeAndLocked params")
424428 else {
425429 let amountOfQuoteAsset = usdnToDecimals(_amount)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let k_totalSupply = "k_totalSupply"
55
66 let k_rewardBalance = "k_rewardBalance"
77
88 let k_lockedBalance = "k_lockedBalance"
99
1010 let k_freeBalance = "k_freeBalance"
1111
1212 let k_rate = "k_rate"
1313
1414 let k_lastUpdateTime = "k_lastUpdateTime"
1515
1616 let k_rewardPerTokenStored = "k_rewardPerTokenStored"
1717
1818 let k_rewardRate = "k_rewardRate"
1919
2020 let k_periodFinish = "k_periodFinish"
2121
2222 let k_userRewardPerToken = "k_userRewardPerToken"
2323
2424 let k_userReward = "k_userReward"
2525
2626 let k_balance = "k_balance"
2727
2828 let k_average_rate = "k_average_rate"
2929
3030 let k_withdraw_limit = "k_withdraw_limit"
3131
3232 let k_last_withdraw_date = "k_last_withdraw_date"
3333
3434 let k_withdraw_in_period = "k_withdraw_in_period"
3535
3636 let k_initialized = "k_initialized"
3737
3838 let k_coordinatorAddress = "k_coordinatorAddress"
3939
4040 let k_amm = "k_amm"
4141
4242 let k_governance_asset = "k_gov_asset"
4343
4444 let k_quote_asset = "k_quote_asset"
4545
4646 let k_admin_address = "k_admin_address"
4747
4848 let k_manager_address = "k_manager_address"
4949
5050 let k_collateral_address = "k_collateral_address"
5151
5252 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
5353
5454
55-func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set")
55+func coordinator () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, k_coordinatorAddress), "Coordinator not set")), "Coordinator address invalid")
56+
57+
58+func adminAddress () = addressFromString(valueOrErrorMessage(getString(coordinator(), k_admin_address), "Admin address not set"))
5659
5760
5861 func isWhitelist (_address) = valueOrElse(getBoolean(coordinator(), toCompositeKey(k_amm, _address)), false)
5962
6063
61-func governanceAsset () = fromBase58String(getStringValue(coordinator(), k_governance_asset))
64+func governanceAsset () = fromBase58String(valueOrErrorMessage(getString(coordinator(), k_governance_asset), "Governance asset not set"))
6265
6366
64-func adminAddress () = addressFromString(valueOrErrorMessage(getString(coordinator(), k_admin_address), "Admin address not set"))
67+func quoteAsset () = fromBase58String(valueOrErrorMessage(getString(coordinator(), k_quote_asset), "Quote asset not set"))
6568
6669
67-func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset))
68-
69-
70-func managerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_manager_address)), "Manager not set")
70+func managerAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_manager_address), "Manager address not set")), "Manager address invalid")
7171
7272
7373 let DECIMAL_UNIT = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10))
7474
7575 let DURATION = (((7 * 60) * 60) * 24)
7676
7777 let NO_ADDRESS = ""
7878
7979 let NO_STAKER = 0
8080
8181 func usdnFromDecimals (_amount) = (_amount / 100)
8282
8383
8484 func usdnToDecimals (_amount) = (_amount * 100)
8585
8686
8787 func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN)
8888
8989
9090 func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN)
9191
9292
9393 func abs (_x) = if ((_x > 0))
9494 then _x
9595 else -(_x)
9696
9797
9898 func minv (_x,_y) = if ((_x > _y))
9999 then _y
100100 else _x
101101
102102
103103 let WITHDRAW_PERIOD = (86400 * 1000)
104104
105105 let WITHDRAW_PER_PERIOD = divd((1 * DECIMAL_UNIT), (4 * DECIMAL_UNIT))
106106
107107 func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k))
108108
109109
110110 func int0 (k) = valueOrElse(getInteger(this, k), 0)
111111
112112
113113 func int1 (k) = valueOrElse(getInteger(this, k), DECIMAL_UNIT)
114114
115115
116116 func totalSupply () = int0(k_totalSupply)
117117
118118
119119 func rate () = int1(k_rate)
120120
121121
122122 func balanceOf (_staker) = int0(toCompositeKey(k_balance, _staker))
123123
124124
125125 func averageRate (_staker) = int0(toCompositeKey(k_average_rate, _staker))
126126
127127
128128 func withdrawLimit (_staker) = int0(toCompositeKey(k_withdraw_limit, _staker))
129129
130130
131131 func withdrawnInPeriod (_staker) = int0(toCompositeKey(k_withdraw_in_period, _staker))
132132
133133
134134 func lastWithdrawnDate (_staker) = int0(toCompositeKey(k_last_withdraw_date, _staker))
135135
136136
137137 func freeBalance () = int0(k_freeBalance)
138138
139139
140140 func lockedBalance () = int0(k_lockedBalance)
141141
142142
143143 func rewardPerTokenStored () = int0(k_rewardPerTokenStored)
144144
145145
146146 func lastUpdateTime () = int0(k_lastUpdateTime)
147147
148148
149149 func rewardRate () = int0(k_rewardRate)
150150
151151
152152 func periodFinish () = int0(k_periodFinish)
153153
154154
155155 func rewardBalance () = int0(k_rewardBalance)
156156
157157
158158 func rewards (_staker) = int0(toCompositeKey(k_userReward, _staker))
159159
160160
161161 func userRewardPerTokenPaid (_staker) = int0(toCompositeKey(k_userRewardPerToken, _staker))
162162
163163
164164 func initialized () = valueOrElse(getBoolean(this, k_initialized), false)
165165
166166
167167 func currentTimestamp () = lastBlock.timestamp
168168
169169
170170 func currentTimestampSec () = (currentTimestamp() / 1000)
171171
172172
173173 func getWithdrawLimitLeft (_staker) = {
174174 let currentDate = currentTimestamp()
175175 let lastWithdrawDate = lastWithdrawnDate(_staker)
176- let $t049645285 = if (((currentDate - lastWithdrawDate) > WITHDRAW_PERIOD))
176+ let $t049895310 = if (((currentDate - lastWithdrawDate) > WITHDRAW_PERIOD))
177177 then $Tuple3(currentDate, withdrawLimit(_staker), 0)
178178 else $Tuple3(lastWithdrawDate, (withdrawLimit(_staker) - withdrawnInPeriod(_staker)), withdrawnInPeriod(_staker))
179- let newLastWithdrawnDate = $t049645285._1
180- let withdrawLimitLeft = $t049645285._2
181- let alreadyWithdrawnInPeriod = $t049645285._3
179+ let newLastWithdrawnDate = $t049895310._1
180+ let withdrawLimitLeft = $t049895310._2
181+ let alreadyWithdrawnInPeriod = $t049895310._3
182182 $Tuple3(newLastWithdrawnDate, withdrawLimitLeft, alreadyWithdrawnInPeriod)
183183 }
184184
185185
186186 func computeNewRate (_amountOfQuoteAsset) = {
187187 let newRate = if ((totalSupply() > 0))
188188 then divd((freeBalance() + _amountOfQuoteAsset), totalSupply())
189189 else DECIMAL_UNIT
190190 newRate
191191 }
192192
193193
194194 func lastTimeRewardApplicable () = minv(currentTimestampSec(), periodFinish())
195195
196196
197197 func rewardPerToken (_balanceDelta) = if (((totalSupply() + _balanceDelta) == 0))
198198 then rewardPerTokenStored()
199199 else {
200200 let timeInterval = (lastTimeRewardApplicable() - lastUpdateTime())
201201 let actualTimeInterval = if ((0 > timeInterval))
202202 then 0
203203 else timeInterval
204204 let diff = divd((rewardRate() * actualTimeInterval), (totalSupply() + _balanceDelta))
205205 (rewardPerTokenStored() + diff)
206206 }
207207
208208
209209 func earned (_staker,_balanceDelta) = {
210210 let rewardDelta = (rewardPerToken(_balanceDelta) - userRewardPerTokenPaid(_staker))
211211 (muld((balanceOf(_staker) + _balanceDelta), rewardDelta) + rewards(_staker))
212212 }
213213
214214
215215 func updateReward (_staker,_balanceDelta) = {
216216 let newRewardPerTokenStored = rewardPerToken(_balanceDelta)
217217 let newLastUpdateTime = currentTimestampSec()
218- let $t065076699 = if ((_staker != ""))
218+ let $t065326724 = if ((_staker != ""))
219219 then $Tuple2(earned(_staker, _balanceDelta), newRewardPerTokenStored)
220220 else $Tuple2(0, 0)
221- let stakerEarned = $t065076699._1
222- let stakerRewardPerTokenPaid = $t065076699._2
221+ let stakerEarned = $t065326724._1
222+ let stakerRewardPerTokenPaid = $t065326724._2
223223 $Tuple4(newRewardPerTokenStored, newLastUpdateTime, stakerEarned, stakerRewardPerTokenPaid)
224224 }
225225
226226
227-func updateUserBalance (_user,_change) = [IntegerEntry(toCompositeKey(k_balance, _user), (balanceOf(_user) + _change))]
227+func updateUserBalance (_user,_change) = if (((balanceOf(_user) + _change) >= 0))
228+ then [IntegerEntry(toCompositeKey(k_balance, _user), (balanceOf(_user) + _change))]
229+ else throw(((("Vault: can not update user balance. Balance: " + toString(balanceOf(_user))) + " change: ") + toString(_change)))
228230
229231
230232 func setUserWithdrawLimit (_user,_rate) = [IntegerEntry(toCompositeKey(k_withdraw_limit, _user), _rate)]
231233
232234
233235 func setUserAverageRate (_user,_rate) = [IntegerEntry(toCompositeKey(k_average_rate, _user), _rate)]
234236
235237
236238 func updateFreeBalance (_change) = {
237239 let balance = freeBalance()
238240 if (((balance + _change) >= 0))
239241 then [IntegerEntry(k_freeBalance, (balance + _change))]
240242 else throw(((("Vault: can not update free balance. Balance: " + toString(balance)) + " change: ") + toString(_change)))
241243 }
242244
243245
244246 func updateLockedBalance (_change) = {
245247 let balance = lockedBalance()
246248 if (((balance + _change) >= 0))
247249 then [IntegerEntry(k_lockedBalance, (balance + _change))]
248250 else throw(((("Vault: can not update locked balance. Balance: " + toString(balance)) + " change: ") + toString(_change)))
249251 }
250252
251253
252254 func updateTotalSupply (_change) = [IntegerEntry(k_totalSupply, (totalSupply() + _change))]
253255
254256
255257 func updateRate (_rate) = [IntegerEntry(k_rate, _rate)]
256258
257259
258260 func setUserWithdrawParams (_user,_lastWithdrawDate,_withdrawn) = [IntegerEntry(toCompositeKey(k_last_withdraw_date, _user), _lastWithdrawDate), IntegerEntry(toCompositeKey(k_withdraw_in_period, _user), _withdrawn)]
259261
260262
261263 func updateRewardBalance (_delta) = [IntegerEntry(k_rewardBalance, (rewardBalance() + _delta))]
262264
263265
264266 func updateRewardRate (_rewardRate) = [IntegerEntry(k_rewardRate, _rewardRate)]
265267
266268
267269 func updateTime (_lastUpdateTime,_periodFinish) = [IntegerEntry(k_lastUpdateTime, _lastUpdateTime), IntegerEntry(k_periodFinish, _periodFinish)]
268270
269271
270272 func updateRewardPerTokenStored (_rewardPerTokenStored) = [IntegerEntry(k_rewardPerTokenStored, _rewardPerTokenStored)]
271273
272274
273275 func updateUserRewards (_staker,_reward,_userRewardPerToken) = [IntegerEntry(toCompositeKey(k_userReward, _staker), _reward), IntegerEntry(toCompositeKey(k_userRewardPerToken, _staker), _userRewardPerToken)]
274276
275277
276278 @Callable(i)
277279 func initialize (_coordinator) = if (if (initialized())
278280 then true
279281 else (i.caller != this))
280282 then throw("Unable to initialize")
281283 else [StringEntry(k_coordinatorAddress, toString(valueOrErrorMessage(addressFromString(_coordinator), "Invalid coordinator address"))), BooleanEntry(k_initialized, true)]
282284
283285
284286
285287 @Callable(i)
286288 func stake () = {
287289 let _staker = toString(i.caller)
288290 let _amount = usdnToDecimals(i.payments[0].amount)
289291 if (if (if ((i.payments[0].assetId != quoteAsset()))
290292 then true
291293 else (size(i.payments) != 1))
292294 then true
293295 else !(initialized()))
294296 then throw("Invalid call to stake")
295297 else {
296- let $t0995210181 = updateReward(_staker, 0)
297- let newRewardPerTokenStored = $t0995210181._1
298- let newLastUpdateTime = $t0995210181._2
299- let stakerEarned = $t0995210181._3
300- let stakerRewardPerTokenPaid = $t0995210181._4
298+ let $t01017610405 = updateReward(_staker, 0)
299+ let newRewardPerTokenStored = $t01017610405._1
300+ let newLastUpdateTime = $t01017610405._2
301+ let stakerEarned = $t01017610405._3
302+ let stakerRewardPerTokenPaid = $t01017610405._4
301303 let currentRate = rate()
302304 let prevAverageRate = averageRate(_staker)
303305 let vAmount = divd(_amount, currentRate)
304306 let newAverageRate = divd((muld(vAmount, currentRate) + muld(balanceOf(_staker), prevAverageRate)), (vAmount + balanceOf(_staker)))
305307 let newTotalBalance = (vAmount + balanceOf(_staker))
306308 let newWithdrawLimit = muld(newTotalBalance, WITHDRAW_PER_PERIOD)
307309 let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), usdnFromDecimals(_amount))])
308310 if ((stake == stake))
309311 then (((((((updateUserRewards(_staker, stakerEarned, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateFreeBalance(_amount)) ++ updateUserBalance(_staker, vAmount)) ++ setUserAverageRate(_staker, newAverageRate)) ++ setUserWithdrawLimit(_staker, newWithdrawLimit)) ++ updateTotalSupply(vAmount))
310312 else throw("Strict value is not equal to itself.")
311313 }
312314 }
313315
314316
315317
316318 @Callable(i)
317319 func unStake (_amount) = {
318320 let _staker = toString(i.caller)
319321 let amountOfQuoteAsset = usdnToDecimals(_amount)
320322 if (if (if ((i.payments != nil))
321323 then true
322324 else (0 >= amountOfQuoteAsset))
323325 then true
324326 else !(initialized()))
325327 then throw("Invalid call to unStake")
326328 else {
327- let $t01153411750 = updateReward(_staker, 0)
328- let newRewardPerTokenStored = $t01153411750._1
329- let newLastUpdateTime = $t01153411750._2
330- let stakerEarned = $t01153411750._3
331- let stakerRewardPerTokenPaid = $t01153411750._4
332- let $t01175711924 = getWithdrawLimitLeft(_staker)
333- let newLastWithdrawnDate = $t01175711924._1
334- let withdrawLimitLeft = $t01175711924._2
335- let alreadyWithdrawnInPeriod = $t01175711924._3
329+ let $t01175811974 = updateReward(_staker, 0)
330+ let newRewardPerTokenStored = $t01175811974._1
331+ let newLastUpdateTime = $t01175811974._2
332+ let stakerEarned = $t01175811974._3
333+ let stakerRewardPerTokenPaid = $t01175811974._4
334+ let $t01198112148 = getWithdrawLimitLeft(_staker)
335+ let newLastWithdrawnDate = $t01198112148._1
336+ let withdrawLimitLeft = $t01198112148._2
337+ let alreadyWithdrawnInPeriod = $t01198112148._3
336338 let vAmount = divd(amountOfQuoteAsset, rate())
337339 if ((vAmount > withdrawLimitLeft))
338340 then throw("Invalid call to unStake: withdraw over limit")
339341 else {
340342 let newWithdrawnInPeriod = (alreadyWithdrawnInPeriod + vAmount)
341343 if ((amountOfQuoteAsset > freeBalance()))
342344 then throw("Invalid call to unStake: balance too low")
343345 else {
344346 let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), usdnFromDecimals(amountOfQuoteAsset)], nil)
345347 if ((unstake == unstake))
346348 then (((((((updateUserRewards(_staker, stakerEarned, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateFreeBalance(-(amountOfQuoteAsset))) ++ updateUserBalance(_staker, -(vAmount))) ++ updateTotalSupply(-(vAmount))) ++ setUserWithdrawParams(_staker, newLastWithdrawnDate, newWithdrawnInPeriod)) ++ [ScriptTransfer(i.caller, usdnFromDecimals(amountOfQuoteAsset), quoteAsset())])
347349 else throw("Strict value is not equal to itself.")
348350 }
349351 }
350352 }
351353 }
352354
353355
354356
355357 @Callable(i)
356358 func withdrawRewards () = {
357359 let _staker = toString(i.caller)
358- let $t01326013405 = updateReward(_staker, 0)
359- let newRewardPerTokenStored = $t01326013405._1
360- let newLastUpdateTime = $t01326013405._2
361- let stakerEarned = $t01326013405._3
362- let stakerRewardPerTokenPaid = $t01326013405._4
360+ let $t01348413629 = updateReward(_staker, 0)
361+ let newRewardPerTokenStored = $t01348413629._1
362+ let newLastUpdateTime = $t01348413629._2
363+ let stakerEarned = $t01348413629._3
364+ let stakerRewardPerTokenPaid = $t01348413629._4
363365 if (if ((0 >= stakerEarned))
364366 then true
365367 else !(initialized()))
366368 then throw("No reward: Vault")
367369 else ((((updateUserRewards(_staker, 0, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateRewardBalance(-(stakerEarned))) ++ [ScriptTransfer(i.caller, stakerEarned, governanceAsset())])
368370 }
369371
370372
371373
372374 @Callable(i)
373375 func addFree () = {
374376 let _amount = usdnToDecimals(i.payments[0].amount)
375377 if (if (if (if ((i.payments[0].assetId != quoteAsset()))
376378 then true
377379 else (size(i.payments) != 1))
378380 then true
379381 else !(initialized()))
380382 then true
381383 else !(if (isWhitelist(toString(i.caller)))
382384 then true
383385 else (i.caller == adminAddress())))
384386 then throw("Invalid addFree params")
385387 else {
386388 let newRate = computeNewRate(_amount)
387389 let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), usdnFromDecimals(_amount))])
388390 if ((stake == stake))
389391 then (updateFreeBalance(_amount) ++ updateRate(newRate))
390392 else throw("Strict value is not equal to itself.")
391393 }
392394 }
393395
394396
395397
396398 @Callable(i)
397399 func addLocked () = {
398400 let _amount = usdnToDecimals(i.payments[0].amount)
399401 if (if (if (if ((i.payments[0].assetId != quoteAsset()))
400402 then true
401403 else (size(i.payments) != 1))
402404 then true
403405 else !(initialized()))
404406 then true
405407 else !(if (isWhitelist(toString(i.caller)))
406408 then true
407409 else (i.caller == adminAddress())))
408410 then throw("Invalid addLocked params")
409411 else {
410412 let unstake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), usdnFromDecimals(_amount))])
411413 if ((unstake == unstake))
412414 then updateLockedBalance(_amount)
413415 else throw("Strict value is not equal to itself.")
414416 }
415417 }
416418
417419
418420
419421 @Callable(i)
420422 func exchangeFreeAndLocked (_amount) = if (if (!(initialized()))
421423 then true
422- else !(isWhitelist(toString(i.caller))))
424+ else if (!(isWhitelist(toString(i.caller))))
425+ then (i.caller != adminAddress())
426+ else false)
423427 then throw("Invalid exchangeFreeAndLocked params")
424428 else {
425429 let amountOfQuoteAsset = usdnToDecimals(_amount)
426430 let newRate = computeNewRate(-(amountOfQuoteAsset))
427431 ((updateLockedBalance(amountOfQuoteAsset) ++ updateFreeBalance(-(amountOfQuoteAsset))) ++ updateRate(newRate))
428432 }
429433
430434
431435
432436 @Callable(i)
433437 func withdrawLocked (_amount) = if (if (if (!(initialized()))
434438 then true
435439 else (0 >= _amount))
436440 then true
437441 else !(isWhitelist(toString(i.caller))))
438442 then throw("Invalid withdrawLocked params")
439443 else {
440444 let amountOfQuoteAsset = usdnToDecimals(_amount)
441445 let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), usdnFromDecimals(amountOfQuoteAsset)], nil)
442446 if ((unstake == unstake))
443447 then (updateLockedBalance(-(amountOfQuoteAsset)) ++ [ScriptTransfer(i.caller, usdnFromDecimals(amountOfQuoteAsset), quoteAsset())])
444448 else throw("Strict value is not equal to itself.")
445449 }
446450
447451
448452
449453 @Callable(i)
450454 func addRewards () = if (if (if ((i.payments[0].assetId != governanceAsset()))
451455 then true
452456 else (size(i.payments) != 1))
453457 then true
454458 else !(initialized()))
455459 then throw("Invalid addRewards params")
456460 else {
457461 let _reward = i.payments[0].amount
458462 let newRewardPerTokenStored = updateReward(NO_ADDRESS, NO_STAKER)._1
459463 let timestamp = currentTimestampSec()
460464 let newRewardRate = if ((timestamp > periodFinish()))
461465 then (_reward / DURATION)
462466 else {
463467 let remainingTime = (periodFinish() - timestamp)
464468 let leftover = (rewardRate() * remainingTime)
465469 ((_reward + leftover) / DURATION)
466470 }
467471 (((updateRewardRate(newRewardRate) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateRewardBalance(_reward)) ++ updateTime(timestamp, (timestamp + DURATION)))
468472 }
469473
470474
471475
472476 @Callable(i)
473477 func ackRewards () = {
474478 let profitResp = invoke(managerAddress(), "claimProfit", [toBase58String(quoteAsset())], nil)
475479 if ((profitResp == profitResp))
476480 then {
477481 let profit = match profitResp {
478482 case p: Int =>
479483 usdnToDecimals(p)
480484 case _ =>
481485 throw("Invalid claimProfit response")
482486 }
483487 let result = if ((profit > 0))
484488 then {
485489 let newRate = computeNewRate(profit)
486490 let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), usdnFromDecimals(profit))])
487491 if ((stake == stake))
488492 then (updateFreeBalance(profit) ++ updateRate(newRate))
489493 else throw("Strict value is not equal to itself.")
490494 }
491495 else nil
492496 if ((result == result))
493497 then result
494498 else throw("Strict value is not equal to itself.")
495499 }
496500 else throw("Strict value is not equal to itself.")
497501 }
498502
499503
500504
501505 @Callable(i)
502506 func view_reward (_staker) = {
503507 let balance = balanceOf(_staker)
504508 let depositedAmount = muld(averageRate(_staker), balance)
505509 let currentAmount = muld(rate(), balance)
506510 let earnedQuote = (currentAmount - depositedAmount)
507511 throw(toString(earnedQuote))
508512 }
509513
510514
511515
512516 @Callable(i)
513517 func view_stakingReward (_staker) = {
514518 let stakerEarned = updateReward(_staker, 0)._3
515519 throw(toString(usdnFromDecimals(stakerEarned)))
516520 }
517521
518522
519523
520524 @Callable(i)
521525 func view_withdrawLimit (_staker) = {
522526 let withdrawLimitLeft = getWithdrawLimitLeft(_staker)._2
523527 let limitInUsdn = usdnFromDecimals(muld(withdrawLimitLeft, rate()))
524528 throw(toString(limitInUsdn))
525529 }
526530
527531
528532 @Verifier(tx)
529533 func verify () = {
530534 let coordinatorStr = getString(this, k_coordinatorAddress)
531535 if (isDefined(coordinatorStr))
532536 then {
533537 let admin = getString(addressFromStringValue(value(coordinatorStr)), k_admin_address)
534538 if (isDefined(admin))
535539 then valueOrElse(getBoolean(addressFromStringValue(value(admin)), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false)
536540 else throw("unable to verify: admin not set in coordinator")
537541 }
538542 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
539543 }
540544

github/deemru/w8io/169f3d6 
75.38 ms