tx · 96LbARFKoWchdvkfKGtFivVxhCAhBNZEm6entdLkM3gt

3MrrZRV6F9ywSejcyd9foJV5ZWXRhiDD6yo:  -0.03700000 Waves

2022.09.13 21:28 [2227685] smart account 3MrrZRV6F9ywSejcyd9foJV5ZWXRhiDD6yo > SELF 0.00000000 Waves

{ "type": 13, "id": "96LbARFKoWchdvkfKGtFivVxhCAhBNZEm6entdLkM3gt", "fee": 3700000, "feeAssetId": null, "timestamp": 1663093691567, "version": 2, "chainId": 84, "sender": "3MrrZRV6F9ywSejcyd9foJV5ZWXRhiDD6yo", "senderPublicKey": "AzkmMXb1TBA8jfijtZ5hFHMEC6p5hm3e5prwCk1cTVCh", "proofs": [ "5dsTgYhLPuYGNZFQ8q6t9uSbKYWdhnD5foTtCEGK7z68vnicatwyBzzQjEU5ZYocASVMZGbaznkbBFvCdgTuTN2A" ], "script": "base64:BgIdCAISBAoCCAgSAwoBCBIAEgMKAQESABIAEgMKAQg4AA1rX3RvdGFsU3VwcGx5Ag1rX3RvdGFsU3VwcGx5AA9rX3Jld2FyZEJhbGFuY2UCD2tfcmV3YXJkQmFsYW5jZQANa19zd2FwQWRkcmVzcwINa19zd2FwQWRkcmVzcwAQa19sYXN0VXBkYXRlVGltZQIQa19sYXN0VXBkYXRlVGltZQAWa19yZXdhcmRQZXJUb2tlblN0b3JlZAIWa19yZXdhcmRQZXJUb2tlblN0b3JlZAAMa19yZXdhcmRSYXRlAgxrX3Jld2FyZFJhdGUADmtfcGVyaW9kRmluaXNoAg5rX3BlcmlvZEZpbmlzaAAJa19iYWxhbmNlAglrX2JhbGFuY2UAFGtfdXNlclJld2FyZFBlclRva2VuAhRrX3VzZXJSZXdhcmRQZXJUb2tlbgAMa191c2VyUmV3YXJkAgxrX3VzZXJSZXdhcmQADWtfaW5pdGlhbGl6ZWQCDWtfaW5pdGlhbGl6ZWQAFGtfY29vcmRpbmF0b3JBZGRyZXNzAhRrX2Nvb3JkaW5hdG9yQWRkcmVzcwARa19zdGFraW5n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1lc3RhbXAFCERVUkFUSU9OCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAWkBC3ZpZXdfcmV3YXJkAQdfc3Rha2VyBAxzdGFrZXJFYXJuZWQICQEMdXBkYXRlUmV3YXJkAgUHX3N0YWtlcgAAAl8zCQACAQkApAMBBQxzdGFrZXJFYXJuZWQBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACQEOYWRtaW5QdWJsaWNLZXkAYkVzXA==", "height": 2227685, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EcUooDgkuqFeZMUXAr2FgGDy4DHhVGDMXF7mGevDs3E7 Next: 38oUCppTN1697dWaSxEb5JqSRB3QHYHotB8y13y47m8o Diff:
OldNewDifferences
253253 if (if ((0 >= stakerEarned))
254254 then true
255255 else !(initialized()))
256- then throw("No reward")
256+ then throw("No farming reward")
257257 else {
258258 let doUnStake = invoke(stakingAddress(), "unStake", [stakerEarned], nil)
259259 if ((doUnStake == doUnStake))
268268
269269 @Callable(i)
270270 func ackRewards () = {
271- let doClaimRewards = invoke(stakingAddress(), "withdrawRewards", nil, nil)
272- if ((doClaimRewards == doClaimRewards))
271+ let _rewardAmount = invoke(stakingAddress(), "computeReward", [toString(this)], nil)
272+ if ((_rewardAmount == _rewardAmount))
273273 then {
274- let doSwap = invoke(swapAddress(), "swap", [toBase58String(governanceAsset()), 0], [AttachedPayment(quoteAsset(), assetBalance(this, quoteAsset()))])
275- if ((doSwap == doSwap))
276- then {
277- let rewardDelta = assetBalance(this, governanceAsset())
278- let doStake = invoke(stakingAddress(), "stake", nil, [AttachedPayment(governanceAsset(), rewardDelta)])
279- if ((doStake == doStake))
280- then if ((0 >= rewardDelta))
281- then throw("Invalid ackRewards params")
282- else {
283- let _reward = rewardDelta
284- let newRewardPerTokenStored = updateReward(NO_ADDRESS, NO_STAKER)._1
285- let timestamp = currentTimestampSec()
286- let newRewardRate = if ((timestamp > periodFinish()))
287- then (_reward / DURATION)
288- else {
289- let remainingTime = (periodFinish() - timestamp)
290- let leftover = (rewardRate() * remainingTime)
291- ((_reward + leftover) / DURATION)
292- }
293- (((updateRewardRate(newRewardRate) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateRewardBalance(_reward)) ++ updateTime(timestamp, (timestamp + DURATION)))
294- }
274+ let rewardAmount = match _rewardAmount {
275+ case t: Int =>
276+ t
277+ case _ =>
278+ throw("Reward amount not a number")
279+ }
280+ if ((rewardAmount == 0))
281+ then nil
282+ else {
283+ let doClaimRewards = invoke(stakingAddress(), "withdrawRewards", nil, nil)
284+ if ((doClaimRewards == doClaimRewards))
285+ then {
286+ let rewardsAmount = assetBalance(this, quoteAsset())
287+ let doSwap = invoke(swapAddress(), "swap", [toBase58String(governanceAsset()), 0], [AttachedPayment(quoteAsset(), rewardsAmount)])
288+ if ((doSwap == doSwap))
289+ then {
290+ let rewardDelta = assetBalance(this, governanceAsset())
291+ if ((rewardDelta == rewardDelta))
292+ then if ((0 >= rewardDelta))
293+ then throw("Invalid ackRewards params")
294+ else {
295+ let _reward = rewardDelta
296+ let newRewardPerTokenStored = updateReward(NO_ADDRESS, NO_STAKER)._1
297+ let timestamp = currentTimestampSec()
298+ let newRewardRate = if ((timestamp > periodFinish()))
299+ then (_reward / DURATION)
300+ else {
301+ let remainingTime = (periodFinish() - timestamp)
302+ let leftover = (rewardRate() * remainingTime)
303+ ((_reward + leftover) / DURATION)
304+ }
305+ let doStake = invoke(stakingAddress(), "stake", nil, [AttachedPayment(governanceAsset(), rewardDelta)])
306+ if ((doStake == doStake))
307+ then (((updateRewardRate(newRewardRate) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateRewardBalance(_reward)) ++ updateTime(timestamp, (timestamp + DURATION)))
308+ else throw("Strict value is not equal to itself.")
309+ }
310+ else throw("Strict value is not equal to itself.")
311+ }
312+ else throw("Strict value is not equal to itself.")
313+ }
295314 else throw("Strict value is not equal to itself.")
296315 }
297- else throw("Strict value is not equal to itself.")
298316 }
299317 else throw("Strict value is not equal to itself.")
300318 }
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_swapAddress = "k_swapAddress"
99
1010 let k_lastUpdateTime = "k_lastUpdateTime"
1111
1212 let k_rewardPerTokenStored = "k_rewardPerTokenStored"
1313
1414 let k_rewardRate = "k_rewardRate"
1515
1616 let k_periodFinish = "k_periodFinish"
1717
1818 let k_balance = "k_balance"
1919
2020 let k_userRewardPerToken = "k_userRewardPerToken"
2121
2222 let k_userReward = "k_userReward"
2323
2424 let k_initialized = "k_initialized"
2525
2626 let k_coordinatorAddress = "k_coordinatorAddress"
2727
2828 let k_staking_address = "k_staking_address"
2929
3030 let k_governance_asset = "k_gov_asset"
3131
3232 let k_quote_asset = "k_quote_asset"
3333
3434 let k_admin_public_key = "k_admin_public_key"
3535
3636 let k_admin_address = "k_admin_address"
3737
3838 func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set")
3939
4040
4141 func adminAddress () = addressFromString(getStringValue(coordinator(), k_admin_address))
4242
4343
4444 func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key))
4545
4646
4747 func governanceAsset () = fromBase58String(getStringValue(coordinator(), k_governance_asset))
4848
4949
5050 func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset))
5151
5252
5353 func stakingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_staking_address)), "Staking not set")
5454
5555
5656 let DECIMAL_UNIT = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10))
5757
5858 let DURATION = ((60 * 60) * 24)
5959
6060 let NO_ADDRESS = ""
6161
6262 let NO_STAKER = 0
6363
6464 func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN)
6565
6666
6767 func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN)
6868
6969
7070 func abs (_x) = if ((_x > 0))
7171 then _x
7272 else -(_x)
7373
7474
7575 func minv (_x,_y) = if ((_x > _y))
7676 then _y
7777 else _x
7878
7979
8080 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
8181
8282
8383 func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k))
8484
8585
8686 func int0 (k) = valueOrElse(getInteger(this, k), 0)
8787
8888
8989 func totalSupply () = int0(k_totalSupply)
9090
9191
9292 func rewardPerTokenStored () = int0(k_rewardPerTokenStored)
9393
9494
9595 func lastUpdateTime () = int0(k_lastUpdateTime)
9696
9797
9898 func rewardRate () = int0(k_rewardRate)
9999
100100
101101 func periodFinish () = int0(k_periodFinish)
102102
103103
104104 func rewardBalance () = int0(k_rewardBalance)
105105
106106
107107 func swapAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, k_swapAddress), "Now swap address")), "Invalid swap address")
108108
109109
110110 func rewards (_staker) = int0(toCompositeKey(k_userReward, _staker))
111111
112112
113113 func userRewardPerTokenPaid (_staker) = int0(toCompositeKey(k_userRewardPerToken, _staker))
114114
115115
116116 func balanceOf (_staker) = int0(toCompositeKey(k_balance, _staker))
117117
118118
119119 func initialized () = valueOrElse(getBoolean(this, k_initialized), false)
120120
121121
122122 func updateRewardBalance (_delta) = [IntegerEntry(k_rewardBalance, (rewardBalance() + _delta))]
123123
124124
125125 func updateRewardRate (_rewardRate) = [IntegerEntry(k_rewardRate, _rewardRate)]
126126
127127
128128 func updateTime (_lastUpdateTime,_periodFinish) = [IntegerEntry(k_lastUpdateTime, _lastUpdateTime), IntegerEntry(k_periodFinish, _periodFinish)]
129129
130130
131131 func updateRewardPerTokenStored (_rewardPerTokenStored) = [IntegerEntry(k_rewardPerTokenStored, _rewardPerTokenStored)]
132132
133133
134134 func updateUserRewards (_staker,_reward,_userRewardPerToken) = [IntegerEntry(toCompositeKey(k_userReward, _staker), _reward), IntegerEntry(toCompositeKey(k_userRewardPerToken, _staker), _userRewardPerToken)]
135135
136136
137137 func updateBalance (_staker,_delta) = [IntegerEntry(toCompositeKey(k_balance, _staker), (balanceOf(_staker) + _delta)), IntegerEntry(k_totalSupply, (totalSupply() + _delta))]
138138
139139
140140 func currentTimestampSec () = (lastBlock.timestamp / 1000)
141141
142142
143143 func lastTimeRewardApplicable () = minv(currentTimestampSec(), periodFinish())
144144
145145
146146 func rewardPerToken (_balanceDelta) = if (((totalSupply() + _balanceDelta) == 0))
147147 then rewardPerTokenStored()
148148 else {
149149 let timeInterval = (lastTimeRewardApplicable() - lastUpdateTime())
150150 let actualTimeInterval = if ((0 > timeInterval))
151151 then 0
152152 else timeInterval
153153 let diff = divd((rewardRate() * actualTimeInterval), (totalSupply() + _balanceDelta))
154154 (rewardPerTokenStored() + diff)
155155 }
156156
157157
158158 func earned (_staker,_balanceDelta) = {
159159 let rewardDelta = (rewardPerToken(_balanceDelta) - userRewardPerTokenPaid(_staker))
160160 (muld((balanceOf(_staker) + _balanceDelta), rewardDelta) + rewards(_staker))
161161 }
162162
163163
164164 func updateReward (_staker,_balanceDelta) = {
165165 let newRewardPerTokenStored = rewardPerToken(_balanceDelta)
166166 let newLastUpdateTime = currentTimestampSec()
167167 let $t052055397 = if ((_staker != ""))
168168 then $Tuple2(earned(_staker, _balanceDelta), newRewardPerTokenStored)
169169 else $Tuple2(0, 0)
170170 let stakerEarned = $t052055397._1
171171 let stakerRewardPerTokenPaid = $t052055397._2
172172 $Tuple4(newRewardPerTokenStored, newLastUpdateTime, stakerEarned, stakerRewardPerTokenPaid)
173173 }
174174
175175
176176 @Callable(i)
177177 func initialize (_coordinator,_swapAddress) = if (initialized())
178178 then throw("Already initialized")
179179 else [StringEntry(k_coordinatorAddress, _coordinator), StringEntry(k_swapAddress, _swapAddress), BooleanEntry(k_initialized, true)]
180180
181181
182182
183183 @Callable(i)
184184 func setSwap (_swapAddress) = if ((i.caller != adminAddress()))
185185 then throw("Invalid setSwap params")
186186 else [StringEntry(k_swapAddress, _swapAddress)]
187187
188188
189189
190190 @Callable(i)
191191 func stake () = {
192192 let _staker = toString(i.caller)
193193 let _amount = i.payments[0].amount
194194 if (if ((i.payments[0].assetId != governanceAsset()))
195195 then true
196196 else !(initialized()))
197197 then throw("Invalid call to stake")
198198 else {
199199 let $t063396504 = updateReward(_staker, 0)
200200 let newRewardPerTokenStored = $t063396504._1
201201 let newLastUpdateTime = $t063396504._2
202202 let stakerEarned = $t063396504._3
203203 let stakerRewardPerTokenPaid = $t063396504._4
204204 let doStake = invoke(stakingAddress(), "stake", nil, [AttachedPayment(governanceAsset(), _amount)])
205205 if ((doStake == doStake))
206206 then (((updateUserRewards(_staker, stakerEarned, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateBalance(_staker, _amount))
207207 else throw("Strict value is not equal to itself.")
208208 }
209209 }
210210
211211
212212
213213 @Callable(i)
214214 func unStake (_amount) = {
215215 let doAckRewards = invoke(this, "ackRewards", nil, nil)
216216 if ((doAckRewards == doAckRewards))
217217 then {
218218 let _staker = toString(i.caller)
219219 if (if (if ((_amount > balanceOf(_staker)))
220220 then true
221221 else (i.payments != nil))
222222 then true
223223 else !(initialized()))
224224 then throw("Invalid unStake parameters")
225225 else {
226226 let $t072887453 = updateReward(_staker, 0)
227227 let newRewardPerTokenStored = $t072887453._1
228228 let newLastUpdateTime = $t072887453._2
229229 let stakerEarned = $t072887453._3
230230 let stakerRewardPerTokenPaid = $t072887453._4
231231 let doUnStake = invoke(stakingAddress(), "unStake", [_amount], nil)
232232 if ((doUnStake == doUnStake))
233233 then ((((updateUserRewards(_staker, stakerEarned, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateBalance(_staker, -(_amount))) ++ [ScriptTransfer(i.caller, _amount, governanceAsset())])
234234 else throw("Strict value is not equal to itself.")
235235 }
236236 }
237237 else throw("Strict value is not equal to itself.")
238238 }
239239
240240
241241
242242 @Callable(i)
243243 func withdrawRewards () = {
244244 let doAckRewards = invoke(this, "ackRewards", nil, nil)
245245 if ((doAckRewards == doAckRewards))
246246 then {
247247 let _staker = toString(i.caller)
248248 let $t082288373 = updateReward(_staker, 0)
249249 let newRewardPerTokenStored = $t082288373._1
250250 let newLastUpdateTime = $t082288373._2
251251 let stakerEarned = $t082288373._3
252252 let stakerRewardPerTokenPaid = $t082288373._4
253253 if (if ((0 >= stakerEarned))
254254 then true
255255 else !(initialized()))
256- then throw("No reward")
256+ then throw("No farming reward")
257257 else {
258258 let doUnStake = invoke(stakingAddress(), "unStake", [stakerEarned], nil)
259259 if ((doUnStake == doUnStake))
260260 then ((((updateUserRewards(_staker, 0, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateRewardBalance(-(stakerEarned))) ++ [ScriptTransfer(i.caller, stakerEarned, governanceAsset())])
261261 else throw("Strict value is not equal to itself.")
262262 }
263263 }
264264 else throw("Strict value is not equal to itself.")
265265 }
266266
267267
268268
269269 @Callable(i)
270270 func ackRewards () = {
271- let doClaimRewards = invoke(stakingAddress(), "withdrawRewards", nil, nil)
272- if ((doClaimRewards == doClaimRewards))
271+ let _rewardAmount = invoke(stakingAddress(), "computeReward", [toString(this)], nil)
272+ if ((_rewardAmount == _rewardAmount))
273273 then {
274- let doSwap = invoke(swapAddress(), "swap", [toBase58String(governanceAsset()), 0], [AttachedPayment(quoteAsset(), assetBalance(this, quoteAsset()))])
275- if ((doSwap == doSwap))
276- then {
277- let rewardDelta = assetBalance(this, governanceAsset())
278- let doStake = invoke(stakingAddress(), "stake", nil, [AttachedPayment(governanceAsset(), rewardDelta)])
279- if ((doStake == doStake))
280- then if ((0 >= rewardDelta))
281- then throw("Invalid ackRewards params")
282- else {
283- let _reward = rewardDelta
284- let newRewardPerTokenStored = updateReward(NO_ADDRESS, NO_STAKER)._1
285- let timestamp = currentTimestampSec()
286- let newRewardRate = if ((timestamp > periodFinish()))
287- then (_reward / DURATION)
288- else {
289- let remainingTime = (periodFinish() - timestamp)
290- let leftover = (rewardRate() * remainingTime)
291- ((_reward + leftover) / DURATION)
292- }
293- (((updateRewardRate(newRewardRate) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateRewardBalance(_reward)) ++ updateTime(timestamp, (timestamp + DURATION)))
294- }
274+ let rewardAmount = match _rewardAmount {
275+ case t: Int =>
276+ t
277+ case _ =>
278+ throw("Reward amount not a number")
279+ }
280+ if ((rewardAmount == 0))
281+ then nil
282+ else {
283+ let doClaimRewards = invoke(stakingAddress(), "withdrawRewards", nil, nil)
284+ if ((doClaimRewards == doClaimRewards))
285+ then {
286+ let rewardsAmount = assetBalance(this, quoteAsset())
287+ let doSwap = invoke(swapAddress(), "swap", [toBase58String(governanceAsset()), 0], [AttachedPayment(quoteAsset(), rewardsAmount)])
288+ if ((doSwap == doSwap))
289+ then {
290+ let rewardDelta = assetBalance(this, governanceAsset())
291+ if ((rewardDelta == rewardDelta))
292+ then if ((0 >= rewardDelta))
293+ then throw("Invalid ackRewards params")
294+ else {
295+ let _reward = rewardDelta
296+ let newRewardPerTokenStored = updateReward(NO_ADDRESS, NO_STAKER)._1
297+ let timestamp = currentTimestampSec()
298+ let newRewardRate = if ((timestamp > periodFinish()))
299+ then (_reward / DURATION)
300+ else {
301+ let remainingTime = (periodFinish() - timestamp)
302+ let leftover = (rewardRate() * remainingTime)
303+ ((_reward + leftover) / DURATION)
304+ }
305+ let doStake = invoke(stakingAddress(), "stake", nil, [AttachedPayment(governanceAsset(), rewardDelta)])
306+ if ((doStake == doStake))
307+ then (((updateRewardRate(newRewardRate) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateRewardBalance(_reward)) ++ updateTime(timestamp, (timestamp + DURATION)))
308+ else throw("Strict value is not equal to itself.")
309+ }
310+ else throw("Strict value is not equal to itself.")
311+ }
312+ else throw("Strict value is not equal to itself.")
313+ }
295314 else throw("Strict value is not equal to itself.")
296315 }
297- else throw("Strict value is not equal to itself.")
298316 }
299317 else throw("Strict value is not equal to itself.")
300318 }
301319
302320
303321
304322 @Callable(i)
305323 func view_reward (_staker) = {
306324 let stakerEarned = updateReward(_staker, 0)._3
307325 throw(toString(stakerEarned))
308326 }
309327
310328
311329 @Verifier(tx)
312330 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey())
313331

github/deemru/w8io/026f985 
42.02 ms