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:BgIgCAISAwoBCBIAEgMKAQESABIAEgASAwoBCBIDCgEIEgA2AA1rX3RvdGFsU3VwcGx5Ag1rX3RvdGFsU3VwcGx5AA9rX3Jld2FyZEJhbGFuY2UCD2tfcmV3YXJkQmFsYW5jZQAQa19sYXN0VXBkYXRlVGltZQIQa19sYXN0VXBkYXRlVGltZQAWa19yZXdhcmRQZXJUb2tlblN0b3JlZAIWa19yZXdhcmRQZXJUb2tlblN0b3JlZAAMa19yZXdhcmRSYXRlAgxrX3Jld2FyZFJhdGUADmtfcGVyaW9kRmluaXNoAg5rX3BlcmlvZEZpbmlzaAAJa19iYWxhbmNlAglrX2JhbGFuY2UAFGtfdXNlclJld2FyZFBlclRva2VuAhRrX3VzZXJSZXdhcmRQZXJUb2tlbgAMa191c2VyUmV3YXJkAgxrX3VzZXJSZXdhcmQADWtfaW5pdGlhbGl6ZWQCDWtfaW5pdGlhbGl6ZWQAFGtfY29vcmRpbmF0b3JBZGRyZXNzAhRrX2Nvb3JkaW5hdG9yQWRkcmVzcwASa19nb3Zlcm5hbmNlX2Fzc2V0AgtrX2dvdl9hc3NldAANa19xd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41SP13UBuFmCXvLzmkHT92 Next: J6qmvhu69AkJBPVTCPWy2MkQKD8MZA5ETQhGdBtFJtSy Diff:
Old | New | Differences | |
---|---|---|---|
267 | 267 | ||
268 | 268 | @Callable(i) | |
269 | 269 | 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())) | |
273 | 271 | if ((0 >= rewardDelta)) | |
274 | 272 | then throw("Invalid ackRewards params") | |
275 | 273 | else { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let k_totalSupply = "k_totalSupply" | |
5 | 5 | ||
6 | 6 | let k_rewardBalance = "k_rewardBalance" | |
7 | 7 | ||
8 | 8 | let k_lastUpdateTime = "k_lastUpdateTime" | |
9 | 9 | ||
10 | 10 | let k_rewardPerTokenStored = "k_rewardPerTokenStored" | |
11 | 11 | ||
12 | 12 | let k_rewardRate = "k_rewardRate" | |
13 | 13 | ||
14 | 14 | let k_periodFinish = "k_periodFinish" | |
15 | 15 | ||
16 | 16 | let k_balance = "k_balance" | |
17 | 17 | ||
18 | 18 | let k_userRewardPerToken = "k_userRewardPerToken" | |
19 | 19 | ||
20 | 20 | let k_userReward = "k_userReward" | |
21 | 21 | ||
22 | 22 | let k_initialized = "k_initialized" | |
23 | 23 | ||
24 | 24 | let k_coordinatorAddress = "k_coordinatorAddress" | |
25 | 25 | ||
26 | 26 | let k_governance_asset = "k_gov_asset" | |
27 | 27 | ||
28 | 28 | let k_quote_asset = "k_quote_asset" | |
29 | 29 | ||
30 | 30 | let k_admin_public_key = "k_admin_public_key" | |
31 | 31 | ||
32 | 32 | let k_manager_address = "k_manager_address" | |
33 | 33 | ||
34 | 34 | func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key)) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func governanceAsset () = fromBase58String(getStringValue(coordinator(), k_governance_asset)) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset)) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func managerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_manager_address)), "Manager not set") | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | let DECIMAL_UNIT = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10)) | |
50 | 50 | ||
51 | 51 | let DURATION = ((60 * 60) * 24) | |
52 | 52 | ||
53 | 53 | let NO_ADDRESS = "" | |
54 | 54 | ||
55 | 55 | let NO_STAKER = 0 | |
56 | 56 | ||
57 | 57 | func usdnFromDecimals (_amount) = (_amount / 100) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func usdnToDecimals (_amount) = (_amount * 100) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func abs (_x) = if ((_x > 0)) | |
70 | 70 | then _x | |
71 | 71 | else -(_x) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func minv (_x,_y) = if ((_x > _y)) | |
75 | 75 | then _y | |
76 | 76 | else _x | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k)) | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func int0 (k) = valueOrElse(getInteger(this, k), 0) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func totalSupply () = int0(k_totalSupply) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func rewardPerTokenStored () = int0(k_rewardPerTokenStored) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func lastUpdateTime () = int0(k_lastUpdateTime) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func rewardRate () = int0(k_rewardRate) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func periodFinish () = int0(k_periodFinish) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func rewardBalance () = int0(k_rewardBalance) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func rewards (_staker) = int0(toCompositeKey(k_userReward, _staker)) | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func userRewardPerTokenPaid (_staker) = int0(toCompositeKey(k_userRewardPerToken, _staker)) | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func balanceOf (_staker) = int0(toCompositeKey(k_balance, _staker)) | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func updateRewardBalance (_delta) = [IntegerEntry(k_rewardBalance, (rewardBalance() + _delta))] | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func updateRewardRate (_rewardRate) = [IntegerEntry(k_rewardRate, _rewardRate)] | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func updateTime (_lastUpdateTime,_periodFinish) = [IntegerEntry(k_lastUpdateTime, _lastUpdateTime), IntegerEntry(k_periodFinish, _periodFinish)] | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func updateRewardPerTokenStored (_rewardPerTokenStored) = [IntegerEntry(k_rewardPerTokenStored, _rewardPerTokenStored)] | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func updateUserRewards (_staker,_reward,_userRewardPerToken) = [IntegerEntry(toCompositeKey(k_userReward, _staker), _reward), IntegerEntry(toCompositeKey(k_userRewardPerToken, _staker), _userRewardPerToken)] | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func updateBalance (_staker,_delta) = [IntegerEntry(toCompositeKey(k_balance, _staker), (balanceOf(_staker) + _delta)), IntegerEntry(k_totalSupply, (totalSupply() + _delta))] | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func currentTimestampSec () = (lastBlock.timestamp / 1000) | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func lastTimeRewardApplicable () = minv(currentTimestampSec(), periodFinish()) | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func rewardPerToken (_balanceDelta) = if (((totalSupply() + _balanceDelta) == 0)) | |
143 | 143 | then rewardPerTokenStored() | |
144 | 144 | else { | |
145 | 145 | let timeInterval = (lastTimeRewardApplicable() - lastUpdateTime()) | |
146 | 146 | let actualTimeInterval = if ((0 > timeInterval)) | |
147 | 147 | then 0 | |
148 | 148 | else timeInterval | |
149 | 149 | let diff = divd((rewardRate() * actualTimeInterval), (totalSupply() + _balanceDelta)) | |
150 | 150 | (rewardPerTokenStored() + diff) | |
151 | 151 | } | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func earned (_staker,_balanceDelta) = { | |
155 | 155 | let rewardDelta = (rewardPerToken(_balanceDelta) - userRewardPerTokenPaid(_staker)) | |
156 | 156 | (muld((balanceOf(_staker) + _balanceDelta), rewardDelta) + rewards(_staker)) | |
157 | 157 | } | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func updateReward (_staker,_balanceDelta) = { | |
161 | 161 | let newRewardPerTokenStored = rewardPerToken(_balanceDelta) | |
162 | 162 | let newLastUpdateTime = currentTimestampSec() | |
163 | 163 | let $t050205212 = if ((_staker != "")) | |
164 | 164 | then $Tuple2(earned(_staker, _balanceDelta), newRewardPerTokenStored) | |
165 | 165 | else $Tuple2(0, 0) | |
166 | 166 | let stakerEarned = $t050205212._1 | |
167 | 167 | let stakerRewardPerTokenPaid = $t050205212._2 | |
168 | 168 | $Tuple4(newRewardPerTokenStored, newLastUpdateTime, stakerEarned, stakerRewardPerTokenPaid) | |
169 | 169 | } | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | @Callable(i) | |
173 | 173 | func initialize (_coordinator) = if (initialized()) | |
174 | 174 | then throw("Already initialized") | |
175 | 175 | else [StringEntry(k_coordinatorAddress, _coordinator), BooleanEntry(k_initialized, true)] | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | ||
179 | 179 | @Callable(i) | |
180 | 180 | func stake () = { | |
181 | 181 | let _staker = toString(i.caller) | |
182 | 182 | let _amount = i.payments[0].amount | |
183 | 183 | if (if ((i.payments[0].assetId != governanceAsset())) | |
184 | 184 | then true | |
185 | 185 | else !(initialized())) | |
186 | 186 | then throw("Invalid call to stake") | |
187 | 187 | else { | |
188 | 188 | let $t058686033 = updateReward(_staker, 0) | |
189 | 189 | let newRewardPerTokenStored = $t058686033._1 | |
190 | 190 | let newLastUpdateTime = $t058686033._2 | |
191 | 191 | let stakerEarned = $t058686033._3 | |
192 | 192 | let stakerRewardPerTokenPaid = $t058686033._4 | |
193 | 193 | (((updateUserRewards(_staker, stakerEarned, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateBalance(_staker, _amount)) | |
194 | 194 | } | |
195 | 195 | } | |
196 | 196 | ||
197 | 197 | ||
198 | 198 | ||
199 | 199 | @Callable(i) | |
200 | 200 | func unStake (_amount) = { | |
201 | 201 | let _staker = toString(i.caller) | |
202 | 202 | if (if (if ((_amount > balanceOf(_staker))) | |
203 | 203 | then true | |
204 | 204 | else (i.payments != nil)) | |
205 | 205 | then true | |
206 | 206 | else !(initialized())) | |
207 | 207 | then throw("Invalid unStake parameters") | |
208 | 208 | else { | |
209 | 209 | let $t065646729 = updateReward(_staker, 0) | |
210 | 210 | let newRewardPerTokenStored = $t065646729._1 | |
211 | 211 | let newLastUpdateTime = $t065646729._2 | |
212 | 212 | let stakerEarned = $t065646729._3 | |
213 | 213 | let stakerRewardPerTokenPaid = $t065646729._4 | |
214 | 214 | ((((updateUserRewards(_staker, stakerEarned, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateBalance(_staker, -(_amount))) ++ [ScriptTransfer(i.caller, _amount, governanceAsset())]) | |
215 | 215 | } | |
216 | 216 | } | |
217 | 217 | ||
218 | 218 | ||
219 | 219 | ||
220 | 220 | @Callable(i) | |
221 | 221 | func withdrawRewards () = { | |
222 | 222 | let _staker = toString(i.caller) | |
223 | 223 | let $t072057350 = updateReward(_staker, 0) | |
224 | 224 | let newRewardPerTokenStored = $t072057350._1 | |
225 | 225 | let newLastUpdateTime = $t072057350._2 | |
226 | 226 | let stakerEarned = $t072057350._3 | |
227 | 227 | let stakerRewardPerTokenPaid = $t072057350._4 | |
228 | 228 | if (if ((0 >= stakerEarned)) | |
229 | 229 | then true | |
230 | 230 | else !(initialized())) | |
231 | 231 | then throw("No reward") | |
232 | 232 | else { | |
233 | 233 | let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), usdnFromDecimals(stakerEarned)], nil) | |
234 | 234 | if ((unstake == unstake)) | |
235 | 235 | then ((((updateUserRewards(_staker, 0, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateRewardBalance(-(stakerEarned))) ++ [ScriptTransfer(i.caller, usdnFromDecimals(stakerEarned), quoteAsset())]) | |
236 | 236 | else throw("Strict value is not equal to itself.") | |
237 | 237 | } | |
238 | 238 | } | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | ||
242 | 242 | @Callable(i) | |
243 | 243 | func addRewards () = if (if ((i.payments[0].assetId != quoteAsset())) | |
244 | 244 | then true | |
245 | 245 | else !(initialized())) | |
246 | 246 | then throw("Invalid addRewards params") | |
247 | 247 | else { | |
248 | 248 | let _reward = usdnToDecimals(i.payments[0].amount) | |
249 | 249 | let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), usdnFromDecimals(_reward))]) | |
250 | 250 | if ((stake == stake)) | |
251 | 251 | then { | |
252 | 252 | let newRewardPerTokenStored = updateReward(NO_ADDRESS, NO_STAKER)._1 | |
253 | 253 | let timestamp = currentTimestampSec() | |
254 | 254 | let newRewardRate = if ((timestamp > periodFinish())) | |
255 | 255 | then (_reward / DURATION) | |
256 | 256 | else { | |
257 | 257 | let remainingTime = (periodFinish() - timestamp) | |
258 | 258 | let leftover = (rewardRate() * remainingTime) | |
259 | 259 | ((_reward + leftover) / DURATION) | |
260 | 260 | } | |
261 | 261 | (((updateRewardRate(newRewardRate) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateRewardBalance(_reward)) ++ updateTime(timestamp, (timestamp + DURATION))) | |
262 | 262 | } | |
263 | 263 | else throw("Strict value is not equal to itself.") | |
264 | 264 | } | |
265 | 265 | ||
266 | 266 | ||
267 | 267 | ||
268 | 268 | @Callable(i) | |
269 | 269 | 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())) | |
273 | 271 | if ((0 >= rewardDelta)) | |
274 | 272 | then throw("Invalid ackRewards params") | |
275 | 273 | else { | |
276 | 274 | let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), usdnFromDecimals(rewardDelta))]) | |
277 | 275 | if ((stake == stake)) | |
278 | 276 | then { | |
279 | 277 | let _reward = rewardDelta | |
280 | 278 | let newRewardPerTokenStored = updateReward(NO_ADDRESS, NO_STAKER)._1 | |
281 | 279 | let timestamp = currentTimestampSec() | |
282 | 280 | let newRewardRate = if ((timestamp > periodFinish())) | |
283 | 281 | then (_reward / DURATION) | |
284 | 282 | else { | |
285 | 283 | let remainingTime = (periodFinish() - timestamp) | |
286 | 284 | let leftover = (rewardRate() * remainingTime) | |
287 | 285 | ((_reward + leftover) / DURATION) | |
288 | 286 | } | |
289 | 287 | (((updateRewardRate(newRewardRate) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateRewardBalance(_reward)) ++ updateTime(timestamp, (timestamp + DURATION))) | |
290 | 288 | } | |
291 | 289 | else throw("Strict value is not equal to itself.") | |
292 | 290 | } | |
293 | 291 | } | |
294 | 292 | ||
295 | 293 | ||
296 | 294 | ||
297 | 295 | @Callable(i) | |
298 | 296 | func view_reward (_staker) = { | |
299 | 297 | let stakerEarned = updateReward(_staker, 0)._3 | |
300 | 298 | throw(toString(usdnFromDecimals(stakerEarned))) | |
301 | 299 | } | |
302 | 300 | ||
303 | 301 | ||
304 | 302 | ||
305 | 303 | @Callable(i) | |
306 | 304 | func computeReward (_staker) = { | |
307 | 305 | let stakerEarned = updateReward(_staker, 0)._3 | |
308 | 306 | $Tuple2(nil, stakerEarned) | |
309 | 307 | } | |
310 | 308 | ||
311 | 309 | ||
312 | 310 | ||
313 | 311 | @Callable(i) | |
314 | 312 | func migrateLiquidity () = { | |
315 | 313 | let amount = usdnFromDecimals(rewardBalance()) | |
316 | 314 | let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), amount)]) | |
317 | 315 | if ((stake == stake)) | |
318 | 316 | then nil | |
319 | 317 | else throw("Strict value is not equal to itself.") | |
320 | 318 | } | |
321 | 319 | ||
322 | 320 | ||
323 | 321 | @Verifier(tx) | |
324 | 322 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey()) | |
325 | 323 |
github/deemru/w8io/026f985 38.11 ms ◑