tx · 8nAmz4b52GRuJxvKgapCad3GjtggsPCwpCA8s2M9ebJW 3MuGfNhF98CNBCfthhoJEo6SYUv7zTgkK4J: -0.02500000 Waves 2023.03.01 16:44 [2471076] smart account 3MuGfNhF98CNBCfthhoJEo6SYUv7zTgkK4J > SELF 0.00000000 Waves
{ "type": 13, "id": "8nAmz4b52GRuJxvKgapCad3GjtggsPCwpCA8s2M9ebJW", "fee": 2500000, "feeAssetId": null, "timestamp": 1677678259774, "version": 2, "chainId": 84, "sender": "3MuGfNhF98CNBCfthhoJEo6SYUv7zTgkK4J", "senderPublicKey": "4DthuG3xjZV9WtZ34Y66AummdAr67wRzwWsVQL4y2bob", "proofs": [ "2o2CxHoxBaxmfUustzjQUZhhAAvdyzn66d1jpygqC9yDwt9BnJg2YASmad1rg5EfJquYZVZwe51vXwrrqS5eu6hQ", "g3xtzPDFG1RrixZKATxJJCQ81X7naCSFxpXRuDmPLQxQcUHL3Thw1WcDgBQcSYA766groVKZKXN4ahiqgCNQMCo", "3wGjZTr95TTSQhDiWKa9jkCj7fyYVxb2ThgwwcTvpofAwgRR6BUvTLvTPp23hvVMz1HEUZDnUNRMwvZ4NzZB1Yty" ], "script": "base64:BgIpCAISBwoFCAgBAQgSABIDCgEBEgASABIAEgMKAQgSBAoCCAESBAoCCAFRAAlzZXBhcmF0b3ICAl9fAANTRVACAl9fAAVNVUxUNgDAhD0ABU1VTFQ4AIDC1y8ABk1VTFRYNgkAtgIBBQVNVUxUNgAGTVVMVFg4CQC2AgEFBU1VTFQ4AAdNVUxUWDE4CQC2AgEAgICQu7rWrfANAApXQVZFU0lEU1RSAgVXQVZFUwAHV0FWRVNJRAkA2QQBBQpXQVZFU0lEU1RSAAlEQVlNSUxMSVMAgLiZKQAZSWR4Q29udHJvbENmZ05ldXRyaW5vRGFwcAABABhJZHhDb250cm9sQ2ZnQXVjdGlvbkRhcHAAAgAUSWR4Q29udHJvbENmZ1JwZERhcHAAAwAVSWR4Q29udHJvbENmZ01hdGhEY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OUJ5ZjhRbXBaV2VEVlJpbTR5VjcJAMwIAgIsRFV1dUxqWHU5OG5Cd1pjN2Zxd0NUanRBM25uUndnVGJrTVNyNVNVMk5tRFIJAMwIAgIsRFV1dUxqWHU5OG5Cd1pjN2Zxd0NUanRBM25uUndnVGJrTVNyNVNVMk5tRFIFA25pbAUDU0VQBBBwdWJLZXlBZG1pbnNMaXN0CQC1CQIJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUPY29udHJvbENvbnRyYWN0Agwlc19fbXVsdGlzaWcFE3B1YktleUFkbWluc0xpc3RTdHIFA1NFUAQFY291bnQJAGQCCQBkAgkAZAIDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACQDZBAEJAJEDAgUQcHViS2V5QWRtaW5zTGlzdAAAAAEAAAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAEJANkEAQkAkQMCBRBwdWJLZXlBZG1pbnNMaXN0AAEAAQAAAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAgkA2QQBCQCRAwIFEHB1YktleUFkbWluc0xpc3QAAgABAAADCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwADCQDZBAEJAJEDAgUQcHViS2V5QWRtaW5zTGlzdAADAAIAAAkAZwIFBWNvdW50AAOU6Kz7", "height": 2471076, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DkR5VwKLzDvUNktFVrtBLJMsbqLxK2h5fxFcHFyz9mmN Next: 8XRVz3C9SW18UN3dZCdJnc9DtfFpsQxNvSECtHRfA9ZJ Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | let MULT6 = 1000000 | |
9 | 9 | ||
10 | 10 | let MULT8 = 100000000 | |
11 | 11 | ||
12 | 12 | let MULTX6 = toBigInt(MULT6) | |
13 | 13 | ||
14 | 14 | let MULTX8 = toBigInt(MULT8) | |
15 | 15 | ||
16 | 16 | let MULTX18 = toBigInt(1000000000000000000) | |
17 | 17 | ||
18 | 18 | let WAVESIDSTR = "WAVES" | |
19 | 19 | ||
20 | 20 | let WAVESID = fromBase58String(WAVESIDSTR) | |
21 | 21 | ||
22 | 22 | let DAYMILLIS = 86400000 | |
23 | 23 | ||
24 | 24 | let IdxControlCfgNeutrinoDapp = 1 | |
25 | 25 | ||
26 | 26 | let IdxControlCfgAuctionDapp = 2 | |
27 | 27 | ||
28 | 28 | let IdxControlCfgRpdDapp = 3 | |
29 | 29 | ||
30 | 30 | let IdxControlCfgMathDapp = 4 | |
31 | 31 | ||
32 | 32 | let IdxControlCfgLiquidationDapp = 5 | |
33 | 33 | ||
34 | 34 | let IdxControlCfgRestDapp = 6 | |
35 | 35 | ||
36 | 36 | let IdxControlCfgNodeRegistryDapp = 7 | |
37 | 37 | ||
38 | 38 | let IdxControlCfgNsbtStakingDapp = 8 | |
39 | 39 | ||
40 | 40 | let IdxControlCfgMediatorDapp = 9 | |
41 | 41 | ||
42 | 42 | let IdxControlCfgGovernanceDapp = 13 | |
43 | 43 | ||
44 | 44 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func keyControlAddress () = "%s%s__config__controlAddress" | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func keyControlCfg () = "%s__controlConfig" | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func readControlCfgOrFail (control) = split_4C(getStringOrFail(control, keyControlCfg()), SEP) | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx")) | |
60 | 60 | ||
61 | 61 | let controlCfg = readControlCfgOrFail(controlContract) | |
62 | 62 | ||
63 | 63 | let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp) | |
64 | 64 | ||
65 | 65 | let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp) | |
66 | 66 | ||
67 | 67 | let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp) | |
68 | 68 | ||
69 | 69 | let govContract = getContractAddressOrFail(controlCfg, IdxControlCfgGovernanceDapp) | |
70 | 70 | ||
71 | 71 | func keyBondAsset () = "bond_asset_id" | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func keyUserGnsbtReleaseTime (userAddr) = ("%s%s_userGnsbtReleaseTime__" + userAddr) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func keyNeutrinoContractAddress () = "%s__neutrinoContractAddress" | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func keyMathContractAddress () = "%s__mathContract" | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func keyMinLockAmount () = "%s__minLockAmount" | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func keyHalfLife () = "%s__halfLife" | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func keyLockParamUserAmount (userAddress) = makeString(["%s%s%s", "paramByUser", toString(userAddress), "amount"], separator) | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func keyLockParamStartBlock (userAddress) = makeString(["%s%s%s", "paramByUser", toString(userAddress), "start"], separator) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func keyHistoryRecord (type,userAddress,txId) = makeString(["%s%s%s%s", "history", type, toString(userAddress), toBase58String(txId)], separator) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func keyLockParamTotalAmount () = makeString(["%s%s", "stats", "activeTotalLocked"], separator) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func keyStatsLocksCount () = makeString(["%s%s", "stats", "locksCount"], separator) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func keyStatsUsersCount () = makeString(["%s%s", "stats", "activeUsersCount"], separator) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func keyStatsDepositAmtByDay (timestamp) = makeString(["%s%s%d", "stats", "depositAmtByDay", toString(timestamp)], separator) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func keyStatsDepositAmtTotals () = makeString(["%s%s%d", "stats", "depositAmtTotals"], separator) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func keyNextPeriod () = "%s__nextPeriod" | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func keySupportedRewardAssets () = "supportedRewardAssets" | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func keyDepositNumLast () = makeString(["%s%s%s", "dep", "lastNum"], separator) | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func keyUserRewardFromDepositNum (userAddress) = makeString(["%s%s%s", "userRwdFromDepNum", userAddress], separator) | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func keyRewardPerNsbtSumAt (depositNum,tkn) = makeString(["%s%d", "rwdPerNsbtSumByDepNum", toString(depositNum), tkn], separator) | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func keyReward (userAddress,tkn) = makeString(["%s%s%s", "rwd", userAddress, tkn], separator) | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | func keyClaimed (userAddress,tkn) = makeString(["%s%s%s", "clm", userAddress, tkn], separator) | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func keyNotDistributedReward (tkn) = makeString(["%s%s", "notDistributed", tkn], separator) | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func toX18 (origVal,origMult) = fraction(toBigInt(origVal), MULTX18, origMult) | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func getIntOrZero (key) = valueOrElse(getInteger(this, key), 0) | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func getIntOrElse (key,defaultVal) = valueOrElse(getInteger(this, key), defaultVal) | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("Mandatory this." + key) + " is not defined")) | |
147 | 147 | ||
148 | 148 | ||
149 | 149 | func getStrOrElse (key,defaultVal) = valueOrElse(getString(this, key), defaultVal) | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | func toAddressOrFail (addressStr) = valueOrErrorMessage(addressFromString(addressStr), ("couldn't parse passed addressStr=" + addressStr)) | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | func toAssetVect (assetStr) = if ((assetStr == WAVESIDSTR)) | |
156 | 156 | then unit | |
157 | 157 | else fromBase58String(assetStr) | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func asInt (val) = match val { | |
161 | 161 | case valInt: Int => | |
162 | 162 | valInt | |
163 | 163 | case _ => | |
164 | 164 | throw("fail to cast into Int") | |
165 | 165 | } | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func formatHistoryRecord (oldAmount,oldStart,newAmount,newStart) = makeString(["%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(oldAmount), toString(oldStart), toString(newAmount), toString(newStart)], separator) | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func formatClaimHistoryRecord (user,claimedRewards) = makeString(["%s%d%d%s", user, toString(lastBlock.height), toString(lastBlock.timestamp), claimedRewards], separator) | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func HistoryRecordEntry (type,userAddress,txId,oldAmount,oldStart,newAmount,newStart) = StringEntry(keyHistoryRecord(type, userAddress, txId), formatHistoryRecord(oldAmount, oldStart, newAmount, newStart)) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func ClaimHistoryEntry (userAddress,txId,claimedRewards) = StringEntry(keyHistoryRecord("claim", userAddress, txId), formatClaimHistoryRecord(toString(userAddress), claimedRewards)) | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func StatsResult (totalLockedInc,lockCountInc,usersCountInc) = { | |
181 | 181 | let locksCount = getIntOrZero(keyStatsLocksCount()) | |
182 | 182 | let usersCount = getIntOrZero(keyStatsUsersCount()) | |
183 | 183 | let totalAmount = getIntOrZero(keyLockParamTotalAmount()) | |
184 | 184 | let totalAmountNew = (totalAmount + totalLockedInc) | |
185 | 185 | $Tuple3([IntegerEntry(keyStatsLocksCount(), (locksCount + lockCountInc)), IntegerEntry(keyStatsUsersCount(), (usersCount + usersCountInc)), IntegerEntry(keyLockParamTotalAmount(), totalAmountNew)], totalAmount, totalAmountNew) | |
186 | 186 | } | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func LockParamsEntry (userAddress,amount,start) = [IntegerEntry(keyLockParamUserAmount(userAddress), amount), IntegerEntry(keyLockParamStartBlock(userAddress), start)] | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | func getParamsOrFail () = $Tuple3(fromBase58String(getStringValue(neutrinoContract, keyBondAsset())), getIntOrFail(keyMinLockAmount()), getIntOrFail(keyHalfLife())) | |
193 | 193 | ||
194 | 194 | ||
195 | 195 | func isActiveUser (userAddress) = (getIntOrElse(keyLockParamUserAmount(userAddress), 0) > 0) | |
196 | 196 | ||
197 | 197 | ||
198 | 198 | func getUserParamsOrUnit (userAddress) = if (isActiveUser(userAddress)) | |
199 | 199 | then $Tuple3(false, getIntOrFail(keyLockParamUserAmount(userAddress)), getIntOrFail(keyLockParamStartBlock(userAddress))) | |
200 | 200 | else unit | |
201 | 201 | ||
202 | 202 | ||
203 | 203 | func getUserParamsOrFail (userAddress) = valueOrErrorMessage(getUserParamsOrUnit(userAddress), (("User " + toString(userAddress)) + " is not defined")) | |
204 | 204 | ||
205 | 205 | ||
206 | 206 | let supportedAssetsStr = getStrOrElse(keySupportedRewardAssets(), "") | |
207 | 207 | ||
208 | 208 | let supportedAssetsList = split(supportedAssetsStr, "_") | |
209 | 209 | ||
210 | 210 | func calcReward (userAddress,assetId,stakedAmountX,depositNumUser,depositNumLast) = { | |
211 | 211 | let rewardPerNsbtSumLastKEY = keyRewardPerNsbtSumAt(depositNumLast, assetId) | |
212 | 212 | let sumLastX18 = parseBigIntValue(getStrOrElse(keyRewardPerNsbtSumAt(depositNumLast, assetId), "0")) | |
213 | 213 | let sumUserX18 = parseBigIntValue(getStrOrElse(keyRewardPerNsbtSumAt(depositNumUser, assetId), "0")) | |
214 | 214 | let rewardDynamicPart = toInt(fraction((sumLastX18 - sumUserX18), stakedAmountX, MULTX18)) | |
215 | 215 | let rewardCachedPartKEY = keyReward(userAddress, assetId) | |
216 | 216 | let rewardCachedPart = getIntOrElse(rewardCachedPartKEY, 0) | |
217 | 217 | $Tuple4((rewardCachedPart + rewardDynamicPart), rewardCachedPart, rewardDynamicPart, rewardCachedPartKEY) | |
218 | 218 | } | |
219 | 219 | ||
220 | 220 | ||
221 | 221 | func toStartOfDay (timestamp) = ((timestamp / DAYMILLIS) * DAYMILLIS) | |
222 | 222 | ||
223 | 223 | ||
224 | 224 | func findElementPosition (src,element,sep) = { | |
225 | 225 | let elementStart = valueOrErrorMessage(indexOf(src, element), ((("there is no substring " + element) + " in ") + src)) | |
226 | 226 | if ((elementStart == 0)) | |
227 | 227 | then 0 | |
228 | 228 | else { | |
229 | 229 | let left = take(src, elementStart) | |
230 | 230 | (size(split(left, sep)) - 1) | |
231 | 231 | } | |
232 | 232 | } | |
233 | 233 | ||
234 | 234 | ||
235 | 235 | let DepositTotalsPREFIX = "%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d" | |
236 | 236 | ||
237 | 237 | let defaultTotalsDATA = (DepositTotalsPREFIX + "__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0") | |
238 | 238 | ||
239 | 239 | func RewardEntries (isNewUser,userAddress,stakedAmount) = { | |
240 | 240 | let stakedAmountX = toBigInt(stakedAmount) | |
241 | 241 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddress) | |
242 | 242 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
243 | 243 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
244 | 244 | func forEachAssetCacheUserReward (accum,asset) = { | |
245 | 245 | let $t095209655 = calcReward(userAddress, asset, stakedAmountX, depositNumUser, depositNumLast) | |
246 | 246 | let rewardTotal = $t095209655._1 | |
247 | 247 | let cached = $t095209655._2 | |
248 | 248 | let dynamic = $t095209655._3 | |
249 | 249 | let rewardCachedPartKEY = $t095209655._4 | |
250 | 250 | (accum :+ IntegerEntry(rewardCachedPartKEY, rewardTotal)) | |
251 | 251 | } | |
252 | 252 | ||
253 | 253 | if (if ((depositNumLast == -1)) | |
254 | 254 | then (depositNumUser == -1) | |
255 | 255 | else false) | |
256 | 256 | then nil | |
257 | 257 | else if (if ((depositNumLast == -1)) | |
258 | 258 | then (depositNumUser > -1) | |
259 | 259 | else false) | |
260 | 260 | then throw("invalid depositNumLast and depositNumUser state") | |
261 | 261 | else if (if ((depositNumLast > -1)) | |
262 | 262 | then (depositNumUser >= -1) | |
263 | 263 | else false) | |
264 | 264 | then if (isNewUser) | |
265 | 265 | then [IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)] | |
266 | 266 | else ({ | |
267 | 267 | let $l = supportedAssetsList | |
268 | 268 | let $s = size($l) | |
269 | 269 | let $acc0 = nil | |
270 | 270 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
271 | 271 | then $a | |
272 | 272 | else forEachAssetCacheUserReward($a, $l[$i]) | |
273 | 273 | ||
274 | 274 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
275 | 275 | then $a | |
276 | 276 | else throw("List size exceeds 9") | |
277 | 277 | ||
278 | 278 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
279 | 279 | } :+ IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)) | |
280 | 280 | else throw(((("uncovered condition: depositNumLast=" + toString(depositNumLast)) + " depositNumUser=") + toString(depositNumUser))) | |
281 | 281 | } | |
282 | 282 | ||
283 | 283 | ||
284 | 284 | func IncrementNotDistributedRewardEntry (tkn,amountInc) = { | |
285 | 285 | let notDistributedRewardKEY = keyNotDistributedReward(tkn) | |
286 | 286 | let notDistributedReward = getIntOrElse(notDistributedRewardKEY, 0) | |
287 | 287 | IntegerEntry(notDistributedRewardKEY, (notDistributedReward + amountInc)) | |
288 | 288 | } | |
289 | 289 | ||
290 | 290 | ||
291 | 291 | func commonClaim (userAddress,i) = { | |
292 | 292 | let userAddressStr = toString(userAddress) | |
293 | 293 | if ((size(i.payments) > 0)) | |
294 | 294 | then throw("payments are not accepted") | |
295 | 295 | else { | |
296 | 296 | let $t01259612701 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
297 | 297 | let isNewUser = $t01259612701._1 | |
298 | 298 | let stakedAmount = $t01259612701._2 | |
299 | 299 | let stakingStart = $t01259612701._3 | |
300 | 300 | let stakedAmountX = toBigInt(stakedAmount) | |
301 | 301 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
302 | 302 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
303 | 303 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
304 | 304 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
305 | 305 | let $t01307213210 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
306 | 306 | let rewardTotal = $t01307213210._1 | |
307 | 307 | let cached = $t01307213210._2 | |
308 | 308 | let dynamic = $t01307213210._3 | |
309 | 309 | let rewardCachedPartKEY = $t01307213210._4 | |
310 | 310 | let claimedKEY = keyClaimed(userAddressStr, asset) | |
311 | 311 | let $t01327013307 = accum | |
312 | 312 | let data = $t01327013307._1 | |
313 | 313 | let claimedAmtByAsset = $t01327013307._2 | |
314 | 314 | let newPart = makeString([asset, toString(rewardTotal)], ":") | |
315 | 315 | let claimedAmtByAssetNew = makeString([claimedAmtByAsset, newPart], "_") | |
316 | 316 | if ((0 >= rewardTotal)) | |
317 | 317 | then $Tuple2(data, claimedAmtByAssetNew) | |
318 | 318 | else $Tuple2((((data :+ ScriptTransfer(userAddress, rewardTotal, toAssetVect(asset))) :+ IntegerEntry(claimedKEY, (valueOrElse(getInteger(claimedKEY), 0) + rewardTotal))) :+ IntegerEntry(rewardCachedPartKEY, 0)), claimedAmtByAssetNew) | |
319 | 319 | } | |
320 | 320 | ||
321 | 321 | let $t01376713880 = { | |
322 | 322 | let $l = supportedAssetsList | |
323 | 323 | let $s = size($l) | |
324 | 324 | let $acc0 = $Tuple2(nil, "") | |
325 | 325 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
326 | 326 | then $a | |
327 | 327 | else forEachAssetCalcUnclaimedReward($a, $l[$i]) | |
328 | 328 | ||
329 | 329 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
330 | 330 | then $a | |
331 | 331 | else throw("List size exceeds 9") | |
332 | 332 | ||
333 | 333 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
334 | 334 | } | |
335 | 335 | let transfers = $t01376713880._1 | |
336 | 336 | let claimedAmtByAssetResult = $t01376713880._2 | |
337 | 337 | if ((0 >= size(transfers))) | |
338 | 338 | then $Tuple2(nil, 0) | |
339 | 339 | else $Tuple2(((transfers :+ IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)) :+ ClaimHistoryEntry(userAddress, i.transactionId, drop(claimedAmtByAssetResult, 1))), size(transfers)) | |
340 | 340 | } | |
341 | 341 | } | |
342 | 342 | ||
343 | 343 | ||
344 | 344 | @Callable(i) | |
345 | 345 | func constructorV1 (neutrinoContractAddress,mathContractAddress,minLockAmount,halfLife,supportedRewardAssets) = if ((i.caller != this)) | |
346 | 346 | then throw("Permission denied") | |
347 | 347 | else [StringEntry(keyNeutrinoContractAddress(), neutrinoContractAddress), StringEntry(keyMathContractAddress(), mathContractAddress), IntegerEntry(keyMinLockAmount(), minLockAmount), IntegerEntry(keyHalfLife(), halfLife), StringEntry(keySupportedRewardAssets(), supportedRewardAssets)] | |
348 | 348 | ||
349 | 349 | ||
350 | 350 | ||
351 | 351 | @Callable(i) | |
352 | 352 | func stake () = { | |
353 | 353 | let $t01473114793 = getParamsOrFail() | |
354 | 354 | let bondAssetId = $t01473114793._1 | |
355 | 355 | let minLockAmount = $t01473114793._2 | |
356 | 356 | let halfLife = $t01473114793._3 | |
357 | 357 | if ((size(i.payments) != 1)) | |
358 | 358 | then throw("Invalid payments size") | |
359 | 359 | else { | |
360 | 360 | let payment = i.payments[0] | |
361 | 361 | let amount = payment.amount | |
362 | 362 | let invalidAssetMessage = (("Invalid asset. " + toBase58String(bondAssetId)) + " is expected") | |
363 | 363 | let assetId = valueOrErrorMessage(payment.assetId, invalidAssetMessage) | |
364 | 364 | if ((assetId != bondAssetId)) | |
365 | 365 | then throw(invalidAssetMessage) | |
366 | 366 | else { | |
367 | 367 | let userAddress = i.caller | |
368 | 368 | let userAddressStr = toString(i.caller) | |
369 | 369 | let $t01533515442 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, -1)) | |
370 | 370 | let isNewUser = $t01533515442._1 | |
371 | 371 | let lockAmount = $t01533515442._2 | |
372 | 372 | let lockStartHeight = $t01533515442._3 | |
373 | 373 | let mergedAmount = if (isNewUser) | |
374 | 374 | then amount | |
375 | 375 | else (amount + lockAmount) | |
376 | 376 | let mergedStartHeight = if (isNewUser) | |
377 | 377 | then height | |
378 | 378 | else asInt(invoke(mathContract, "mergeStakesREADONLY", [amount, height, lockAmount, lockStartHeight, halfLife], nil)) | |
379 | 379 | if ((minLockAmount > mergedAmount)) | |
380 | 380 | then throw(("Min lock amount is " + toString(minLockAmount))) | |
381 | 381 | else { | |
382 | 382 | let $t01580315905 = StatsResult(amount, 1, if (isNewUser) | |
383 | 383 | then 1 | |
384 | 384 | else 0) | |
385 | 385 | let statsEntries = $t01580315905._1 | |
386 | 386 | let totalStaked = $t01580315905._2 | |
387 | 387 | let totalStakedNew = $t01580315905._3 | |
388 | 388 | ((([HistoryRecordEntry("stake", userAddress, i.transactionId, lockAmount, lockStartHeight, mergedAmount, mergedStartHeight)] ++ RewardEntries(isNewUser, userAddressStr, lockAmount)) ++ LockParamsEntry(userAddress, mergedAmount, mergedStartHeight)) ++ statsEntries) | |
389 | 389 | } | |
390 | 390 | } | |
391 | 391 | } | |
392 | 392 | } | |
393 | 393 | ||
394 | 394 | ||
395 | 395 | ||
396 | 396 | @Callable(i) | |
397 | 397 | func unstake (amount) = if ((size(i.payments) != 0)) | |
398 | 398 | then throw("unstake doesn't require any payment") | |
399 | 399 | else { | |
400 | 400 | let userAddress = i.caller | |
401 | 401 | let userAddressStr = toString(userAddress) | |
402 | 402 | let $t01639116453 = getParamsOrFail() | |
403 | 403 | let bondAssetId = $t01639116453._1 | |
404 | 404 | let minLockAmount = $t01639116453._2 | |
405 | 405 | let halfLife = $t01639116453._3 | |
406 | 406 | let $t01645616530 = getUserParamsOrFail(userAddress) | |
407 | 407 | let isNewUser = $t01645616530._1 | |
408 | 408 | let lockAmount = $t01645616530._2 | |
409 | 409 | let lockStart = $t01645616530._3 | |
410 | 410 | if ((0 >= lockAmount)) | |
411 | 411 | then throw("Nothing to unstake") | |
412 | 412 | else if ((amount > lockAmount)) | |
413 | 413 | then throw(((("Requested " + toString(amount)) + ", but staked only ") + toString(lockAmount))) | |
414 | 414 | else { | |
415 | 415 | let t = value(blockInfoByHeight(height)).timestamp | |
416 | 416 | let releaseTime = valueOrElse(getInteger(govContract, keyUserGnsbtReleaseTime(userAddressStr)), 0) | |
417 | 417 | if ((releaseTime >= t)) | |
418 | 418 | then throw(("Your gNsbt are taking part in voting, cannot unstake until " + toString(releaseTime))) | |
419 | 419 | else { | |
420 | 420 | let comissionAmount = asInt(invoke(mathContract, "getUnstakeComissionAmountREADONLY", [amount, lockStart, halfLife], nil)) | |
421 | 421 | let $t01717117325 = StatsResult(-(amount), if ((amount == lockAmount)) | |
422 | 422 | then -1 | |
423 | 423 | else 0, if ((amount == lockAmount)) | |
424 | 424 | then -1 | |
425 | 425 | else 0) | |
426 | 426 | let statsEntries = $t01717117325._1 | |
427 | 427 | let totalStaked = $t01717117325._2 | |
428 | 428 | let totalStakedNew = $t01717117325._3 | |
429 | 429 | ((([ScriptTransfer(userAddress, (amount - comissionAmount), bondAssetId), ScriptTransfer(auctionContract, comissionAmount, bondAssetId), HistoryRecordEntry("unstake", userAddress, i.transactionId, lockAmount, lockStart, (lockAmount - amount), lockStart)] ++ RewardEntries(false, userAddressStr, lockAmount)) ++ LockParamsEntry(userAddress, (lockAmount - amount), lockStart)) ++ statsEntries) | |
430 | 430 | } | |
431 | 431 | } | |
432 | 432 | } | |
433 | 433 | ||
434 | 434 | ||
435 | 435 | ||
436 | 436 | @Callable(i) | |
437 | 437 | func deposit () = { | |
438 | 438 | let totalStaked = getIntOrElse(keyLockParamTotalAmount(), 0) | |
439 | 439 | if ((0 > totalStaked)) | |
440 | 440 | then throw("TODO: case is not supported") | |
441 | 441 | else { | |
442 | 442 | let depositNumLastKEY = keyDepositNumLast() | |
443 | 443 | let depositNumLast = getIntOrElse(depositNumLastKEY, -1) | |
444 | 444 | let depositNumNew = (depositNumLast + 1) | |
445 | 445 | let totalsKEY = keyStatsDepositAmtTotals() | |
446 | 446 | let byDayKEY = keyStatsDepositAmtByDay(toStartOfDay(lastBlock.timestamp)) | |
447 | 447 | let currTotals = split(valueOrElse(getString(totalsKEY), defaultTotalsDATA), SEP) | |
448 | 448 | let currByDay = split(valueOrElse(getString(byDayKEY), defaultTotalsDATA), SEP) | |
449 | 449 | func dep (acc,pmt) = { | |
450 | 450 | let amount = pmt.amount | |
451 | 451 | let pmtAssetIdStr = toBase58String(valueOrElse(pmt.assetId, WAVESID)) | |
452 | 452 | if (!(contains(supportedAssetsStr, pmtAssetIdStr))) | |
453 | 453 | then throw(((supportedAssetsStr + " doesn't contain ") + pmtAssetIdStr)) | |
454 | 454 | else if ((totalStaked == 0)) | |
455 | 455 | then $Tuple4((acc._1 :+ IncrementNotDistributedRewardEntry(pmtAssetIdStr, amount)), (acc._2 :+ pmtAssetIdStr), (acc._3 :+ toBigInt(0)), (acc._4 :+ amount)) | |
456 | 456 | else { | |
457 | 457 | let rewardPerNsbtX18 = fraction(toBigInt(amount), MULTX18, toBigInt(totalStaked)) | |
458 | 458 | $Tuple4(acc._1, (acc._2 :+ pmtAssetIdStr), (acc._3 :+ rewardPerNsbtX18), (acc._4 :+ amount)) | |
459 | 459 | } | |
460 | 460 | } | |
461 | 461 | ||
462 | 462 | let pmtsResult = { | |
463 | 463 | let $l = i.payments | |
464 | 464 | let $s = size($l) | |
465 | 465 | let $acc0 = $Tuple4(nil, nil, nil, nil) | |
466 | 466 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
467 | 467 | then $a | |
468 | 468 | else dep($a, $l[$i]) | |
469 | 469 | ||
470 | 470 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
471 | 471 | then $a | |
472 | 472 | else throw("List size exceeds 10") | |
473 | 473 | ||
474 | 474 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
475 | 475 | } | |
476 | 476 | func refreshRewardUpdateTotals (accum,nextAsset) = { | |
477 | 477 | let k = accum._4 | |
478 | 478 | let sumLastStr = getStrOrElse(keyRewardPerNsbtSumAt(depositNumLast, nextAsset), "0") | |
479 | 479 | let idx = indexOf(pmtsResult._2, nextAsset) | |
480 | 480 | let sum = if (isDefined(idx)) | |
481 | 481 | then { | |
482 | 482 | let j = value(idx) | |
483 | 483 | let statsDelta = pmtsResult._4[j] | |
484 | 484 | $Tuple3(toString((parseBigIntValue(sumLastStr) + pmtsResult._3[j])), toString((parseIntValue(currTotals[(k + 1)]) + statsDelta)), toString((parseIntValue(currByDay[(k + 1)]) + statsDelta))) | |
485 | 485 | } | |
486 | 486 | else $Tuple3(sumLastStr, currTotals[(k + 1)], currByDay[(k + 1)]) | |
487 | 487 | $Tuple4((accum._1 :+ StringEntry(keyRewardPerNsbtSumAt(depositNumNew, nextAsset), sum._1)), ((accum._2 + SEP) + sum._2), ((accum._3 + SEP) + sum._3), (k + 1)) | |
488 | 488 | } | |
489 | 489 | ||
490 | 490 | let assetsResult = { | |
491 | 491 | let $l = supportedAssetsList | |
492 | 492 | let $s = size($l) | |
493 | 493 | let $acc0 = $Tuple4(nil, DepositTotalsPREFIX, DepositTotalsPREFIX, 0) | |
494 | 494 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
495 | 495 | then $a | |
496 | 496 | else refreshRewardUpdateTotals($a, $l[$i]) | |
497 | 497 | ||
498 | 498 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
499 | 499 | then $a | |
500 | 500 | else throw("List size exceeds 9") | |
501 | 501 | ||
502 | 502 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
503 | 503 | } | |
504 | 504 | $Tuple2(((((pmtsResult._1 ++ assetsResult._1) :+ IntegerEntry(depositNumLastKEY, depositNumNew)) :+ StringEntry(totalsKEY, assetsResult._2)) :+ StringEntry(byDayKEY, assetsResult._3)), depositNumNew) | |
505 | 505 | } | |
506 | 506 | } | |
507 | 507 | ||
508 | 508 | ||
509 | 509 | ||
510 | 510 | @Callable(i) | |
511 | 511 | func claimRewards () = commonClaim(i.caller, i) | |
512 | 512 | ||
513 | 513 | ||
514 | 514 | ||
515 | 515 | @Callable(i) | |
516 | 516 | func claimRewardsByOriginCaller () = commonClaim(i.originCaller, i) | |
517 | 517 | ||
518 | 518 | ||
519 | 519 | ||
520 | 520 | @Callable(i) | |
521 | 521 | func unclaimedRewardsREADONLY (userAddressStr) = { | |
522 | 522 | func forEachAssetZeroReward (accum,asset) = ((accum + makeString([asset, "0", "0"], ":")) + "_") | |
523 | 523 | ||
524 | 524 | let unclaimedRewardStr = if ((userAddressStr == "")) | |
525 | 525 | then { | |
526 | 526 | let $l = supportedAssetsList | |
527 | 527 | let $s = size($l) | |
528 | 528 | let $acc0 = "" | |
529 | 529 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
530 | 530 | then $a | |
531 | 531 | else forEachAssetZeroReward($a, $l[$i]) | |
532 | 532 | ||
533 | 533 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
534 | 534 | then $a | |
535 | 535 | else throw("List size exceeds 9") | |
536 | 536 | ||
537 | 537 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
538 | 538 | } | |
539 | 539 | else { | |
540 | 540 | let userAddress = addressFromStringValue(userAddressStr) | |
541 | 541 | let $t02125621361 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
542 | 542 | let isNewUser = $t02125621361._1 | |
543 | 543 | let stakedAmount = $t02125621361._2 | |
544 | 544 | let stakingStart = $t02125621361._3 | |
545 | 545 | let stakedAmountX = toBigInt(stakedAmount) | |
546 | 546 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
547 | 547 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
548 | 548 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
549 | 549 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
550 | 550 | let $t02170721845 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
551 | 551 | let rewardTotal = $t02170721845._1 | |
552 | 552 | let cached = $t02170721845._2 | |
553 | 553 | let dynamic = $t02170721845._3 | |
554 | 554 | let rewardCachedPartKEY = $t02170721845._4 | |
555 | 555 | let claimed = valueOrElse(getInteger(keyClaimed(userAddressStr, asset)), 0) | |
556 | 556 | ((accum + makeString([asset, toString(rewardTotal), toString(claimed)], ":")) + "_") | |
557 | 557 | } | |
558 | 558 | ||
559 | 559 | let $l = supportedAssetsList | |
560 | 560 | let $s = size($l) | |
561 | 561 | let $acc0 = "" | |
562 | 562 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
563 | 563 | then $a | |
564 | 564 | else forEachAssetCalcUnclaimedReward($a, $l[$i]) | |
565 | 565 | ||
566 | 566 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
567 | 567 | then $a | |
568 | 568 | else throw("List size exceeds 9") | |
569 | 569 | ||
570 | 570 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
571 | 571 | } | |
572 | 572 | $Tuple2(nil, dropRight(unclaimedRewardStr, 1)) | |
573 | 573 | } | |
574 | 574 | ||
575 | 575 | ||
576 | 576 | ||
577 | 577 | @Callable(i) | |
578 | 578 | func nsbtUnstakingSYSREADONLY (userAddressStrOrEmpty,unstakeAmtP) = { | |
579 | 579 | let resultArray = if ((userAddressStrOrEmpty == "")) | |
580 | 580 | then [0, 0, 0, 0] | |
581 | 581 | else { | |
582 | 582 | let userAddress = addressFromStringValue(userAddressStrOrEmpty) | |
583 | 583 | let cfgDATA = getParamsOrFail() | |
584 | 584 | let nsbtAssetId = cfgDATA._1 | |
585 | 585 | let minLockAmount = cfgDATA._2 | |
586 | 586 | let halfLife = cfgDATA._3 | |
587 | 587 | let userDATA = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
588 | 588 | let isNewUser = userDATA._1 | |
589 | 589 | let stakedAmount = userDATA._2 | |
590 | 590 | let lockStart = userDATA._3 | |
591 | 591 | let unstakeAmt = if ((unstakeAmtP > stakedAmount)) | |
592 | 592 | then stakedAmount | |
593 | 593 | else unstakeAmtP | |
594 | 594 | let stakedAmountNEW = (stakedAmount - unstakeAmt) | |
595 | 595 | let comissionAmount = if ((unstakeAmt == 0)) | |
596 | 596 | then 0 | |
597 | 597 | else asInt(invoke(mathContract, "getUnstakeComissionAmountREADONLY", [unstakeAmt, lockStart, halfLife], nil)) | |
598 | 598 | let receiveAmount = (unstakeAmt - comissionAmount) | |
599 | 599 | [stakedAmount, stakedAmountNEW, receiveAmount, comissionAmount] | |
600 | 600 | } | |
601 | 601 | $Tuple2(nil, resultArray) | |
602 | 602 | } | |
603 | 603 | ||
604 | 604 | ||
605 | 605 | ||
606 | 606 | @Callable(i) | |
607 | 607 | func nsbtStakingSYSREADONLY (userAddressStr,nsbtDiff) = { | |
608 | 608 | let totalNsbtAmt = getIntOrElse(keyLockParamTotalAmount(), 0) | |
609 | 609 | if ((userAddressStr == "")) | |
610 | 610 | then $Tuple2(nil, [0, totalNsbtAmt, 0]) | |
611 | 611 | else { | |
612 | 612 | let userAddress = toAddressOrFail(userAddressStr) | |
613 | 613 | let $t02352323627 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
614 | 614 | let isNewUser = $t02352323627._1 | |
615 | 615 | let userNsbtAmt = $t02352323627._2 | |
616 | 616 | let stakingStart = $t02352323627._3 | |
617 | 617 | $Tuple2(nil, [userNsbtAmt, totalNsbtAmt, stakingStart]) | |
618 | 618 | } | |
619 | 619 | } | |
620 | 620 | ||
621 | 621 | ||
622 | 622 | @Verifier(tx) | |
623 | 623 | func verify () = { | |
624 | 624 | let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR"], SEP) | |
625 | 625 | let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP) | |
626 | 626 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
627 | 627 | then 1 | |
628 | 628 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
629 | 629 | then 1 | |
630 | 630 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
631 | 631 | then 1 | |
632 | 632 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
633 | 633 | then 2 | |
634 | 634 | else 0)) | |
635 | 635 | (count >= 3) | |
636 | 636 | } | |
637 | 637 |
github/deemru/w8io/169f3d6 96.61 ms ◑