tx · Fg769VxgVGD1eyQm9t5TBbnuSWeEnEkQsDSpstSqGSZZ

3N4QWZXfZqNf284CJVbtxzCerqARoALxJEy:  -0.03700000 Waves

2022.10.07 18:16 [2262083] smart account 3N4QWZXfZqNf284CJVbtxzCerqARoALxJEy > SELF 0.00000000 Waves

{ "type": 13, "id": "Fg769VxgVGD1eyQm9t5TBbnuSWeEnEkQsDSpstSqGSZZ", "fee": 3700000, "feeAssetId": null, "timestamp": 1665155801951, "version": 2, "chainId": 84, "sender": "3N4QWZXfZqNf284CJVbtxzCerqARoALxJEy", "senderPublicKey": "GzEvTfwa3251fRwyTL99QzUmkDGBdn4cNr2mR6XQ1UmR", "proofs": [ "Yb5ZoPRvCDGxXhn4e3BXRsUtMnXv9v37rZwQvcr8UNAUYgmyipcnz8Y43mga3GxoJmGWyCoy6xD7FseRReeQqHU" ], "script": "base64:BgIgCAISAwoBCBIAEgMKAQESABIAEgASAwoBCBIDCgEIEgA2AA1rX3RvdGFsU3VwcGx5Ag1rX3RvdGFsU3VwcGx5AA9rX3Jld2FyZEJhbGFuY2UCD2tfcmV3YXJkQmFsYW5jZQAQa19sYXN0VXBkYXRlVGltZQIQa19sYXN0VXBkYXRlVGltZQAWa19yZXdhcmRQZXJUb2tlblN0b3JlZAIWa19yZXdhcmRQZXJUb2tlblN0b3JlZAAMa19yZXdhcmRSYXRlAgxrX3Jld2FyZFJhdGUADmtfcGVyaW9kRmluaXNoAg5rX3BlcmlvZEZpbmlzaAAJa19iYWxhbmNlAglrX2JhbGFuY2UAFGtfdXNlclJld2FyZFBlclRva2VuAhRrX3VzZXJSZXdhcmRQZXJUb2tlbgAMa191c2VyUmV3YXJkAgxrX3VzZXJSZXdhcmQADWtfaW5pdGlhbGl6ZWQCDWtfaW5pdGlhbGl6ZWQAFGtfY29vcmRpbmF0b3JBZGRyZXNzAhRrX2Nvb3JkaW5hdG9yQWRkcmVzcwASa19nb3Zlcm5hbmNlX2Fzc2V0AgtrX2dvdl9hc3NldAANa19x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v41SP13UBuFmCXvLzmkHT92 Next: J6qmvhu69AkJBPVTCPWy2MkQKD8MZA5ETQhGdBtFJtSy Diff:
OldNewDifferences
267267
268268 @Callable(i)
269269 func ackRewards () = {
270- let currentBalance = usdnToDecimals(assetBalance(this, quoteAsset()))
271- let _rewardBalance = rewardBalance()
272- let rewardDelta = (currentBalance - _rewardBalance)
270+ let rewardDelta = usdnToDecimals(assetBalance(this, quoteAsset()))
273271 if ((0 >= rewardDelta))
274272 then throw("Invalid ackRewards params")
275273 else {
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_lastUpdateTime = "k_lastUpdateTime"
99
1010 let k_rewardPerTokenStored = "k_rewardPerTokenStored"
1111
1212 let k_rewardRate = "k_rewardRate"
1313
1414 let k_periodFinish = "k_periodFinish"
1515
1616 let k_balance = "k_balance"
1717
1818 let k_userRewardPerToken = "k_userRewardPerToken"
1919
2020 let k_userReward = "k_userReward"
2121
2222 let k_initialized = "k_initialized"
2323
2424 let k_coordinatorAddress = "k_coordinatorAddress"
2525
2626 let k_governance_asset = "k_gov_asset"
2727
2828 let k_quote_asset = "k_quote_asset"
2929
3030 let k_admin_public_key = "k_admin_public_key"
3131
3232 let k_manager_address = "k_manager_address"
3333
3434 func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set")
3535
3636
3737 func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key))
3838
3939
4040 func governanceAsset () = fromBase58String(getStringValue(coordinator(), k_governance_asset))
4141
4242
4343 func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset))
4444
4545
4646 func managerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_manager_address)), "Manager not set")
4747
4848
4949 let DECIMAL_UNIT = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10))
5050
5151 let DURATION = ((60 * 60) * 24)
5252
5353 let NO_ADDRESS = ""
5454
5555 let NO_STAKER = 0
5656
5757 func usdnFromDecimals (_amount) = (_amount / 100)
5858
5959
6060 func usdnToDecimals (_amount) = (_amount * 100)
6161
6262
6363 func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN)
6464
6565
6666 func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN)
6767
6868
6969 func abs (_x) = if ((_x > 0))
7070 then _x
7171 else -(_x)
7272
7373
7474 func minv (_x,_y) = if ((_x > _y))
7575 then _y
7676 else _x
7777
7878
7979 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
8080
8181
8282 func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k))
8383
8484
8585 func int0 (k) = valueOrElse(getInteger(this, k), 0)
8686
8787
8888 func totalSupply () = int0(k_totalSupply)
8989
9090
9191 func rewardPerTokenStored () = int0(k_rewardPerTokenStored)
9292
9393
9494 func lastUpdateTime () = int0(k_lastUpdateTime)
9595
9696
9797 func rewardRate () = int0(k_rewardRate)
9898
9999
100100 func periodFinish () = int0(k_periodFinish)
101101
102102
103103 func rewardBalance () = int0(k_rewardBalance)
104104
105105
106106 func rewards (_staker) = int0(toCompositeKey(k_userReward, _staker))
107107
108108
109109 func userRewardPerTokenPaid (_staker) = int0(toCompositeKey(k_userRewardPerToken, _staker))
110110
111111
112112 func balanceOf (_staker) = int0(toCompositeKey(k_balance, _staker))
113113
114114
115115 func initialized () = valueOrElse(getBoolean(this, k_initialized), false)
116116
117117
118118 func updateRewardBalance (_delta) = [IntegerEntry(k_rewardBalance, (rewardBalance() + _delta))]
119119
120120
121121 func updateRewardRate (_rewardRate) = [IntegerEntry(k_rewardRate, _rewardRate)]
122122
123123
124124 func updateTime (_lastUpdateTime,_periodFinish) = [IntegerEntry(k_lastUpdateTime, _lastUpdateTime), IntegerEntry(k_periodFinish, _periodFinish)]
125125
126126
127127 func updateRewardPerTokenStored (_rewardPerTokenStored) = [IntegerEntry(k_rewardPerTokenStored, _rewardPerTokenStored)]
128128
129129
130130 func updateUserRewards (_staker,_reward,_userRewardPerToken) = [IntegerEntry(toCompositeKey(k_userReward, _staker), _reward), IntegerEntry(toCompositeKey(k_userRewardPerToken, _staker), _userRewardPerToken)]
131131
132132
133133 func updateBalance (_staker,_delta) = [IntegerEntry(toCompositeKey(k_balance, _staker), (balanceOf(_staker) + _delta)), IntegerEntry(k_totalSupply, (totalSupply() + _delta))]
134134
135135
136136 func currentTimestampSec () = (lastBlock.timestamp / 1000)
137137
138138
139139 func lastTimeRewardApplicable () = minv(currentTimestampSec(), periodFinish())
140140
141141
142142 func rewardPerToken (_balanceDelta) = if (((totalSupply() + _balanceDelta) == 0))
143143 then rewardPerTokenStored()
144144 else {
145145 let timeInterval = (lastTimeRewardApplicable() - lastUpdateTime())
146146 let actualTimeInterval = if ((0 > timeInterval))
147147 then 0
148148 else timeInterval
149149 let diff = divd((rewardRate() * actualTimeInterval), (totalSupply() + _balanceDelta))
150150 (rewardPerTokenStored() + diff)
151151 }
152152
153153
154154 func earned (_staker,_balanceDelta) = {
155155 let rewardDelta = (rewardPerToken(_balanceDelta) - userRewardPerTokenPaid(_staker))
156156 (muld((balanceOf(_staker) + _balanceDelta), rewardDelta) + rewards(_staker))
157157 }
158158
159159
160160 func updateReward (_staker,_balanceDelta) = {
161161 let newRewardPerTokenStored = rewardPerToken(_balanceDelta)
162162 let newLastUpdateTime = currentTimestampSec()
163163 let $t050205212 = if ((_staker != ""))
164164 then $Tuple2(earned(_staker, _balanceDelta), newRewardPerTokenStored)
165165 else $Tuple2(0, 0)
166166 let stakerEarned = $t050205212._1
167167 let stakerRewardPerTokenPaid = $t050205212._2
168168 $Tuple4(newRewardPerTokenStored, newLastUpdateTime, stakerEarned, stakerRewardPerTokenPaid)
169169 }
170170
171171
172172 @Callable(i)
173173 func initialize (_coordinator) = if (initialized())
174174 then throw("Already initialized")
175175 else [StringEntry(k_coordinatorAddress, _coordinator), BooleanEntry(k_initialized, true)]
176176
177177
178178
179179 @Callable(i)
180180 func stake () = {
181181 let _staker = toString(i.caller)
182182 let _amount = i.payments[0].amount
183183 if (if ((i.payments[0].assetId != governanceAsset()))
184184 then true
185185 else !(initialized()))
186186 then throw("Invalid call to stake")
187187 else {
188188 let $t058686033 = updateReward(_staker, 0)
189189 let newRewardPerTokenStored = $t058686033._1
190190 let newLastUpdateTime = $t058686033._2
191191 let stakerEarned = $t058686033._3
192192 let stakerRewardPerTokenPaid = $t058686033._4
193193 (((updateUserRewards(_staker, stakerEarned, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateBalance(_staker, _amount))
194194 }
195195 }
196196
197197
198198
199199 @Callable(i)
200200 func unStake (_amount) = {
201201 let _staker = toString(i.caller)
202202 if (if (if ((_amount > balanceOf(_staker)))
203203 then true
204204 else (i.payments != nil))
205205 then true
206206 else !(initialized()))
207207 then throw("Invalid unStake parameters")
208208 else {
209209 let $t065646729 = updateReward(_staker, 0)
210210 let newRewardPerTokenStored = $t065646729._1
211211 let newLastUpdateTime = $t065646729._2
212212 let stakerEarned = $t065646729._3
213213 let stakerRewardPerTokenPaid = $t065646729._4
214214 ((((updateUserRewards(_staker, stakerEarned, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateBalance(_staker, -(_amount))) ++ [ScriptTransfer(i.caller, _amount, governanceAsset())])
215215 }
216216 }
217217
218218
219219
220220 @Callable(i)
221221 func withdrawRewards () = {
222222 let _staker = toString(i.caller)
223223 let $t072057350 = updateReward(_staker, 0)
224224 let newRewardPerTokenStored = $t072057350._1
225225 let newLastUpdateTime = $t072057350._2
226226 let stakerEarned = $t072057350._3
227227 let stakerRewardPerTokenPaid = $t072057350._4
228228 if (if ((0 >= stakerEarned))
229229 then true
230230 else !(initialized()))
231231 then throw("No reward")
232232 else {
233233 let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), usdnFromDecimals(stakerEarned)], nil)
234234 if ((unstake == unstake))
235235 then ((((updateUserRewards(_staker, 0, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateRewardBalance(-(stakerEarned))) ++ [ScriptTransfer(i.caller, usdnFromDecimals(stakerEarned), quoteAsset())])
236236 else throw("Strict value is not equal to itself.")
237237 }
238238 }
239239
240240
241241
242242 @Callable(i)
243243 func addRewards () = if (if ((i.payments[0].assetId != quoteAsset()))
244244 then true
245245 else !(initialized()))
246246 then throw("Invalid addRewards params")
247247 else {
248248 let _reward = usdnToDecimals(i.payments[0].amount)
249249 let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), usdnFromDecimals(_reward))])
250250 if ((stake == stake))
251251 then {
252252 let newRewardPerTokenStored = updateReward(NO_ADDRESS, NO_STAKER)._1
253253 let timestamp = currentTimestampSec()
254254 let newRewardRate = if ((timestamp > periodFinish()))
255255 then (_reward / DURATION)
256256 else {
257257 let remainingTime = (periodFinish() - timestamp)
258258 let leftover = (rewardRate() * remainingTime)
259259 ((_reward + leftover) / DURATION)
260260 }
261261 (((updateRewardRate(newRewardRate) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateRewardBalance(_reward)) ++ updateTime(timestamp, (timestamp + DURATION)))
262262 }
263263 else throw("Strict value is not equal to itself.")
264264 }
265265
266266
267267
268268 @Callable(i)
269269 func ackRewards () = {
270- let currentBalance = usdnToDecimals(assetBalance(this, quoteAsset()))
271- let _rewardBalance = rewardBalance()
272- let rewardDelta = (currentBalance - _rewardBalance)
270+ let rewardDelta = usdnToDecimals(assetBalance(this, quoteAsset()))
273271 if ((0 >= rewardDelta))
274272 then throw("Invalid ackRewards params")
275273 else {
276274 let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), usdnFromDecimals(rewardDelta))])
277275 if ((stake == stake))
278276 then {
279277 let _reward = rewardDelta
280278 let newRewardPerTokenStored = updateReward(NO_ADDRESS, NO_STAKER)._1
281279 let timestamp = currentTimestampSec()
282280 let newRewardRate = if ((timestamp > periodFinish()))
283281 then (_reward / DURATION)
284282 else {
285283 let remainingTime = (periodFinish() - timestamp)
286284 let leftover = (rewardRate() * remainingTime)
287285 ((_reward + leftover) / DURATION)
288286 }
289287 (((updateRewardRate(newRewardRate) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateRewardBalance(_reward)) ++ updateTime(timestamp, (timestamp + DURATION)))
290288 }
291289 else throw("Strict value is not equal to itself.")
292290 }
293291 }
294292
295293
296294
297295 @Callable(i)
298296 func view_reward (_staker) = {
299297 let stakerEarned = updateReward(_staker, 0)._3
300298 throw(toString(usdnFromDecimals(stakerEarned)))
301299 }
302300
303301
304302
305303 @Callable(i)
306304 func computeReward (_staker) = {
307305 let stakerEarned = updateReward(_staker, 0)._3
308306 $Tuple2(nil, stakerEarned)
309307 }
310308
311309
312310
313311 @Callable(i)
314312 func migrateLiquidity () = {
315313 let amount = usdnFromDecimals(rewardBalance())
316314 let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), amount)])
317315 if ((stake == stake))
318316 then nil
319317 else throw("Strict value is not equal to itself.")
320318 }
321319
322320
323321 @Verifier(tx)
324322 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey())
325323

github/deemru/w8io/026f985 
38.11 ms