tx · AZfJwranHSXKucjoToZXrfqpxi7VyY46kqZXSp8sFwUu 3N4QWZXfZqNf284CJVbtxzCerqARoALxJEy: -0.03700000 Waves 2022.09.13 21:27 [2227684] smart account 3N4QWZXfZqNf284CJVbtxzCerqARoALxJEy > SELF 0.00000000 Waves
{ "type": 13, "id": "AZfJwranHSXKucjoToZXrfqpxi7VyY46kqZXSp8sFwUu", "fee": 3700000, "feeAssetId": null, "timestamp": 1663093680047, "version": 2, "chainId": 84, "sender": "3N4QWZXfZqNf284CJVbtxzCerqARoALxJEy", "senderPublicKey": "GzEvTfwa3251fRwyTL99QzUmkDGBdn4cNr2mR6XQ1UmR", "proofs": [ "2NM3wKR838sqVTAfoiNCU84grKVL2i28wfpjDGpEd91PX4j4TeTUjyA3mmGBgTSqipJys4msfnZ43eCXycxmQ3yL" ], "script": "base64:BgIeCAISAwoBCBIAEgMKAQESABIAEgASAwoBCBIDCgEINAANa190b3RhbFN1cHBseQINa190b3RhbFN1cHBseQAPa19yZXdhcmRCYWxhbmNlAg9rX3Jld2FyZEJhbGFuY2UAEGtfbGFzdFVwZGF0ZVRpbWUCEGtfbGFzdFVwZGF0ZVRpbWUAFmtfcmV3YXJkUGVyVG9rZW5TdG9yZWQCFmtfcmV3YXJkUGVyVG9rZW5TdG9yZWQADGtfcmV3YXJkUmF0ZQIMa19yZXdhcmRSYXRlAA5rX3BlcmlvZEZpbmlzaAIOa19wZXJpb2RGaW5pc2gACWtfYmFsYW5jZQIJa19iYWxhbmNlABRrX3VzZXJSZXdhcmRQZXJUb2tlbgIUa191c2VyUmV3YXJkUGVyVG9rZW4ADGtfdXNlclJld2FyZAIMa191c2VyUmV3YXJkAA1rX2luaXRpYWxpemVkAg1rX2luaXRpYWxpemVkABRrX2Nvb3JkaW5hdG9yQWRkcmVzcwIUa19jb29yZGluYXRvckFkZHJlc3MAEmtfZ292ZXJuYW5jZV9hc3NldAILa19nb3ZfYXNzZXQADWtfcXVvdGVfYXNzZXQCDWtfcXVvdGVf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VjAAQNbmV3UmV3YXJkUmF0ZQMJAGYCBQl0aW1lc3RhbXAJAQxwZXJpb2RGaW5pc2gACQBpAgUHX3Jld2FyZAUIRFVSQVRJT04EDXJlbWFpbmluZ1RpbWUJAGUCCQEMcGVyaW9kRmluaXNoAAUJdGltZXN0YW1wBAhsZWZ0b3ZlcgkAaAIJAQpyZXdhcmRSYXRlAAUNcmVtYWluaW5nVGltZQkAaQIJAGQCBQdfcmV3YXJkBQhsZWZ0b3ZlcgUIRFVSQVRJT04JAM4IAgkAzggCCQDOCAIJARB1cGRhdGVSZXdhcmRSYXRlAQUNbmV3UmV3YXJkUmF0ZQkBGnVwZGF0ZVJld2FyZFBlclRva2VuU3RvcmVkAQUXbmV3UmV3YXJkUGVyVG9rZW5TdG9yZWQJARN1cGRhdGVSZXdhcmRCYWxhbmNlAQUHX3Jld2FyZAkBCnVwZGF0ZVRpbWUCBQl0aW1lc3RhbXAJAGQCBQl0aW1lc3RhbXAFCERVUkFUSU9OAWkBC3ZpZXdfcmV3YXJkAQdfc3Rha2VyBAxzdGFrZXJFYXJuZWQICQEMdXBkYXRlUmV3YXJkAgUHX3N0YWtlcgAAAl8zCQACAQkApAMBCQEQdXNkbkZyb21EZWNpbWFscwEFDHN0YWtlckVhcm5lZAFpAQ1jb21wdXRlUmV3YXJkAQdfc3Rha2VyBAxzdGFrZXJFYXJuZWQICQEMdXBkYXRlUmV3YXJkAgUHX3N0YWtlcgAAAl8zCQCUCgIFA25pbAUMc3Rha2VyRWFybmVkAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAkBDmFkbWluUHVibGljS2V5AL+CLio=", "height": 2227684, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8otep9FLY12CxpHZjxv8vV9mwiUA1r43gWWppzJ7t2RF Next: FZp5a9PRkYdVhgjhRfcvwv41SP13UBuFmCXvLzmkHT92 Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let k_totalSupply = "k_totalSupply" | |
141 | 141 | let actualTimeInterval = if ((0 > timeInterval)) | |
142 | 142 | then 0 | |
143 | 143 | else timeInterval | |
144 | - | let diff = ( | |
144 | + | let diff = divd((rewardRate() * actualTimeInterval), (totalSupply() + _balanceDelta)) | |
145 | 145 | (rewardPerTokenStored() + diff) | |
146 | 146 | } | |
147 | 147 | ||
281 | 281 | } | |
282 | 282 | ||
283 | 283 | ||
284 | + | ||
285 | + | @Callable(i) | |
286 | + | func computeReward (_staker) = { | |
287 | + | let stakerEarned = updateReward(_staker, 0)._3 | |
288 | + | $Tuple2(nil, stakerEarned) | |
289 | + | } | |
290 | + | ||
291 | + | ||
284 | 292 | @Verifier(tx) | |
285 | 293 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey()) | |
286 | 294 |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
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 | func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set") | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key)) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func governanceAsset () = fromBase58String(getStringValue(coordinator(), k_governance_asset)) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset)) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | let DECIMAL_UNIT = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10)) | |
45 | 45 | ||
46 | 46 | let DURATION = ((60 * 60) * 24) | |
47 | 47 | ||
48 | 48 | let NO_ADDRESS = "" | |
49 | 49 | ||
50 | 50 | let NO_STAKER = 0 | |
51 | 51 | ||
52 | 52 | func usdnFromDecimals (_amount) = (_amount / 100) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func usdnToDecimals (_amount) = (_amount * 100) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func abs (_x) = if ((_x > 0)) | |
65 | 65 | then _x | |
66 | 66 | else -(_x) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func minv (_x,_y) = if ((_x > _y)) | |
70 | 70 | then _y | |
71 | 71 | else _x | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k)) | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func int0 (k) = valueOrElse(getInteger(this, k), 0) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func totalSupply () = int0(k_totalSupply) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func rewardPerTokenStored () = int0(k_rewardPerTokenStored) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func lastUpdateTime () = int0(k_lastUpdateTime) | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func rewardRate () = int0(k_rewardRate) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func periodFinish () = int0(k_periodFinish) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func rewardBalance () = int0(k_rewardBalance) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func rewards (_staker) = int0(toCompositeKey(k_userReward, _staker)) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func userRewardPerTokenPaid (_staker) = int0(toCompositeKey(k_userRewardPerToken, _staker)) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func balanceOf (_staker) = int0(toCompositeKey(k_balance, _staker)) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func updateRewardBalance (_delta) = [IntegerEntry(k_rewardBalance, (rewardBalance() + _delta))] | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func updateRewardRate (_rewardRate) = [IntegerEntry(k_rewardRate, _rewardRate)] | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func updateTime (_lastUpdateTime,_periodFinish) = [IntegerEntry(k_lastUpdateTime, _lastUpdateTime), IntegerEntry(k_periodFinish, _periodFinish)] | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func updateRewardPerTokenStored (_rewardPerTokenStored) = [IntegerEntry(k_rewardPerTokenStored, _rewardPerTokenStored)] | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func updateUserRewards (_staker,_reward,_userRewardPerToken) = [IntegerEntry(toCompositeKey(k_userReward, _staker), _reward), IntegerEntry(toCompositeKey(k_userRewardPerToken, _staker), _userRewardPerToken)] | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func updateBalance (_staker,_delta) = [IntegerEntry(toCompositeKey(k_balance, _staker), (balanceOf(_staker) + _delta)), IntegerEntry(k_totalSupply, (totalSupply() + _delta))] | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | func currentTimestampSec () = (lastBlock.timestamp / 1000) | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func lastTimeRewardApplicable () = minv(currentTimestampSec(), periodFinish()) | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func rewardPerToken (_balanceDelta) = if (((totalSupply() + _balanceDelta) == 0)) | |
138 | 138 | then rewardPerTokenStored() | |
139 | 139 | else { | |
140 | 140 | let timeInterval = (lastTimeRewardApplicable() - lastUpdateTime()) | |
141 | 141 | let actualTimeInterval = if ((0 > timeInterval)) | |
142 | 142 | then 0 | |
143 | 143 | else timeInterval | |
144 | - | let diff = ( | |
144 | + | let diff = divd((rewardRate() * actualTimeInterval), (totalSupply() + _balanceDelta)) | |
145 | 145 | (rewardPerTokenStored() + diff) | |
146 | 146 | } | |
147 | 147 | ||
148 | 148 | ||
149 | 149 | func earned (_staker,_balanceDelta) = { | |
150 | 150 | let rewardDelta = (rewardPerToken(_balanceDelta) - userRewardPerTokenPaid(_staker)) | |
151 | 151 | (muld((balanceOf(_staker) + _balanceDelta), rewardDelta) + rewards(_staker)) | |
152 | 152 | } | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | func updateReward (_staker,_balanceDelta) = { | |
156 | 156 | let newRewardPerTokenStored = rewardPerToken(_balanceDelta) | |
157 | 157 | let newLastUpdateTime = currentTimestampSec() | |
158 | 158 | let $t048425034 = if ((_staker != "")) | |
159 | 159 | then $Tuple2(earned(_staker, _balanceDelta), newRewardPerTokenStored) | |
160 | 160 | else $Tuple2(0, 0) | |
161 | 161 | let stakerEarned = $t048425034._1 | |
162 | 162 | let stakerRewardPerTokenPaid = $t048425034._2 | |
163 | 163 | $Tuple4(newRewardPerTokenStored, newLastUpdateTime, stakerEarned, stakerRewardPerTokenPaid) | |
164 | 164 | } | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | @Callable(i) | |
168 | 168 | func initialize (_coordinator) = if (initialized()) | |
169 | 169 | then throw("Already initialized") | |
170 | 170 | else [StringEntry(k_coordinatorAddress, _coordinator), BooleanEntry(k_initialized, true)] | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | ||
174 | 174 | @Callable(i) | |
175 | 175 | func stake () = { | |
176 | 176 | let _staker = toString(i.caller) | |
177 | 177 | let _amount = i.payments[0].amount | |
178 | 178 | if (if ((i.payments[0].assetId != governanceAsset())) | |
179 | 179 | then true | |
180 | 180 | else !(initialized())) | |
181 | 181 | then throw("Invalid call to stake") | |
182 | 182 | else { | |
183 | 183 | let $t056905855 = updateReward(_staker, 0) | |
184 | 184 | let newRewardPerTokenStored = $t056905855._1 | |
185 | 185 | let newLastUpdateTime = $t056905855._2 | |
186 | 186 | let stakerEarned = $t056905855._3 | |
187 | 187 | let stakerRewardPerTokenPaid = $t056905855._4 | |
188 | 188 | (((updateUserRewards(_staker, stakerEarned, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateBalance(_staker, _amount)) | |
189 | 189 | } | |
190 | 190 | } | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | ||
194 | 194 | @Callable(i) | |
195 | 195 | func unStake (_amount) = { | |
196 | 196 | let _staker = toString(i.caller) | |
197 | 197 | if (if (if ((_amount > balanceOf(_staker))) | |
198 | 198 | then true | |
199 | 199 | else (i.payments != nil)) | |
200 | 200 | then true | |
201 | 201 | else !(initialized())) | |
202 | 202 | then throw("Invalid unStake parameters") | |
203 | 203 | else { | |
204 | 204 | let $t063866551 = updateReward(_staker, 0) | |
205 | 205 | let newRewardPerTokenStored = $t063866551._1 | |
206 | 206 | let newLastUpdateTime = $t063866551._2 | |
207 | 207 | let stakerEarned = $t063866551._3 | |
208 | 208 | let stakerRewardPerTokenPaid = $t063866551._4 | |
209 | 209 | ((((updateUserRewards(_staker, stakerEarned, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateBalance(_staker, -(_amount))) ++ [ScriptTransfer(i.caller, _amount, governanceAsset())]) | |
210 | 210 | } | |
211 | 211 | } | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | ||
215 | 215 | @Callable(i) | |
216 | 216 | func withdrawRewards () = { | |
217 | 217 | let _staker = toString(i.caller) | |
218 | 218 | let $t070277172 = updateReward(_staker, 0) | |
219 | 219 | let newRewardPerTokenStored = $t070277172._1 | |
220 | 220 | let newLastUpdateTime = $t070277172._2 | |
221 | 221 | let stakerEarned = $t070277172._3 | |
222 | 222 | let stakerRewardPerTokenPaid = $t070277172._4 | |
223 | 223 | if (if ((0 >= stakerEarned)) | |
224 | 224 | then true | |
225 | 225 | else !(initialized())) | |
226 | 226 | then throw("No reward") | |
227 | 227 | else ((((updateUserRewards(_staker, 0, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateRewardBalance(-(stakerEarned))) ++ [ScriptTransfer(i.caller, usdnFromDecimals(stakerEarned), quoteAsset())]) | |
228 | 228 | } | |
229 | 229 | ||
230 | 230 | ||
231 | 231 | ||
232 | 232 | @Callable(i) | |
233 | 233 | func addRewards () = if (if ((i.payments[0].assetId != quoteAsset())) | |
234 | 234 | then true | |
235 | 235 | else !(initialized())) | |
236 | 236 | then throw("Invalid addRewards params") | |
237 | 237 | else { | |
238 | 238 | let _reward = usdnToDecimals(i.payments[0].amount) | |
239 | 239 | let newRewardPerTokenStored = updateReward(NO_ADDRESS, NO_STAKER)._1 | |
240 | 240 | let timestamp = currentTimestampSec() | |
241 | 241 | let newRewardRate = if ((timestamp > periodFinish())) | |
242 | 242 | then (_reward / DURATION) | |
243 | 243 | else { | |
244 | 244 | let remainingTime = (periodFinish() - timestamp) | |
245 | 245 | let leftover = (rewardRate() * remainingTime) | |
246 | 246 | ((_reward + leftover) / DURATION) | |
247 | 247 | } | |
248 | 248 | (((updateRewardRate(newRewardRate) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateRewardBalance(_reward)) ++ updateTime(timestamp, (timestamp + DURATION))) | |
249 | 249 | } | |
250 | 250 | ||
251 | 251 | ||
252 | 252 | ||
253 | 253 | @Callable(i) | |
254 | 254 | func ackRewards () = { | |
255 | 255 | let currentBalance = usdnToDecimals(assetBalance(this, quoteAsset())) | |
256 | 256 | let _rewardBalance = rewardBalance() | |
257 | 257 | let rewardDelta = (currentBalance - _rewardBalance) | |
258 | 258 | if ((0 >= rewardDelta)) | |
259 | 259 | then throw("Invalid ackRewards params") | |
260 | 260 | else { | |
261 | 261 | let _reward = rewardDelta | |
262 | 262 | let newRewardPerTokenStored = updateReward(NO_ADDRESS, NO_STAKER)._1 | |
263 | 263 | let timestamp = currentTimestampSec() | |
264 | 264 | let newRewardRate = if ((timestamp > periodFinish())) | |
265 | 265 | then (_reward / DURATION) | |
266 | 266 | else { | |
267 | 267 | let remainingTime = (periodFinish() - timestamp) | |
268 | 268 | let leftover = (rewardRate() * remainingTime) | |
269 | 269 | ((_reward + leftover) / DURATION) | |
270 | 270 | } | |
271 | 271 | (((updateRewardRate(newRewardRate) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateRewardBalance(_reward)) ++ updateTime(timestamp, (timestamp + DURATION))) | |
272 | 272 | } | |
273 | 273 | } | |
274 | 274 | ||
275 | 275 | ||
276 | 276 | ||
277 | 277 | @Callable(i) | |
278 | 278 | func view_reward (_staker) = { | |
279 | 279 | let stakerEarned = updateReward(_staker, 0)._3 | |
280 | 280 | throw(toString(usdnFromDecimals(stakerEarned))) | |
281 | 281 | } | |
282 | 282 | ||
283 | 283 | ||
284 | + | ||
285 | + | @Callable(i) | |
286 | + | func computeReward (_staker) = { | |
287 | + | let stakerEarned = updateReward(_staker, 0)._3 | |
288 | + | $Tuple2(nil, stakerEarned) | |
289 | + | } | |
290 | + | ||
291 | + | ||
284 | 292 | @Verifier(tx) | |
285 | 293 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey()) | |
286 | 294 |
github/deemru/w8io/026f985 47.64 ms ◑