tx · 5vY7SQV7opabuV7gKuD9yZh5fKArmnDLBkgKpx5EHr3x 3MvwsE52cFC6JqbRqe7FykmsYJrCjS5prJa: -0.03200000 Waves 2022.06.12 16:56 [2093253] smart account 3MvwsE52cFC6JqbRqe7FykmsYJrCjS5prJa > SELF 0.00000000 Waves
{ "type": 13, "id": "5vY7SQV7opabuV7gKuD9yZh5fKArmnDLBkgKpx5EHr3x", "fee": 3200000, "feeAssetId": null, "timestamp": 1655042256599, "version": 2, "chainId": 84, "sender": "3MvwsE52cFC6JqbRqe7FykmsYJrCjS5prJa", "senderPublicKey": "AvkNrJfaSpgzDrwWuAckfs5Zts96BioQuWV5qX4JxER2", "proofs": [ "3Xi78X6gBYWq5r5HGCCsniokJ8ftj8nACHmDgeyHrkoggEhfSasaMSUDxHCG3ryNx9pWLxW2R8TjRDt92eZAi2jh" ], "script": "base64:AAIFAAAAAAAAABQIAhIAEgMKAQESABIAEgASAwoBCAAAACsAAAAADWtfdG90YWxTdXBwbHkCAAAADWtfdG90YWxTdXBwbHkAAAAAD2tfcmV3YXJkQmFsYW5jZQIAAAAPa19yZXdhcmRCYWxhbmNlAAAAABBrX2xhc3RVcGRhdGVUaW1lAgAAABBrX2xhc3RVcGRhdGVUaW1lAAAAABZrX3Jld2FyZFBlclRva2VuU3RvcmVkAgAAABZrX3Jld2FyZFBlclRva2VuU3RvcmVkAAAAAAxrX3Jld2FyZFJhdGUCAAAADGtfcmV3YXJkUmF0ZQAAAAAOa19wZXJpb2RGaW5pc2gCAAAADmtfcGVyaW9kRmluaXNoAAAAAAlrX2JhbGFuY2UCAAAACWtfYmFsYW5jZQAAAAAUa191c2VyUmV3YXJkUGVyVG9rZW4CAAAAFGtfdXNlclJld2FyZFBlclRva2VuAAAAAAxrX3VzZXJSZXdhcmQCAAAADGtfdXNlclJld2FyZAAAAAANQURNSU5fQUREUkVTUwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVNZcZGQaI8r5dCglM5gFf/qyn9gLAXvHWgAAAA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19zdGFrZXIEAAAADHN0YWtlckVhcm5lZAgJAQAAAAx1cGRhdGVSZXdhcmQAAAACBQAAAAdfc3Rha2VyAAAAAAAAAAAAAAAAAl8zCQAAAgAAAAEJAAGkAAAAAQUAAAAMc3Rha2VyRWFybmVkAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXlwVB2c", "height": 2093253, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none 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 ADMIN_ADDRESS = Address(base58'3N9TX4VTous51izBtUjw29qBn3dTUqEQJ4Z') | |
23 | + | ||
24 | + | let USDN = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' | |
25 | + | ||
26 | + | let TSN = base58'HL6bTgU1e5SoaSDxp9PV1Bj8WvKAk8jReNwgax44d5S6' | |
27 | + | ||
28 | + | let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
29 | + | ||
30 | + | let DURATION = ((60 * 60) * 24) | |
31 | + | ||
32 | + | let NO_ADDDRESS = "" | |
33 | + | ||
34 | + | let NO_STAKER = 0 | |
35 | + | ||
36 | + | func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN) | |
37 | + | ||
38 | + | ||
39 | + | func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN) | |
40 | + | ||
41 | + | ||
42 | + | func abs (_x) = if ((_x > 0)) | |
43 | + | then _x | |
44 | + | else -(_x) | |
45 | + | ||
46 | + | ||
47 | + | func minv (_x,_y) = if ((_x > _y)) | |
48 | + | then _y | |
49 | + | else _x | |
50 | + | ||
51 | + | ||
52 | + | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
53 | + | ||
54 | + | ||
55 | + | func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k)) | |
56 | + | ||
57 | + | ||
58 | + | func int0 (k) = valueOrElse(getInteger(this, k), 0) | |
59 | + | ||
60 | + | ||
61 | + | func totalSupply () = int0(k_totalSupply) | |
62 | + | ||
63 | + | ||
64 | + | func rewardPerTokenStored () = int0(k_rewardPerTokenStored) | |
65 | + | ||
66 | + | ||
67 | + | func lastUpdateTime () = int0(k_lastUpdateTime) | |
68 | + | ||
69 | + | ||
70 | + | func rewardRate () = int0(k_rewardRate) | |
71 | + | ||
72 | + | ||
73 | + | func periodFinish () = int0(k_periodFinish) | |
74 | + | ||
75 | + | ||
76 | + | func rewardBalance () = int0(k_rewardBalance) | |
77 | + | ||
78 | + | ||
79 | + | func rewards (_staker) = int0(toCompositeKey(k_userReward, _staker)) | |
80 | + | ||
81 | + | ||
82 | + | func userRewardPerTokenPaid (_staker) = int0(toCompositeKey(k_userRewardPerToken, _staker)) | |
83 | + | ||
84 | + | ||
85 | + | func balanceOf (_staker) = int0(toCompositeKey(k_balance, _staker)) | |
86 | + | ||
87 | + | ||
88 | + | func updateRewardBalance (_delta) = [IntegerEntry(k_rewardBalance, (rewardBalance() + _delta))] | |
89 | + | ||
90 | + | ||
91 | + | func updateRewardRate (_rewardRate) = [IntegerEntry(k_rewardRate, _rewardRate)] | |
92 | + | ||
93 | + | ||
94 | + | func updateTime (_lastUpdateTime,_periodFinish) = [IntegerEntry(k_lastUpdateTime, _lastUpdateTime), IntegerEntry(k_periodFinish, _periodFinish)] | |
95 | + | ||
96 | + | ||
97 | + | func updateRewardPerTokenStored (_rewardPerTokenStored) = [IntegerEntry(k_rewardPerTokenStored, _rewardPerTokenStored)] | |
98 | + | ||
99 | + | ||
100 | + | func updateUserRewards (_staker,_reward,_userRewardPerToken) = [IntegerEntry(toCompositeKey(k_userReward, _staker), _reward), IntegerEntry(toCompositeKey(k_userRewardPerToken, _staker), _userRewardPerToken)] | |
101 | + | ||
102 | + | ||
103 | + | func updateBalance (_staker,_delta) = [IntegerEntry(toCompositeKey(k_balance, _staker), (balanceOf(_staker) + _delta)), IntegerEntry(k_totalSupply, (totalSupply() + _delta))] | |
104 | + | ||
105 | + | ||
106 | + | func currentTimestampSec () = (lastBlock.timestamp / 1000) | |
107 | + | ||
108 | + | ||
109 | + | func lastTimeRewardApplicable () = minv(currentTimestampSec(), periodFinish()) | |
110 | + | ||
111 | + | ||
112 | + | func rewardPerToken (_balanceDelta) = if (((totalSupply() + _balanceDelta) == 0)) | |
113 | + | then rewardPerTokenStored() | |
114 | + | else { | |
115 | + | let timeInterval = (lastTimeRewardApplicable() - lastUpdateTime()) | |
116 | + | let diff = (divd(rewardRate(), (totalSupply() + _balanceDelta)) * timeInterval) | |
117 | + | (rewardPerTokenStored() + diff) | |
118 | + | } | |
119 | + | ||
120 | + | ||
121 | + | func earned (_staker,_balanceDelta) = { | |
122 | + | let rewardDelta = (rewardPerToken(_balanceDelta) - userRewardPerTokenPaid(_staker)) | |
123 | + | (muld((balanceOf(_staker) + _balanceDelta), rewardDelta) + rewards(_staker)) | |
124 | + | } | |
125 | + | ||
126 | + | ||
127 | + | func updateReward (_staker,_balanceDelta) = { | |
128 | + | let newRewardPerTokenStored = rewardPerToken(_balanceDelta) | |
129 | + | let newLastUpdateTime = currentTimestampSec() | |
130 | + | let $t041154307 = if ((_staker != "")) | |
131 | + | then $Tuple2(earned(_staker, _balanceDelta), newRewardPerTokenStored) | |
132 | + | else $Tuple2(0, 0) | |
133 | + | let stakerEarned = $t041154307._1 | |
134 | + | let stakerRewardPerTokenPaid = $t041154307._2 | |
135 | + | $Tuple4(newRewardPerTokenStored, newLastUpdateTime, stakerEarned, stakerRewardPerTokenPaid) | |
136 | + | } | |
137 | + | ||
138 | + | ||
139 | + | @Callable(i) | |
140 | + | func stake () = { | |
141 | + | let _staker = toString(i.caller) | |
142 | + | let _amount = i.payments[0].amount | |
143 | + | if ((i.payments[0].assetId != TSN)) | |
144 | + | then throw("Invalid staking asset") | |
145 | + | else { | |
146 | + | let $t046474818 = updateReward(_staker, _amount) | |
147 | + | let newRewardPerTokenStored = $t046474818._1 | |
148 | + | let newLastUpdateTime = $t046474818._2 | |
149 | + | let stakerEarned = $t046474818._3 | |
150 | + | let stakerRewardPerTokenPaid = $t046474818._4 | |
151 | + | (((updateUserRewards(_staker, 0, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateBalance(_staker, _amount)) | |
152 | + | } | |
153 | + | } | |
154 | + | ||
155 | + | ||
156 | + | ||
157 | + | @Callable(i) | |
158 | + | func unStake (_amount) = { | |
159 | + | let _staker = toString(i.caller) | |
160 | + | if ((_amount > balanceOf(_staker))) | |
161 | + | then throw("Invalid balance") | |
162 | + | else { | |
163 | + | let $t052655437 = updateReward(_staker, -(_amount)) | |
164 | + | let newRewardPerTokenStored = $t052655437._1 | |
165 | + | let newLastUpdateTime = $t052655437._2 | |
166 | + | let stakerEarned = $t052655437._3 | |
167 | + | let stakerRewardPerTokenPaid = $t052655437._4 | |
168 | + | ((((updateUserRewards(_staker, 0, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateBalance(_staker, -(_amount))) ++ [ScriptTransfer(i.caller, _amount, TSN)]) | |
169 | + | } | |
170 | + | } | |
171 | + | ||
172 | + | ||
173 | + | ||
174 | + | @Callable(i) | |
175 | + | func withdrawRewards () = { | |
176 | + | let _staker = toString(i.caller) | |
177 | + | let $t058886033 = updateReward(_staker, 0) | |
178 | + | let newRewardPerTokenStored = $t058886033._1 | |
179 | + | let newLastUpdateTime = $t058886033._2 | |
180 | + | let stakerEarned = $t058886033._3 | |
181 | + | let stakerRewardPerTokenPaid = $t058886033._4 | |
182 | + | if ((0 >= stakerEarned)) | |
183 | + | then throw("No reward") | |
184 | + | else ((((updateUserRewards(_staker, 0, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateRewardBalance(-(stakerEarned))) ++ [ScriptTransfer(i.caller, stakerEarned, USDN)]) | |
185 | + | } | |
186 | + | ||
187 | + | ||
188 | + | ||
189 | + | @Callable(i) | |
190 | + | func addRewards () = if ((i.payments[0].assetId != USDN)) | |
191 | + | then throw("Invaliid addRewards params") | |
192 | + | else { | |
193 | + | let _reward = i.payments[0].amount | |
194 | + | let newRewardPerTokenStored = updateReward(NO_ADDDRESS, NO_STAKER)._1 | |
195 | + | let timestamp = currentTimestampSec() | |
196 | + | let newRewardRate = if ((timestamp > periodFinish())) | |
197 | + | then (_reward / DURATION) | |
198 | + | else { | |
199 | + | let remainingTime = (periodFinish() - timestamp) | |
200 | + | let leftover = (rewardRate() * remainingTime) | |
201 | + | ((_reward + leftover) / DURATION) | |
202 | + | } | |
203 | + | (((updateRewardRate(newRewardRate) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateRewardBalance(_reward)) ++ updateTime(timestamp, (timestamp + DURATION))) | |
204 | + | } | |
205 | + | ||
206 | + | ||
207 | + | ||
208 | + | @Callable(i) | |
209 | + | func ackRewards () = { | |
210 | + | let currentBalance = assetBalance(this, USDN) | |
211 | + | let rewardBalancee = rewardBalance() | |
212 | + | let rewardDelta = (currentBalance - rewardBalancee) | |
213 | + | if ((rewardDelta == 0)) | |
214 | + | then throw("Invaliid ackRewards params") | |
215 | + | else { | |
216 | + | let _reward = rewardDelta | |
217 | + | let newRewardPerTokenStored = updateReward(NO_ADDDRESS, NO_STAKER)._1 | |
218 | + | let timestamp = currentTimestampSec() | |
219 | + | let newRewardRate = if ((timestamp > periodFinish())) | |
220 | + | then (_reward / DURATION) | |
221 | + | else { | |
222 | + | let remainingTime = (periodFinish() - timestamp) | |
223 | + | let leftover = (rewardRate() * remainingTime) | |
224 | + | ((_reward + leftover) / DURATION) | |
225 | + | } | |
226 | + | (((updateRewardRate(newRewardRate) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateRewardBalance(_reward)) ++ updateTime(timestamp, (timestamp + DURATION))) | |
227 | + | } | |
228 | + | } | |
229 | + | ||
230 | + | ||
231 | + | ||
232 | + | @Callable(i) | |
233 | + | func view_reward (_staker) = { | |
234 | + | let stakerEarned = updateReward(_staker, 0)._3 | |
235 | + | throw(toString(stakerEarned)) | |
236 | + | } | |
237 | + | ||
238 | + | ||
239 | + | @Verifier(tx) | |
240 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
241 | + |
github/deemru/w8io/169f3d6 31.69 ms ◑