tx · 71r7ZViEKC8XVTZWesPLV9AmiXCWgB1Nx1toBtHm6tti 3N2FhV4aJTaTwQCYXoBfQUcV8AT6VAZ1Zox: -0.01000000 Waves 2022.08.31 12:28 [2208444] smart account 3N2FhV4aJTaTwQCYXoBfQUcV8AT6VAZ1Zox > SELF 0.00000000 Waves
{ "type": 13, "id": "71r7ZViEKC8XVTZWesPLV9AmiXCWgB1Nx1toBtHm6tti", "fee": 1000000, "feeAssetId": null, "timestamp": 1661938160285, "version": 2, "chainId": 84, "sender": "3N2FhV4aJTaTwQCYXoBfQUcV8AT6VAZ1Zox", "senderPublicKey": "Tp9jnbuTmxLd2Kg33yZyfaYnQoDYg7p2VpmLRyk4HoF", "proofs": [ "5noThRYSf2rQNpJjDmc5AqbKtd8RDcqtdpLLSk2c3evyj1pgYkyh6kvqdWc9qC9K9AKu4CyCG8C8MzWCvdo2xHuQ" ], "script": "base64:BgIjCAISABIAEgASAwoBBBIAEgASBAoCAQQSAwoBBBIDCgEIEgAlAAtrZXlNQWNjUEtleQIJbWFzdGVyX3BrAQxnZXRDRkFkZHJlc3MACQERQGV4dHJOYXRpdmUoMTA2MikBCQERQGV4dHJOYXRpdmUoMTA1MykCBQR0aGlzAgpDRl9BRERSRVNTAAhtQWNjUEtleQkA2QQBCQERQGV4dHJOYXRpdmUoMTA1MykCCQEMZ2V0Q0ZBZGRyZXNzAAULa2V5TUFjY1BLZXkACG1BY2NBZGRyCQCnCAEFCG1BY2NQS2V5ARFnZXRDb3Vwb25zQWRkcmVzcwAJARFAZXh0ck5hdGl2ZSgxMDYyKQEJARFAZXh0ck5hdGl2ZSgxMDUzKQIFCG1BY2NBZGRyAg9DT1VQT05TX0FERFJFU1MAEGtleVRvdGFsQ29tcG91bmQCDnRvdGFsX2NvbXBvdW5kABFrZXlTdGFrZWRDb21wb3VuZAIPc3Rha2VkX2NvbXBvdW5kAAlrZXlMYXN0VlACEmxhc3RfdmlydHVhbF9wcmljZQAHVlBTY2FsZQCAwtcvARVrZ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W91bnQFBmFtb3VudAkAzAgCCQEMSW50ZWdlckVudHJ5AgkBD2tleVN0YWtlZEFtb3VudAEIBQFpBmNhbGxlcgkAZAIJAQ10cnlHZXRJbnRlZ2VyAQkBD2tleVN0YWtlZEFtb3VudAEIBQFpBmNhbGxlcgUGYW1vdW50BQNuaWwFCXZvdGVQb3dlcgFpAQxpbml0aWF0ZURhcHABB2FkZHJlc3MDCQEMaXNMaXF1aWRhdGVkAAkAAgECFkNJRDogQ0YgaXMgbGlxdWlkYXRlZCEDCQECIT0CCAUBaQZjYWxsZXIFBHRoaXMJAAIBAitDSUQ6IENhbiBiZSBjYWxsZWQgb25seSBieSB0aGUgZGFwcC1hY2NvdW50CQEXc2V0Q0ZBZGRyZXNzQW5kSW5pdGlhdGUBBQdhZGRyZXNzAWkBC2NsYWltUmV3YXJkAAMJAQxpc0xpcXVpZGF0ZWQACQACAQIWQ0NSOiBDRiBpcyBsaXF1aWRhdGVkIQMJAGYCCQCQAwEIBQFpCHBheW1lbnRzAAAJAAIBAh5DQ1I6IFBsZWFzZSBkb24ndCBhZGQgcGF5bWVudHMJARJjbGFpbVN0YWtpbmdSZXN1bHQBCAUBaQZjYWxsZXIA4rH+nQ==", "height": 2208444, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let keyMAccPKey = "master_pk" | |
5 | + | ||
6 | + | func getCFAddress () = addressFromStringValue(getStringValue(this, "CF_ADDRESS")) | |
7 | + | ||
8 | + | ||
9 | + | let mAccPKey = fromBase58String(getStringValue(getCFAddress(), keyMAccPKey)) | |
10 | + | ||
11 | + | let mAccAddr = addressFromPublicKey(mAccPKey) | |
12 | + | ||
13 | + | func getCouponsAddress () = addressFromStringValue(getStringValue(mAccAddr, "COUPONS_ADDRESS")) | |
14 | + | ||
15 | + | ||
16 | + | let keyTotalCompound = "total_compound" | |
17 | + | ||
18 | + | let keyStakedCompound = "staked_compound" | |
19 | + | ||
20 | + | let keyLastVP = "last_virtual_price" | |
21 | + | ||
22 | + | let VPScale = 100000000 | |
23 | + | ||
24 | + | func keyStakedCompoundUser (user) = ((toString(user) + "_") + keyStakedCompound) | |
25 | + | ||
26 | + | ||
27 | + | func calcVirtualPrice (totalStaked,total) = if ((total == 0)) | |
28 | + | then 1 | |
29 | + | else if ((totalStaked == 0)) | |
30 | + | then 1 | |
31 | + | else fraction(total, VPScale, totalStaked) | |
32 | + | ||
33 | + | ||
34 | + | let Scale = 100000000 | |
35 | + | ||
36 | + | func keyStakedAmount (address) = (toString(address) + "_farm_staked") | |
37 | + | ||
38 | + | ||
39 | + | func keyLastCheckInterest (address) = (toString(address) + "_lastCheck_interest") | |
40 | + | ||
41 | + | ||
42 | + | func keyEggClaimed (address) = (toString(address) + "_claimed") | |
43 | + | ||
44 | + | ||
45 | + | let keyGlobalLastInterest = "global_lastCheck_interest" | |
46 | + | ||
47 | + | let keyGlobalStaked = "global_staked" | |
48 | + | ||
49 | + | let keyGlobalEggEarned = "global_earnings" | |
50 | + | ||
51 | + | let kLockedInvestments = "locked_investments" | |
52 | + | ||
53 | + | func isCollectiveFarmLocked () = match getBoolean(getCFAddress(), kLockedInvestments) { | |
54 | + | case b: Boolean => | |
55 | + | b | |
56 | + | case _ => | |
57 | + | false | |
58 | + | } | |
59 | + | ||
60 | + | ||
61 | + | func getEggId () = fromBase58String(getStringValue(mAccAddr, "EGG_ASSET_ID")) | |
62 | + | ||
63 | + | ||
64 | + | func setCFAddressAndInitiate (address) = [StringEntry("CF_ADDRESS", address), IntegerEntry(keyGlobalLastInterest, 1)] | |
65 | + | ||
66 | + | ||
67 | + | func getShareAssetId () = fromBase58String(getStringValue(getCFAddress(), "SHARE_ASSET_ID")) | |
68 | + | ||
69 | + | ||
70 | + | func tryGetInteger (key) = match getInteger(this, key) { | |
71 | + | case b: Int => | |
72 | + | b | |
73 | + | case _ => | |
74 | + | 0 | |
75 | + | } | |
76 | + | ||
77 | + | ||
78 | + | func tryGetString (key) = match getString(this, key) { | |
79 | + | case a: String => | |
80 | + | a | |
81 | + | case _ => | |
82 | + | "" | |
83 | + | } | |
84 | + | ||
85 | + | ||
86 | + | func getVoteHeightKey () = "VOTE_HEIGHT_START" | |
87 | + | ||
88 | + | ||
89 | + | func getDuration () = 10000 | |
90 | + | ||
91 | + | ||
92 | + | func getVoteByUserKey (user,height) = ((("VOTE_" + user) + "_") + height) | |
93 | + | ||
94 | + | ||
95 | + | func getTotalVoteByTypeKey (type,height) = ((("VOTE_TOTAL_" + type) + "_") + height) | |
96 | + | ||
97 | + | ||
98 | + | func getTotalVoteKey (height) = ("VOTE_TOTAL_" + height) | |
99 | + | ||
100 | + | ||
101 | + | func resultVoteKey (height) = ("LIQUIDATED_" + height) | |
102 | + | ||
103 | + | ||
104 | + | func quorumVoteKey (height) = ("QUORUM_" + height) | |
105 | + | ||
106 | + | ||
107 | + | func claimStakingResult (address) = { | |
108 | + | let currentInterest = tryGetInteger(keyGlobalLastInterest) | |
109 | + | let lastCheckInterest = tryGetInteger(keyLastCheckInterest(address)) | |
110 | + | let stakedAmount = tryGetInteger(keyStakedAmount(address)) | |
111 | + | let reward = if ((lastCheckInterest > 0)) | |
112 | + | then fraction((currentInterest - lastCheckInterest), stakedAmount, Scale) | |
113 | + | else 0 | |
114 | + | let transfer = if ((reward > 0)) | |
115 | + | then [ScriptTransfer(address, reward, getEggId())] | |
116 | + | else nil | |
117 | + | (transfer ++ [IntegerEntry(keyLastCheckInterest(address), currentInterest), IntegerEntry(keyEggClaimed(address), (tryGetInteger(keyEggClaimed(address)) + reward))]) | |
118 | + | } | |
119 | + | ||
120 | + | ||
121 | + | func handleStakingTopUp (amount) = { | |
122 | + | let currentInterest = tryGetInteger(keyGlobalLastInterest) | |
123 | + | let totalStakedAmount = tryGetInteger(keyGlobalStaked) | |
124 | + | let interestDelta = if ((totalStakedAmount > 0)) | |
125 | + | then fraction(amount, Scale, totalStakedAmount) | |
126 | + | else 0 | |
127 | + | [IntegerEntry(keyGlobalEggEarned, (tryGetInteger(keyGlobalEggEarned) + amount)), IntegerEntry(keyGlobalLastInterest, (currentInterest + interestDelta))] | |
128 | + | } | |
129 | + | ||
130 | + | ||
131 | + | func addVotePower (caller,h,vote,votePower) = if (if ((h == 0)) | |
132 | + | then (vote != "") | |
133 | + | else false) | |
134 | + | then nil | |
135 | + | else if ((height > (h + getDuration()))) | |
136 | + | then throw("CV: Voting is finished, please finalize the vote!") | |
137 | + | else { | |
138 | + | let voteTotalByType = tryGetInteger(getTotalVoteByTypeKey(vote, toString(h))) | |
139 | + | let totalVote = tryGetInteger(getTotalVoteKey(toString(h))) | |
140 | + | [StringEntry(getVoteByUserKey(caller, toString(h)), vote), IntegerEntry(getTotalVoteByTypeKey(vote, toString(h)), (voteTotalByType + votePower)), IntegerEntry(getTotalVoteKey(toString(h)), (totalVote + votePower))] | |
141 | + | } | |
142 | + | ||
143 | + | ||
144 | + | func adaptVotePowerStake (caller,votePower) = { | |
145 | + | let voteHeight = tryGetInteger(getVoteHeightKey()) | |
146 | + | let voteByUserString = tryGetString(getVoteByUserKey(caller, toString(voteHeight))) | |
147 | + | addVotePower(caller, voteHeight, voteByUserString, votePower) | |
148 | + | } | |
149 | + | ||
150 | + | ||
151 | + | func isLiquidated () = { | |
152 | + | let voteHeight = tryGetInteger(getVoteHeightKey()) | |
153 | + | if ((voteHeight == 0)) | |
154 | + | then false | |
155 | + | else getBooleanValue(resultVoteKey(toString(voteHeight))) | |
156 | + | } | |
157 | + | ||
158 | + | ||
159 | + | @Callable(i) | |
160 | + | func claimRefundStaked () = { | |
161 | + | let addressStr = toString(i.caller) | |
162 | + | let stakedAmount = tryGetInteger(keyStakedAmount(i.caller)) | |
163 | + | let voteHeight = tryGetInteger(getVoteHeightKey()) | |
164 | + | let voteByUserString = tryGetString(getVoteByUserKey(addressStr, toString(voteHeight))) | |
165 | + | let multiplier = if ((voteByUserString == "")) | |
166 | + | then 7 | |
167 | + | else 10 | |
168 | + | let refund = ((stakedAmount / 10) * multiplier) | |
169 | + | let couponsCall = invoke(getCouponsAddress(), "CFRefund", [addressStr, refund], nil) | |
170 | + | if ((couponsCall == couponsCall)) | |
171 | + | then [IntegerEntry(keyStakedAmount(i.caller), 0), Burn(getShareAssetId(), stakedAmount)] | |
172 | + | else throw("Strict value is not equal to itself.") | |
173 | + | } | |
174 | + | ||
175 | + | ||
176 | + | ||
177 | + | @Callable(i) | |
178 | + | func claimRefundUnstaked () = { | |
179 | + | let shareTokenId = getShareAssetId() | |
180 | + | if ((size(i.payments) > 1)) | |
181 | + | then throw("CSFT: To many payments added") | |
182 | + | else if ((i.payments[0].assetId != shareTokenId)) | |
183 | + | then throw("CSFT: Wrong assetId") | |
184 | + | else { | |
185 | + | let amount = i.payments[0].amount | |
186 | + | if ((amount == 0)) | |
187 | + | then throw("CSFT: Please attach positive asset amount!") | |
188 | + | else { | |
189 | + | let addressStr = toString(i.caller) | |
190 | + | let multiplier = 7 | |
191 | + | let refund = ((amount / 10) * multiplier) | |
192 | + | let couponsCall = invoke(getCouponsAddress(), "CFRefund", [addressStr, refund], nil) | |
193 | + | if ((couponsCall == couponsCall)) | |
194 | + | then [Burn(getShareAssetId(), amount)] | |
195 | + | else throw("Strict value is not equal to itself.") | |
196 | + | } | |
197 | + | } | |
198 | + | } | |
199 | + | ||
200 | + | ||
201 | + | ||
202 | + | @Callable(i) | |
203 | + | func startVote () = if ((i.caller != mAccAddr)) | |
204 | + | then throw("CSV: Only the admin can start a liquidation vote for now!") | |
205 | + | else if ((tryGetInteger(getVoteHeightKey()) != 0)) | |
206 | + | then throw("CSV: There is already a vote running!") | |
207 | + | else [IntegerEntry("VOTE_HEIGHT_START", height)] | |
208 | + | ||
209 | + | ||
210 | + | ||
211 | + | @Callable(i) | |
212 | + | func voteToLiquidate (vote) = { | |
213 | + | let votePower = tryGetInteger(keyStakedAmount(i.caller)) | |
214 | + | if ((votePower == 0)) | |
215 | + | then throw("CVTL: Please stake some tokens before you can vote!") | |
216 | + | else { | |
217 | + | let voteAsString = toString(vote) | |
218 | + | let voteHeight = tryGetInteger(getVoteHeightKey()) | |
219 | + | if ((height > (voteHeight + getDuration()))) | |
220 | + | then throw("CV: Voting is finished, please finalize the vote!") | |
221 | + | else { | |
222 | + | let voteByUserString = tryGetString(getVoteByUserKey(toString(i.caller), toString(voteHeight))) | |
223 | + | if ((voteByUserString != "")) | |
224 | + | then throw("CV: You can not change your vote!") | |
225 | + | else addVotePower(toString(i.caller), voteHeight, voteAsString, votePower) | |
226 | + | } | |
227 | + | } | |
228 | + | } | |
229 | + | ||
230 | + | ||
231 | + | ||
232 | + | @Callable(i) | |
233 | + | func finalizeVote () = { | |
234 | + | let voteHeight = tryGetInteger(getVoteHeightKey()) | |
235 | + | if (((voteHeight + getDuration()) > height)) | |
236 | + | then throw("CFV: Voting is not finished!") | |
237 | + | else { | |
238 | + | let totalStakedAmount = tryGetInteger(keyGlobalStaked) | |
239 | + | let totalVote = tryGetInteger(getTotalVoteKey(toString(voteHeight))) | |
240 | + | let quorum = ((totalVote / totalStakedAmount) * 100) | |
241 | + | let voteTotalByYes = tryGetInteger(getTotalVoteByTypeKey("true", toString(voteHeight))) | |
242 | + | let voteTotalByNo = tryGetInteger(getTotalVoteByTypeKey("false", toString(voteHeight))) | |
243 | + | let liquidated = if ((20 > quorum)) | |
244 | + | then true | |
245 | + | else if ((voteTotalByYes > voteTotalByNo)) | |
246 | + | then true | |
247 | + | else false | |
248 | + | let resetKey = if (liquidated) | |
249 | + | then nil | |
250 | + | else [IntegerEntry(getVoteHeightKey(), 0)] | |
251 | + | ([IntegerEntry(quorumVoteKey(toString(voteHeight)), quorum), BooleanEntry(resultVoteKey(toString(voteHeight)), liquidated)] ++ resetKey) | |
252 | + | } | |
253 | + | } | |
254 | + | ||
255 | + | ||
256 | + | ||
257 | + | @Callable(i) | |
258 | + | func topUpReward () = if (isLiquidated()) | |
259 | + | then throw("CTUR: CF is liquidated!") | |
260 | + | else { | |
261 | + | let eggAssetId = getEggId() | |
262 | + | let shareTokenId = getShareAssetId() | |
263 | + | if ((i.payments[0].assetId != eggAssetId)) | |
264 | + | then throw("CTUP: Wrong assetId, first payment should be EGG") | |
265 | + | else { | |
266 | + | let resHandleStaking = handleStakingTopUp(i.payments[0].amount) | |
267 | + | $Tuple2(resHandleStaking, true) | |
268 | + | } | |
269 | + | } | |
270 | + | ||
271 | + | ||
272 | + | ||
273 | + | @Callable(i) | |
274 | + | func withdrawFarmTokens (amount,compound) = if (isLiquidated()) | |
275 | + | then throw("CTUR: CF is liquidated!") | |
276 | + | else if ((size(i.payments) > 0)) | |
277 | + | then throw("CWFT: Please don't add payments") | |
278 | + | else { | |
279 | + | let shareTokenId = getShareAssetId() | |
280 | + | if (compound) | |
281 | + | then { | |
282 | + | let staked = tryGetInteger(keyStakedCompound) | |
283 | + | let total = tryGetInteger(keyTotalCompound) | |
284 | + | let vp = calcVirtualPrice(staked, total) | |
285 | + | let keyStakedCompoundU = keyStakedCompoundUser(i.caller) | |
286 | + | let personalStaked = tryGetInteger(keyStakedCompoundU) | |
287 | + | let virtualWd = if ((amount == -1)) | |
288 | + | then personalStaked | |
289 | + | else fraction(amount, VPScale, vp) | |
290 | + | let amountWd = if ((amount == -1)) | |
291 | + | then fraction(virtualWd, vp, VPScale) | |
292 | + | else amount | |
293 | + | if ((virtualWd > personalStaked)) | |
294 | + | then throw("CWFT: You don't have so much funds to withdraw") | |
295 | + | else [IntegerEntry(keyStakedCompoundU, (personalStaked - virtualWd)), IntegerEntry(keyStakedCompound, (staked - virtualWd)), IntegerEntry(keyTotalCompound, (total - amountWd)), ScriptTransfer(i.caller, amountWd, shareTokenId), IntegerEntry(keyLastVP, vp), IntegerEntry("last_virt_compound_wd", virtualWd), IntegerEntry("last_amount_compound_wd", amountWd)] | |
296 | + | } | |
297 | + | else { | |
298 | + | let addressStr = toString(i.caller) | |
299 | + | let stakedAmount = tryGetInteger(keyStakedAmount(i.caller)) | |
300 | + | let wdAmount = if ((amount == -1)) | |
301 | + | then stakedAmount | |
302 | + | else amount | |
303 | + | if ((wdAmount > stakedAmount)) | |
304 | + | then throw("CWFT: you don't have tokens available") | |
305 | + | else { | |
306 | + | let votePower = adaptVotePowerStake(toString(i.caller), -(wdAmount)) | |
307 | + | ((claimStakingResult(i.caller) ++ [IntegerEntry(keyStakedAmount(i.caller), (stakedAmount - wdAmount)), IntegerEntry(keyGlobalStaked, (tryGetInteger(keyGlobalStaked) - wdAmount)), ScriptTransfer(i.caller, wdAmount, shareTokenId), IntegerEntry("last_staking_wd", wdAmount)]) ++ votePower) | |
308 | + | } | |
309 | + | } | |
310 | + | } | |
311 | + | ||
312 | + | ||
313 | + | ||
314 | + | @Callable(i) | |
315 | + | func stakeFarmTokens (compound) = if (isLiquidated()) | |
316 | + | then throw("CSFT: CF is liquidated!") | |
317 | + | else { | |
318 | + | let shareTokenId = getShareAssetId() | |
319 | + | if ((size(i.payments) > 1)) | |
320 | + | then throw("CSFT: To many payments added") | |
321 | + | else if ((i.payments[0].assetId != shareTokenId)) | |
322 | + | then throw("CSFT: Wrong assetId") | |
323 | + | else { | |
324 | + | let amount = i.payments[0].amount | |
325 | + | if ((amount == 0)) | |
326 | + | then throw("CSFT: Please attach positive asset amount!") | |
327 | + | else if (compound) | |
328 | + | then throw("CSFT: Compound was disabled!") | |
329 | + | else { | |
330 | + | let addressStr = toString(i.caller) | |
331 | + | let totalStakedAmount = tryGetInteger(keyGlobalStaked) | |
332 | + | if ((i.payments[0].assetId != shareTokenId)) | |
333 | + | then throw("CSFT: wrong asset attached") | |
334 | + | else { | |
335 | + | let votePower = adaptVotePowerStake(toString(i.caller), amount) | |
336 | + | ((claimStakingResult(i.caller) ++ [IntegerEntry(keyGlobalStaked, (totalStakedAmount + amount)), IntegerEntry(keyStakedAmount(i.caller), (tryGetInteger(keyStakedAmount(i.caller)) + amount))]) ++ votePower) | |
337 | + | } | |
338 | + | } | |
339 | + | } | |
340 | + | } | |
341 | + | ||
342 | + | ||
343 | + | ||
344 | + | @Callable(i) | |
345 | + | func initiateDapp (address) = if (isLiquidated()) | |
346 | + | then throw("CID: CF is liquidated!") | |
347 | + | else if ((i.caller != this)) | |
348 | + | then throw("CID: Can be called only by the dapp-account") | |
349 | + | else setCFAddressAndInitiate(address) | |
350 | + | ||
351 | + | ||
352 | + | ||
353 | + | @Callable(i) | |
354 | + | func claimReward () = if (isLiquidated()) | |
355 | + | then throw("CCR: CF is liquidated!") | |
356 | + | else if ((size(i.payments) > 0)) | |
357 | + | then throw("CCR: Please don't add payments") | |
358 | + | else claimStakingResult(i.caller) | |
359 | + | ||
360 | + |
github/deemru/w8io/026f985 30.98 ms ◑