tx · Cskat5Y56Z9DGvgh2EVtmDT3zg5ibYT8JKaX7pmHgaTn 3MsQHc6Pm5KuQSc8vSq4ciydqau1a1M47pH: -0.01000000 Waves 2023.09.27 17:15 [2773921] smart account 3MsQHc6Pm5KuQSc8vSq4ciydqau1a1M47pH > SELF 0.00000000 Waves
{ "type": 13, "id": "Cskat5Y56Z9DGvgh2EVtmDT3zg5ibYT8JKaX7pmHgaTn", "fee": 1000000, "feeAssetId": null, "timestamp": 1695824115394, "version": 2, "chainId": 84, "sender": "3MsQHc6Pm5KuQSc8vSq4ciydqau1a1M47pH", "senderPublicKey": "5tBqSkEv5fSSCJvPGHVTrTUh8qdU49WJzoSgMdnaHGBY", "proofs": [ "2XdYfeF3pKnDd1KCESYqNrxeo2qjAtZbvgiwWh8EYJ48pf2JAn25AZsEDGnb5P9Eb6UcaH5wHWTMF8DYRF5c6uZ4" ], "script": "base64:BgIYCAISBwoFCAgBCAgSABIDCgEBEgASABIADgAGTVVMVDEwAIDIr6AlAANTRVACAl9fABBpc0NvbnN0cnVjdGVkS2V5Ag5pc19jb25zdHJ1Y3RlZAAXd2l0aGRyYXdhbExvY2tQZXJpb2RLZXkCFndpdGhkcmF3YWxfbG9ja19wZXJpb2QAEHJld2FyZEFzc2V0SWRLZXkCD3Jld2FyZF9hc3NldF9pZAATcG9vbFN0YWtlQXNzZXRJZEtleQITcG9vbF9zdGFrZV9hc3NldF9pZAAWcm9vdENvbnRyYWN0QWRkcmVzc0tleQIVcm9vdF9jb250cmFjdF9hZGRyZXNzAA9hZG1pbkFkZHJlc3NLZXkCEWFkbWluX2FkZHJlc3Nfa2V5ABJ0b3RhbFBvb2xTdGFrZWRLZXkCEnRvdGFsX3Bvb2xfX3N0YWtlZAASdG90YWxQb29sRWFybmVkS2V5AhF0b3RhbF9wb29sX2Vhcm5lZAAVcG9vbEN1cnJlbnRDbGFpbUlkS2V5AhVwb29sX2N1cnJlbnRfY2xhaW1faWQAKHBvb2xDdXJyZW50VW5jbGFpbW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DU1KQEFKHBvb2xDdXJyZW50VW5jbGFpbWVkQWRkaXRpb25hbFJld2FyZHNLZXkJAMwIAgkBDEludGVnZXJFbnRyeQIFKHBvb2xDdXJyZW50VW5jbGFpbWVkQWRkaXRpb25hbFJld2FyZHNLZXkJAGQCBSFjdXJyZW50VW5jbGFpbWVkQWRkaXRpb25hbFJld2FyZHMIBQdwYXltZW50BmFtb3VudAUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleVL+lcc=", "height": 2773921, "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 MULT10 = 10000000000 | |
5 | + | ||
6 | + | let SEP = "__" | |
7 | + | ||
8 | + | let isConstructedKey = "is_constructed" | |
9 | + | ||
10 | + | let withdrawalLockPeriodKey = "withdrawal_lock_period" | |
11 | + | ||
12 | + | let rewardAssetIdKey = "reward_asset_id" | |
13 | + | ||
14 | + | let poolStakeAssetIdKey = "pool_stake_asset_id" | |
15 | + | ||
16 | + | let rootContractAddressKey = "root_contract_address" | |
17 | + | ||
18 | + | let adminAddressKey = "admin_address_key" | |
19 | + | ||
20 | + | let totalPoolStakedKey = "total_pool__staked" | |
21 | + | ||
22 | + | let totalPoolEarnedKey = "total_pool_earned" | |
23 | + | ||
24 | + | let poolCurrentClaimIdKey = "pool_current_claim_id" | |
25 | + | ||
26 | + | let poolCurrentUnclaimedAdditionalRewardsKey = "pool_current_unclaimed_additional_rewards" | |
27 | + | ||
28 | + | func asPayment (v) = match v { | |
29 | + | case p: AttachedPayment => | |
30 | + | p | |
31 | + | case _ => | |
32 | + | throw("fail to cast into AttachedPayment") | |
33 | + | } | |
34 | + | ||
35 | + | ||
36 | + | func isUserHaveUnclaimedRewards (address) = if (!(isDefined(getString(address)))) | |
37 | + | then false | |
38 | + | else { | |
39 | + | let currentPoolClaimId = getIntegerValue(poolCurrentClaimIdKey) | |
40 | + | let userData = split(getStringValue(address), SEP) | |
41 | + | let userLastClaimedRewardsAtPoolClaimId = parseIntValue(userData[2]) | |
42 | + | (currentPoolClaimId > userLastClaimedRewardsAtPoolClaimId) | |
43 | + | } | |
44 | + | ||
45 | + | ||
46 | + | @Callable(i) | |
47 | + | func constructor (rewardAssetId,poolStakeAssetId,withdrawalLockPeriod,rootContract,adminContract) = if (isDefined(getBoolean(isConstructedKey))) | |
48 | + | then throw("Constructor can be called one time") | |
49 | + | else [BooleanEntry(isConstructedKey, true), IntegerEntry(poolCurrentUnclaimedAdditionalRewardsKey, 0), StringEntry(rewardAssetIdKey, rewardAssetId), StringEntry(poolStakeAssetIdKey, poolStakeAssetId), StringEntry(rootContractAddressKey, rootContract), StringEntry(adminAddressKey, adminContract), IntegerEntry(totalPoolEarnedKey, 0), IntegerEntry(poolCurrentClaimIdKey, 0), IntegerEntry(totalPoolStakedKey, 0), IntegerEntry(withdrawalLockPeriodKey, withdrawalLockPeriod)] | |
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | @Callable(i) | |
54 | + | func stake () = if ((size(i.payments) != 1)) | |
55 | + | then throw("One Payment expected") | |
56 | + | else { | |
57 | + | let callerAddress = toBase58String(i.caller.bytes) | |
58 | + | let payment = asPayment(i.payments[0]) | |
59 | + | let poolStakeAssetId = fromBase58String(getStringValue(poolStakeAssetIdKey)) | |
60 | + | if (if ((payment.assetId != poolStakeAssetId)) | |
61 | + | then true | |
62 | + | else (0 >= payment.amount)) | |
63 | + | then throw("Wrong asset id or negative amount") | |
64 | + | else if (isUserHaveUnclaimedRewards(callerAddress)) | |
65 | + | then throw("You have unclaimed rewards on contract, claim them first") | |
66 | + | else { | |
67 | + | let currentPoolClaimId = getIntegerValue(poolCurrentClaimIdKey) | |
68 | + | let currentTotalPoolStaked = getIntegerValue(totalPoolStakedKey) | |
69 | + | let currentTotalPoolRewardsEarnedForOneStakeToken = getIntegerValue(totalPoolEarnedKey) | |
70 | + | let rootContractAddress = getStringValue(rootContractAddressKey) | |
71 | + | let result = if ((size(rootContractAddress) > 0)) | |
72 | + | then invoke(Address(fromBase58String(rootContractAddress)), "stakePoolLps", nil, [payment]) | |
73 | + | else unit | |
74 | + | if ((result == result)) | |
75 | + | then { | |
76 | + | let userDataStr = valueOrElse(getString(callerAddress), "") | |
77 | + | let userData = if ((size(userDataStr) > 0)) | |
78 | + | then { | |
79 | + | let userData = split(userDataStr, SEP) | |
80 | + | let userTotalStakedAmount = parseIntValue(userData[0]) | |
81 | + | makeString([toString((userTotalStakedAmount + payment.amount)), userData[1], userData[2], userData[3], toString(height)], SEP) | |
82 | + | } | |
83 | + | else makeString([toString(payment.amount), "0", toString(currentPoolClaimId), toString(currentTotalPoolRewardsEarnedForOneStakeToken), toString(height)], SEP) | |
84 | + | [StringEntry(callerAddress, userData), IntegerEntry(totalPoolStakedKey, (currentTotalPoolStaked + payment.amount))] | |
85 | + | } | |
86 | + | else throw("Strict value is not equal to itself.") | |
87 | + | } | |
88 | + | } | |
89 | + | ||
90 | + | ||
91 | + | ||
92 | + | @Callable(i) | |
93 | + | func withdraw (amount) = if ((0 >= amount)) | |
94 | + | then throw("Amount must be positive") | |
95 | + | else { | |
96 | + | let callerAddress = toBase58String(i.caller.bytes) | |
97 | + | if (isUserHaveUnclaimedRewards(callerAddress)) | |
98 | + | then throw("You have unclaimed rewards on contract, claim them first") | |
99 | + | else { | |
100 | + | let userData = split(valueOrErrorMessage(getString(callerAddress), "User not found"), SEP) | |
101 | + | let userTotalStakedAmount = parseIntValue(userData[0]) | |
102 | + | if ((amount > userTotalStakedAmount)) | |
103 | + | then throw("Insufficient funds") | |
104 | + | else { | |
105 | + | let withdrawalLockPeriod = getIntegerValue(withdrawalLockPeriodKey) | |
106 | + | let userLastStakeBlock = parseIntValue(userData[4]) | |
107 | + | if (if ((withdrawalLockPeriod > 0)) | |
108 | + | then (withdrawalLockPeriod > (height - userLastStakeBlock)) | |
109 | + | else false) | |
110 | + | then throw((("This pool have lock period. You need to wait " + toString((withdrawalLockPeriod - (height - userLastStakeBlock)))) + " blocks")) | |
111 | + | else { | |
112 | + | let rootContractAddress = getStringValue(rootContractAddressKey) | |
113 | + | let currentTotalPoolStaked = valueOrElse(getInteger(totalPoolStakedKey), 0) | |
114 | + | let poolStakeAssetId = getStringValue(poolStakeAssetIdKey) | |
115 | + | let result = if ((size(rootContractAddress) > 0)) | |
116 | + | then invoke(Address(fromBase58String(rootContractAddress)), "withdrawPoolLps", [amount], nil) | |
117 | + | else unit | |
118 | + | if ((result == result)) | |
119 | + | then { | |
120 | + | let newUserData = [toString((userTotalStakedAmount - amount)), removeByIndex(userData, 0)] | |
121 | + | ([IntegerEntry(totalPoolStakedKey, (currentTotalPoolStaked - amount)), ScriptTransfer(Address(i.caller.bytes), amount, fromBase58String(poolStakeAssetId))] :+ (if (((userTotalStakedAmount - amount) == 0)) | |
122 | + | then DeleteEntry(callerAddress) | |
123 | + | else StringEntry(callerAddress, makeString(newUserData, SEP)))) | |
124 | + | } | |
125 | + | else throw("Strict value is not equal to itself.") | |
126 | + | } | |
127 | + | } | |
128 | + | } | |
129 | + | } | |
130 | + | ||
131 | + | ||
132 | + | ||
133 | + | @Callable(i) | |
134 | + | func claimRewards () = { | |
135 | + | let callerAddress = toBase58String(i.caller.bytes) | |
136 | + | if (!(isUserHaveUnclaimedRewards(callerAddress))) | |
137 | + | then throw("Nothing to claim, or user not found") | |
138 | + | else { | |
139 | + | let poolCurrentClaimId = getIntegerValue(poolCurrentClaimIdKey) | |
140 | + | let totalPoolEarnedRewardsForOneStakeToken = getIntegerValue(totalPoolEarnedKey) | |
141 | + | let userData = split(getStringValue(callerAddress), SEP) | |
142 | + | let userTotalStaked = parseIntValue(userData[0]) | |
143 | + | let userTotalRewardsClaimed = parseIntValue(userData[1]) | |
144 | + | let userLastClaimPoolClaimId = parseIntValue(userData[2]) | |
145 | + | let userAlreadyClaimedRewardsForOneStakeToken = parseIntValue(userData[3]) | |
146 | + | let userUnclaimedPoolEarningsForOneStakeToken = (totalPoolEarnedRewardsForOneStakeToken - userAlreadyClaimedRewardsForOneStakeToken) | |
147 | + | let userClaim = fraction(userUnclaimedPoolEarningsForOneStakeToken, userTotalStaked, MULT10) | |
148 | + | let newUserData = makeString([userData[0], toString((userTotalRewardsClaimed + userClaim)), toString(poolCurrentClaimId), toString((userAlreadyClaimedRewardsForOneStakeToken + userUnclaimedPoolEarningsForOneStakeToken)), userData[4]], SEP) | |
149 | + | let rewardAssetId = fromBase58String(getStringValue(rewardAssetIdKey)) | |
150 | + | [StringEntry(callerAddress, newUserData), ScriptTransfer(i.caller, userClaim, rewardAssetId)] | |
151 | + | } | |
152 | + | } | |
153 | + | ||
154 | + | ||
155 | + | ||
156 | + | @Callable(i) | |
157 | + | func claimPoolRewards () = if ((i.caller.bytes != fromBase58String(getStringValue(adminAddressKey)))) | |
158 | + | then throw("Admin only") | |
159 | + | else { | |
160 | + | let totalPoolStaked = getIntegerValue(totalPoolStakedKey) | |
161 | + | let totalPoolEarned = getIntegerValue(totalPoolEarnedKey) | |
162 | + | let poolCurrentClaimId = getIntegerValue(poolCurrentClaimIdKey) | |
163 | + | let rewardAssetId = fromBase58String(getStringValue(rewardAssetIdKey)) | |
164 | + | let rootContractAddress = getStringValue(rootContractAddressKey) | |
165 | + | let currentRewardOnContract = assetBalance(this, rewardAssetId) | |
166 | + | if ((currentRewardOnContract == currentRewardOnContract)) | |
167 | + | then { | |
168 | + | let rootContractClaim = if ((size(rootContractAddress) > 0)) | |
169 | + | then invoke(Address(fromBase58String(rootContractAddress)), "claimPoolRewards", nil, nil) | |
170 | + | else unit | |
171 | + | if ((rootContractClaim == rootContractClaim)) | |
172 | + | then { | |
173 | + | let newRewardOnContract = assetBalance(this, rewardAssetId) | |
174 | + | let currentAdditionalUnclaimedRewards = getIntegerValue(poolCurrentUnclaimedAdditionalRewardsKey) | |
175 | + | let claimedRewardAmount = ((newRewardOnContract - currentRewardOnContract) + currentAdditionalUnclaimedRewards) | |
176 | + | if ((claimedRewardAmount == 0)) | |
177 | + | then nil | |
178 | + | else { | |
179 | + | let currentClaimIdEarningsForOneStakeToken = fraction(claimedRewardAmount, MULT10, totalPoolStaked) | |
180 | + | [IntegerEntry(poolCurrentClaimIdKey, (poolCurrentClaimId + 1)), IntegerEntry(totalPoolEarnedKey, (totalPoolEarned + currentClaimIdEarningsForOneStakeToken)), IntegerEntry(poolCurrentUnclaimedAdditionalRewardsKey, 0)] | |
181 | + | } | |
182 | + | } | |
183 | + | else throw("Strict value is not equal to itself.") | |
184 | + | } | |
185 | + | else throw("Strict value is not equal to itself.") | |
186 | + | } | |
187 | + | ||
188 | + | ||
189 | + | ||
190 | + | @Callable(i) | |
191 | + | func receiveAdditionalReward () = if ((size(i.payments) != 1)) | |
192 | + | then throw("One Payment expected") | |
193 | + | else { | |
194 | + | let payment = asPayment(i.payments[0]) | |
195 | + | let rewardAssetId = fromBase58String(getStringValue(rewardAssetIdKey)) | |
196 | + | if (if ((payment.assetId != rewardAssetId)) | |
197 | + | then true | |
198 | + | else (0 >= payment.amount)) | |
199 | + | then throw("Wrong reward asset id or negative amount") | |
200 | + | else { | |
201 | + | let currentUnclaimedAdditionalRewards = getIntegerValue(poolCurrentUnclaimedAdditionalRewardsKey) | |
202 | + | [IntegerEntry(poolCurrentUnclaimedAdditionalRewardsKey, (currentUnclaimedAdditionalRewards + payment.amount))] | |
203 | + | } | |
204 | + | } | |
205 | + | ||
206 | + | ||
207 | + | @Verifier(tx) | |
208 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
209 | + |
github/deemru/w8io/026f985 22.61 ms ◑