tx · 9EiPpCbJrmfoBsvSPeNE9LiBUTc12cSvpP197n2DDXWh

3N4QWZXfZqNf284CJVbtxzCerqARoALxJEy:  -0.03700000 Waves

2023.03.04 14:23 [2475242] smart account 3N4QWZXfZqNf284CJVbtxzCerqARoALxJEy > SELF 0.00000000 Waves

{ "type": 13, "id": "9EiPpCbJrmfoBsvSPeNE9LiBUTc12cSvpP197n2DDXWh", "fee": 3700000, "feeAssetId": null, "timestamp": 1677929002834, "version": 2, "chainId": 84, "sender": "3N4QWZXfZqNf284CJVbtxzCerqARoALxJEy", "senderPublicKey": "GzEvTfwa3251fRwyTL99QzUmkDGBdn4cNr2mR6XQ1UmR", "proofs": [ "dZ7ZH8zRdNUyWj8m6wggRHhmRSZEgv1Gob2CsPCphzPQ1p6hn71CijEB8dLb1fFrPz1fX5PfWgNBGQX8mAM5nrU" ], "script": "base64:BgIeCAISAwoBCBIAEgMKAQESABIAEgASAwoBCBIDCgEINQANa190b3RhbFN1cHBseQINa190b3RhbFN1cHBseQAPa19yZXdhcmRCYWxhbmNlAg9rX3Jld2FyZEJhbGFuY2UAEGtfbGFzdFVwZGF0ZVRpbWUCEGtfbGFzdFVwZGF0ZVRpbWUAFmtfcmV3YXJkUGVyVG9rZW5TdG9yZWQCFmtfcmV3YXJkUGVyVG9rZW5TdG9yZWQADGtfcmV3YXJkUmF0ZQIMa19yZXdhcmRSYXRlAA5rX3BlcmlvZEZpbmlzaAIOa19wZXJpb2RGaW5pc2gACWtfYmFsYW5jZQIJa19iYWxhbmNlABRrX3VzZXJSZXdhcmRQZXJUb2tlbgIUa191c2VyUmV3YXJkUGVyVG9rZW4ADGtfdXNlclJld2FyZAIMa191c2VyUmV3YXJkAA1rX2luaXRpYWxpemVkAg1rX2luaXRpYWxpemVkABRrX2Nvb3JkaW5hdG9yQWRkcmVzcwIUa19jb29yZGluYXRvckFkZHJlc3MAEmtfZ292ZXJuYW5jZV9hc3NldAILa19nb3ZfYXNzZXQADmtfcmV3YXJkX2Fzc2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S2V5ImUi1Q==", "height": 2475242, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J6qmvhu69AkJBPVTCPWy2MkQKD8MZA5ETQhGdBtFJtSy Next: none Diff:
OldNewDifferences
2525
2626 let k_governance_asset = "k_gov_asset"
2727
28-let k_quote_asset = "k_quote_asset"
28+let k_reward_asset = "k_reward_asset"
2929
30-let k_admin_public_key = "k_admin_public_key"
30+let k_admin_address = "k_admin_address"
3131
3232 let k_manager_address = "k_manager_address"
3333
3434 func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set")
3535
3636
37-func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key))
38-
39-
4037 func governanceAsset () = fromBase58String(getStringValue(coordinator(), k_governance_asset))
4138
4239
43-func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset))
40+func rewardAsset () = fromBase58String(getStringValue(coordinator(), k_reward_asset))
4441
4542
4643 func managerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_manager_address)), "Manager not set")
160157 func updateReward (_staker,_balanceDelta) = {
161158 let newRewardPerTokenStored = rewardPerToken(_balanceDelta)
162159 let newLastUpdateTime = currentTimestampSec()
163- let $t050205212 = if ((_staker != ""))
160+ let $t049255117 = if ((_staker != ""))
164161 then $Tuple2(earned(_staker, _balanceDelta), newRewardPerTokenStored)
165162 else $Tuple2(0, 0)
166- let stakerEarned = $t050205212._1
167- let stakerRewardPerTokenPaid = $t050205212._2
163+ let stakerEarned = $t049255117._1
164+ let stakerRewardPerTokenPaid = $t049255117._2
168165 $Tuple4(newRewardPerTokenStored, newLastUpdateTime, stakerEarned, stakerRewardPerTokenPaid)
169166 }
170167
171168
172169 @Callable(i)
173-func initialize (_coordinator) = if (initialized())
174- then throw("Already initialized")
175- else [StringEntry(k_coordinatorAddress, _coordinator), BooleanEntry(k_initialized, true)]
170+func initialize (_coordinator) = if (if (initialized())
171+ then true
172+ else (i.caller != this))
173+ then throw("Unable to initialize")
174+ else [StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator))), BooleanEntry(k_initialized, true)]
176175
177176
178177
185184 else !(initialized()))
186185 then throw("Invalid call to stake")
187186 else {
188- let $t058686033 = updateReward(_staker, 0)
189- let newRewardPerTokenStored = $t058686033._1
190- let newLastUpdateTime = $t058686033._2
191- let stakerEarned = $t058686033._3
192- let stakerRewardPerTokenPaid = $t058686033._4
187+ let $t058295994 = updateReward(_staker, 0)
188+ let newRewardPerTokenStored = $t058295994._1
189+ let newLastUpdateTime = $t058295994._2
190+ let stakerEarned = $t058295994._3
191+ let stakerRewardPerTokenPaid = $t058295994._4
193192 (((updateUserRewards(_staker, stakerEarned, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateBalance(_staker, _amount))
194193 }
195194 }
206205 else !(initialized()))
207206 then throw("Invalid unStake parameters")
208207 else {
209- let $t065646729 = updateReward(_staker, 0)
210- let newRewardPerTokenStored = $t065646729._1
211- let newLastUpdateTime = $t065646729._2
212- let stakerEarned = $t065646729._3
213- let stakerRewardPerTokenPaid = $t065646729._4
208+ let $t065256690 = updateReward(_staker, 0)
209+ let newRewardPerTokenStored = $t065256690._1
210+ let newLastUpdateTime = $t065256690._2
211+ let stakerEarned = $t065256690._3
212+ let stakerRewardPerTokenPaid = $t065256690._4
214213 ((((updateUserRewards(_staker, stakerEarned, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateBalance(_staker, -(_amount))) ++ [ScriptTransfer(i.caller, _amount, governanceAsset())])
215214 }
216215 }
220219 @Callable(i)
221220 func withdrawRewards () = {
222221 let _staker = toString(i.caller)
223- let $t072057350 = updateReward(_staker, 0)
224- let newRewardPerTokenStored = $t072057350._1
225- let newLastUpdateTime = $t072057350._2
226- let stakerEarned = $t072057350._3
227- let stakerRewardPerTokenPaid = $t072057350._4
222+ let $t071667311 = updateReward(_staker, 0)
223+ let newRewardPerTokenStored = $t071667311._1
224+ let newLastUpdateTime = $t071667311._2
225+ let stakerEarned = $t071667311._3
226+ let stakerRewardPerTokenPaid = $t071667311._4
228227 if (if ((0 >= stakerEarned))
229228 then true
230229 else !(initialized()))
231230 then throw("No reward")
232231 else {
233- let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), usdnFromDecimals(stakerEarned)], nil)
232+ let unstake = invoke(managerAddress(), "withdraw", [toBase58String(rewardAsset()), usdnFromDecimals(stakerEarned)], nil)
234233 if ((unstake == unstake))
235- then ((((updateUserRewards(_staker, 0, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateRewardBalance(-(stakerEarned))) ++ [ScriptTransfer(i.caller, usdnFromDecimals(stakerEarned), quoteAsset())])
234+ then ((((updateUserRewards(_staker, 0, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateRewardBalance(-(stakerEarned))) ++ [ScriptTransfer(i.caller, usdnFromDecimals(stakerEarned), rewardAsset())])
236235 else throw("Strict value is not equal to itself.")
237236 }
238237 }
240239
241240
242241 @Callable(i)
243-func addRewards () = if (if ((i.payments[0].assetId != quoteAsset()))
242+func addRewards () = if (if ((i.payments[0].assetId != rewardAsset()))
244243 then true
245244 else !(initialized()))
246245 then throw("Invalid addRewards params")
247246 else {
248247 let _reward = usdnToDecimals(i.payments[0].amount)
249- let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), usdnFromDecimals(_reward))])
248+ let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(rewardAsset(), usdnFromDecimals(_reward))])
250249 if ((stake == stake))
251250 then {
252251 let newRewardPerTokenStored = updateReward(NO_ADDRESS, NO_STAKER)._1
267266
268267 @Callable(i)
269268 func ackRewards () = {
270- let rewardDelta = usdnToDecimals(assetBalance(this, quoteAsset()))
269+ let rewardDelta = usdnToDecimals(assetBalance(this, rewardAsset()))
271270 if (((1 * DECIMAL_UNIT) > rewardDelta))
272271 then nil
273272 else {
274- let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), usdnFromDecimals(rewardDelta))])
273+ let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(rewardAsset(), usdnFromDecimals(rewardDelta))])
275274 if ((stake == stake))
276275 then {
277276 let _reward = rewardDelta
307306 }
308307
309308
310-
311-@Callable(i)
312-func migrateLiquidity () = {
313- let amount = usdnFromDecimals(rewardBalance())
314- let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), amount)])
315- if ((stake == stake))
316- then nil
317- else throw("Strict value is not equal to itself.")
309+@Verifier(tx)
310+func verify () = {
311+ let coordinatorStr = getString(this, k_coordinatorAddress)
312+ if (isDefined(coordinatorStr))
313+ then {
314+ let admin = getString(addressFromStringValue(value(coordinatorStr)), k_admin_address)
315+ if (isDefined(admin))
316+ then valueOrElse(getBoolean(addressFromStringValue(value(admin)), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false)
317+ else throw("unable to verify: admin not set in coordinator")
318+ }
319+ else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
318320 }
319-
320-
321-@Verifier(tx)
322-func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey())
323321
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
28-let k_quote_asset = "k_quote_asset"
28+let k_reward_asset = "k_reward_asset"
2929
30-let k_admin_public_key = "k_admin_public_key"
30+let k_admin_address = "k_admin_address"
3131
3232 let k_manager_address = "k_manager_address"
3333
3434 func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set")
3535
3636
37-func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key))
38-
39-
4037 func governanceAsset () = fromBase58String(getStringValue(coordinator(), k_governance_asset))
4138
4239
43-func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset))
40+func rewardAsset () = fromBase58String(getStringValue(coordinator(), k_reward_asset))
4441
4542
4643 func managerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_manager_address)), "Manager not set")
4744
4845
4946 let DECIMAL_UNIT = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10))
5047
5148 let DURATION = ((60 * 60) * 24)
5249
5350 let NO_ADDRESS = ""
5451
5552 let NO_STAKER = 0
5653
5754 func usdnFromDecimals (_amount) = (_amount / 100)
5855
5956
6057 func usdnToDecimals (_amount) = (_amount * 100)
6158
6259
6360 func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN)
6461
6562
6663 func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN)
6764
6865
6966 func abs (_x) = if ((_x > 0))
7067 then _x
7168 else -(_x)
7269
7370
7471 func minv (_x,_y) = if ((_x > _y))
7572 then _y
7673 else _x
7774
7875
7976 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
8077
8178
8279 func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k))
8380
8481
8582 func int0 (k) = valueOrElse(getInteger(this, k), 0)
8683
8784
8885 func totalSupply () = int0(k_totalSupply)
8986
9087
9188 func rewardPerTokenStored () = int0(k_rewardPerTokenStored)
9289
9390
9491 func lastUpdateTime () = int0(k_lastUpdateTime)
9592
9693
9794 func rewardRate () = int0(k_rewardRate)
9895
9996
10097 func periodFinish () = int0(k_periodFinish)
10198
10299
103100 func rewardBalance () = int0(k_rewardBalance)
104101
105102
106103 func rewards (_staker) = int0(toCompositeKey(k_userReward, _staker))
107104
108105
109106 func userRewardPerTokenPaid (_staker) = int0(toCompositeKey(k_userRewardPerToken, _staker))
110107
111108
112109 func balanceOf (_staker) = int0(toCompositeKey(k_balance, _staker))
113110
114111
115112 func initialized () = valueOrElse(getBoolean(this, k_initialized), false)
116113
117114
118115 func updateRewardBalance (_delta) = [IntegerEntry(k_rewardBalance, (rewardBalance() + _delta))]
119116
120117
121118 func updateRewardRate (_rewardRate) = [IntegerEntry(k_rewardRate, _rewardRate)]
122119
123120
124121 func updateTime (_lastUpdateTime,_periodFinish) = [IntegerEntry(k_lastUpdateTime, _lastUpdateTime), IntegerEntry(k_periodFinish, _periodFinish)]
125122
126123
127124 func updateRewardPerTokenStored (_rewardPerTokenStored) = [IntegerEntry(k_rewardPerTokenStored, _rewardPerTokenStored)]
128125
129126
130127 func updateUserRewards (_staker,_reward,_userRewardPerToken) = [IntegerEntry(toCompositeKey(k_userReward, _staker), _reward), IntegerEntry(toCompositeKey(k_userRewardPerToken, _staker), _userRewardPerToken)]
131128
132129
133130 func updateBalance (_staker,_delta) = [IntegerEntry(toCompositeKey(k_balance, _staker), (balanceOf(_staker) + _delta)), IntegerEntry(k_totalSupply, (totalSupply() + _delta))]
134131
135132
136133 func currentTimestampSec () = (lastBlock.timestamp / 1000)
137134
138135
139136 func lastTimeRewardApplicable () = minv(currentTimestampSec(), periodFinish())
140137
141138
142139 func rewardPerToken (_balanceDelta) = if (((totalSupply() + _balanceDelta) == 0))
143140 then rewardPerTokenStored()
144141 else {
145142 let timeInterval = (lastTimeRewardApplicable() - lastUpdateTime())
146143 let actualTimeInterval = if ((0 > timeInterval))
147144 then 0
148145 else timeInterval
149146 let diff = divd((rewardRate() * actualTimeInterval), (totalSupply() + _balanceDelta))
150147 (rewardPerTokenStored() + diff)
151148 }
152149
153150
154151 func earned (_staker,_balanceDelta) = {
155152 let rewardDelta = (rewardPerToken(_balanceDelta) - userRewardPerTokenPaid(_staker))
156153 (muld((balanceOf(_staker) + _balanceDelta), rewardDelta) + rewards(_staker))
157154 }
158155
159156
160157 func updateReward (_staker,_balanceDelta) = {
161158 let newRewardPerTokenStored = rewardPerToken(_balanceDelta)
162159 let newLastUpdateTime = currentTimestampSec()
163- let $t050205212 = if ((_staker != ""))
160+ let $t049255117 = if ((_staker != ""))
164161 then $Tuple2(earned(_staker, _balanceDelta), newRewardPerTokenStored)
165162 else $Tuple2(0, 0)
166- let stakerEarned = $t050205212._1
167- let stakerRewardPerTokenPaid = $t050205212._2
163+ let stakerEarned = $t049255117._1
164+ let stakerRewardPerTokenPaid = $t049255117._2
168165 $Tuple4(newRewardPerTokenStored, newLastUpdateTime, stakerEarned, stakerRewardPerTokenPaid)
169166 }
170167
171168
172169 @Callable(i)
173-func initialize (_coordinator) = if (initialized())
174- then throw("Already initialized")
175- else [StringEntry(k_coordinatorAddress, _coordinator), BooleanEntry(k_initialized, true)]
170+func initialize (_coordinator) = if (if (initialized())
171+ then true
172+ else (i.caller != this))
173+ then throw("Unable to initialize")
174+ else [StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator))), BooleanEntry(k_initialized, true)]
176175
177176
178177
179178 @Callable(i)
180179 func stake () = {
181180 let _staker = toString(i.caller)
182181 let _amount = i.payments[0].amount
183182 if (if ((i.payments[0].assetId != governanceAsset()))
184183 then true
185184 else !(initialized()))
186185 then throw("Invalid call to stake")
187186 else {
188- let $t058686033 = updateReward(_staker, 0)
189- let newRewardPerTokenStored = $t058686033._1
190- let newLastUpdateTime = $t058686033._2
191- let stakerEarned = $t058686033._3
192- let stakerRewardPerTokenPaid = $t058686033._4
187+ let $t058295994 = updateReward(_staker, 0)
188+ let newRewardPerTokenStored = $t058295994._1
189+ let newLastUpdateTime = $t058295994._2
190+ let stakerEarned = $t058295994._3
191+ let stakerRewardPerTokenPaid = $t058295994._4
193192 (((updateUserRewards(_staker, stakerEarned, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateBalance(_staker, _amount))
194193 }
195194 }
196195
197196
198197
199198 @Callable(i)
200199 func unStake (_amount) = {
201200 let _staker = toString(i.caller)
202201 if (if (if ((_amount > balanceOf(_staker)))
203202 then true
204203 else (i.payments != nil))
205204 then true
206205 else !(initialized()))
207206 then throw("Invalid unStake parameters")
208207 else {
209- let $t065646729 = updateReward(_staker, 0)
210- let newRewardPerTokenStored = $t065646729._1
211- let newLastUpdateTime = $t065646729._2
212- let stakerEarned = $t065646729._3
213- let stakerRewardPerTokenPaid = $t065646729._4
208+ let $t065256690 = updateReward(_staker, 0)
209+ let newRewardPerTokenStored = $t065256690._1
210+ let newLastUpdateTime = $t065256690._2
211+ let stakerEarned = $t065256690._3
212+ let stakerRewardPerTokenPaid = $t065256690._4
214213 ((((updateUserRewards(_staker, stakerEarned, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateBalance(_staker, -(_amount))) ++ [ScriptTransfer(i.caller, _amount, governanceAsset())])
215214 }
216215 }
217216
218217
219218
220219 @Callable(i)
221220 func withdrawRewards () = {
222221 let _staker = toString(i.caller)
223- let $t072057350 = updateReward(_staker, 0)
224- let newRewardPerTokenStored = $t072057350._1
225- let newLastUpdateTime = $t072057350._2
226- let stakerEarned = $t072057350._3
227- let stakerRewardPerTokenPaid = $t072057350._4
222+ let $t071667311 = updateReward(_staker, 0)
223+ let newRewardPerTokenStored = $t071667311._1
224+ let newLastUpdateTime = $t071667311._2
225+ let stakerEarned = $t071667311._3
226+ let stakerRewardPerTokenPaid = $t071667311._4
228227 if (if ((0 >= stakerEarned))
229228 then true
230229 else !(initialized()))
231230 then throw("No reward")
232231 else {
233- let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), usdnFromDecimals(stakerEarned)], nil)
232+ let unstake = invoke(managerAddress(), "withdraw", [toBase58String(rewardAsset()), usdnFromDecimals(stakerEarned)], nil)
234233 if ((unstake == unstake))
235- then ((((updateUserRewards(_staker, 0, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateRewardBalance(-(stakerEarned))) ++ [ScriptTransfer(i.caller, usdnFromDecimals(stakerEarned), quoteAsset())])
234+ then ((((updateUserRewards(_staker, 0, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateRewardBalance(-(stakerEarned))) ++ [ScriptTransfer(i.caller, usdnFromDecimals(stakerEarned), rewardAsset())])
236235 else throw("Strict value is not equal to itself.")
237236 }
238237 }
239238
240239
241240
242241 @Callable(i)
243-func addRewards () = if (if ((i.payments[0].assetId != quoteAsset()))
242+func addRewards () = if (if ((i.payments[0].assetId != rewardAsset()))
244243 then true
245244 else !(initialized()))
246245 then throw("Invalid addRewards params")
247246 else {
248247 let _reward = usdnToDecimals(i.payments[0].amount)
249- let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), usdnFromDecimals(_reward))])
248+ let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(rewardAsset(), usdnFromDecimals(_reward))])
250249 if ((stake == stake))
251250 then {
252251 let newRewardPerTokenStored = updateReward(NO_ADDRESS, NO_STAKER)._1
253252 let timestamp = currentTimestampSec()
254253 let newRewardRate = if ((timestamp > periodFinish()))
255254 then (_reward / DURATION)
256255 else {
257256 let remainingTime = (periodFinish() - timestamp)
258257 let leftover = (rewardRate() * remainingTime)
259258 ((_reward + leftover) / DURATION)
260259 }
261260 (((updateRewardRate(newRewardRate) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateRewardBalance(_reward)) ++ updateTime(timestamp, (timestamp + DURATION)))
262261 }
263262 else throw("Strict value is not equal to itself.")
264263 }
265264
266265
267266
268267 @Callable(i)
269268 func ackRewards () = {
270- let rewardDelta = usdnToDecimals(assetBalance(this, quoteAsset()))
269+ let rewardDelta = usdnToDecimals(assetBalance(this, rewardAsset()))
271270 if (((1 * DECIMAL_UNIT) > rewardDelta))
272271 then nil
273272 else {
274- let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), usdnFromDecimals(rewardDelta))])
273+ let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(rewardAsset(), usdnFromDecimals(rewardDelta))])
275274 if ((stake == stake))
276275 then {
277276 let _reward = rewardDelta
278277 let newRewardPerTokenStored = updateReward(NO_ADDRESS, NO_STAKER)._1
279278 let timestamp = currentTimestampSec()
280279 let newRewardRate = if ((timestamp > periodFinish()))
281280 then (_reward / DURATION)
282281 else {
283282 let remainingTime = (periodFinish() - timestamp)
284283 let leftover = (rewardRate() * remainingTime)
285284 ((_reward + leftover) / DURATION)
286285 }
287286 (((updateRewardRate(newRewardRate) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateRewardBalance(_reward)) ++ updateTime(timestamp, (timestamp + DURATION)))
288287 }
289288 else throw("Strict value is not equal to itself.")
290289 }
291290 }
292291
293292
294293
295294 @Callable(i)
296295 func view_reward (_staker) = {
297296 let stakerEarned = updateReward(_staker, 0)._3
298297 throw(toString(usdnFromDecimals(stakerEarned)))
299298 }
300299
301300
302301
303302 @Callable(i)
304303 func computeReward (_staker) = {
305304 let stakerEarned = updateReward(_staker, 0)._3
306305 $Tuple2(nil, stakerEarned)
307306 }
308307
309308
310-
311-@Callable(i)
312-func migrateLiquidity () = {
313- let amount = usdnFromDecimals(rewardBalance())
314- let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), amount)])
315- if ((stake == stake))
316- then nil
317- else throw("Strict value is not equal to itself.")
309+@Verifier(tx)
310+func verify () = {
311+ let coordinatorStr = getString(this, k_coordinatorAddress)
312+ if (isDefined(coordinatorStr))
313+ then {
314+ let admin = getString(addressFromStringValue(value(coordinatorStr)), k_admin_address)
315+ if (isDefined(admin))
316+ then valueOrElse(getBoolean(addressFromStringValue(value(admin)), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false)
317+ else throw("unable to verify: admin not set in coordinator")
318+ }
319+ else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
318320 }
319-
320-
321-@Verifier(tx)
322-func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey())
323321

github/deemru/w8io/026f985 
60.45 ms