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