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