tx · C521uRBftbsQRkBN5ZCnTRLRCaJZKdSJkJzKERKGVJ2T 3MqjiXZpkpN31j7XFmLueeZuFpfZ7fDwe9S: -0.01000000 Waves 2022.06.02 11:48 [2078502] smart account 3MqjiXZpkpN31j7XFmLueeZuFpfZ7fDwe9S > SELF 0.00000000 Waves
{ "type": 13, "id": "C521uRBftbsQRkBN5ZCnTRLRCaJZKdSJkJzKERKGVJ2T", "fee": 1000000, "feeAssetId": null, "timestamp": 1654159809523, "version": 2, "chainId": 84, "sender": "3MqjiXZpkpN31j7XFmLueeZuFpfZ7fDwe9S", "senderPublicKey": "7YknsAXP81Vy1sJAhHtumQ4SqcsQHPEmiqnXeY58Bw3y", "proofs": [ "4ZbLFCRBwhTkTN2hzfHxpcwqHhDsVSYcjHKCWaLDy8tSVDoTsBHFNzUpqgYisnEk5niHqZeqMYt7u2UsaH3zHiuq" ], "script": "base64:AAIFAAAAAAAAADsIAhIHCgUICAgBARIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIECgIICRIFCgMBCAESAwoBCAAAACEAAAAADGxvY2tpbmdTdG9yZQUAAAAEdGhpcwAAAAAMc3Rha2luZ1N0b3JlAgAAAA1fU3Rha2luZ1N0b3JlAAAAABFtaW5pbXVtTG9ja0Ftb3VudAIAAAAOX01pbkxvY2tBbW91bnQAAAAAEW1heGltdW1Mb2NrQW1vdW50AgAAAA5fTWF4TG9ja0Ftb3VudAAAAAAJYXNzZXRMaXN0BQAAAANuaWwAAAAAEXVubG9ja0VsaWdpYmlsaXR5AgAAABxfRWxpZ2libGVfdG9fdW5sb2NrX2F0X2Jsb2NrAAAAAAxsb2NrZWRBbW91bnQCAAAADl9BbW91bnRfbG9ja2VkAAAAAAtsb2NrZWRBc3NldAIAAAANX0Fzc2V0X2xvY2tlZAAAAAAEdXNlcgIAAAAFX1VzZXIAAAAACkFQWV9BbW91bnQCAAAAC19BUFlfYW1vdW50AAAAAA1sb2NraW5nUGVyaW9kAgAAAAxfRGF5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AAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGdXNlcklkBQAAAA11TG9ja2VkQW1vdW50CQABmwAAAAEFAAAABnVBc3NldAUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAAAtJA5nQ==", "height": 2078502, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 1qsMoFi9qjvNR3FHgZtDxtAoGsxCTtThbDmgHd2ff1Z Next: 2AU4Rwgs4sej2TLbX8aZm1BxKEYCH1UYZYbqYj8qY834 Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let lockingStore = this | |
5 | 5 | ||
6 | 6 | let stakingStore = "_StakingStore" | |
7 | 7 | ||
8 | 8 | let minimumLockAmount = "_MinLockAmount" | |
9 | 9 | ||
10 | 10 | let maximumLockAmount = "_MaxLockAmount" | |
11 | 11 | ||
12 | 12 | let assetList = nil | |
13 | 13 | ||
14 | 14 | let unlockEligibility = "_Eligible_to_unlock_at_block" | |
15 | 15 | ||
16 | 16 | let lockedAmount = "_Amount_locked" | |
17 | 17 | ||
18 | 18 | let lockedAsset = "_Asset_locked" | |
19 | 19 | ||
20 | 20 | let user = "_User" | |
21 | 21 | ||
22 | 22 | let APY_Amount = "_APY_amount" | |
23 | 23 | ||
24 | 24 | let lockingPeriod = "_Days_locked" | |
25 | 25 | ||
26 | 26 | let admin = "admin_" | |
27 | 27 | ||
28 | 28 | let BlockPerDay = 1440 | |
29 | 29 | ||
30 | 30 | let RBase = 10000000000000000 | |
31 | 31 | ||
32 | 32 | let factorsBase = 1000 | |
33 | 33 | ||
34 | 34 | let thirtyDaysLockPeriod = 30 | |
35 | 35 | ||
36 | 36 | let sixtyDaysLockPeriod = 60 | |
37 | 37 | ||
38 | 38 | let ninetyDaysLockPeriod = 90 | |
39 | 39 | ||
40 | 40 | func getI (key) = getInteger(this, key) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func getS (key) = getString(this, key) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func getIV (key) = value(getInteger(this, key)) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func getSV (key) = value(getString(this, key)) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func throwIf (condition,error) = if (condition) | |
53 | 53 | then throw(error) | |
54 | 54 | else true | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func throwOrReturnI (val,error) = match val { | |
58 | 58 | case val: Int => | |
59 | 59 | val | |
60 | 60 | case _ => | |
61 | 61 | throw(error) | |
62 | 62 | } | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func throwOrReturnS (val,error) = match val { | |
66 | 66 | case val: String => | |
67 | 67 | val | |
68 | 68 | case _ => | |
69 | 69 | throw(error) | |
70 | 70 | } | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func writeInt (key,value) = if ((0 > value)) | |
74 | 74 | then throw(((("writing negative value " + toString(value)) + " for key ") + key)) | |
75 | 75 | else IntegerEntry(key, value) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func writeStr (key,value) = if ((" " == value)) | |
79 | 79 | then throw(("writing an empty string " + value)) | |
80 | 80 | else StringEntry(key, value) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func daysToBlocks (days) = if (if (if ((days != thirtyDaysLockPeriod)) | |
84 | 84 | then true | |
85 | 85 | else (days != sixtyDaysLockPeriod)) | |
86 | 86 | then true | |
87 | 87 | else (days != ninetyDaysLockPeriod)) | |
88 | 88 | then throw("invalid Lock Period") | |
89 | 89 | else (((days + 1) * BlockPerDay) + height) | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func blocksToDays (blocksLeft) = if ((0 >= blocksLeft)) | |
93 | 93 | then 0 | |
94 | 94 | else { | |
95 | 95 | let multiplier = pow(10, 0, 3, 0, 0, CEILING) | |
96 | 96 | let daysleft = fraction(blocksLeft, multiplier, BlockPerDay) | |
97 | 97 | daysleft | |
98 | 98 | } | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func writeConstString (key,value) = if (!(isDefined(getS(key)))) | |
102 | 102 | then writeStr(key, value) | |
103 | 103 | else throw(("already initialized: " + key)) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func writeConstInteger (key,value) = if (!(isDefined(getS(key)))) | |
107 | 107 | then writeInt(key, value) | |
108 | 108 | else throw(("already initialized: " + key)) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func adminOnly (i) = { | |
112 | 112 | let AdminAddress = toString(i.caller) | |
113 | 113 | let otherAdminAddress = (admin + toString(i.caller)) | |
114 | 114 | if (if ((AdminAddress != valueOrElse(getS(admin), "not an admin"))) | |
115 | 115 | then true | |
116 | 116 | else (AdminAddress != valueOrElse(getS(otherAdminAddress), "not an admin"))) | |
117 | 117 | then throw("unauthorized") | |
118 | 118 | else true | |
119 | 119 | } | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func writeConfigValue (key,data) = match data { | |
123 | 123 | case data: String => | |
124 | 124 | writeConstString(key, data) | |
125 | 125 | case data: Int => | |
126 | 126 | writeConstInteger(key, data) | |
127 | 127 | case _ => | |
128 | 128 | throw("unsupported config type") | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | @Callable(i) | |
133 | 133 | func addAsset (AssetTicker,AssetID,AssetStakingStore,AssetMinimumLockAmount,AssetMaximumLockAmount) = { | |
134 | 134 | let check = adminOnly(i) | |
135 | 135 | if ((check == check)) | |
136 | 136 | then { | |
137 | 137 | let aStakingStore = (AssetTicker + stakingStore) | |
138 | 138 | let aMinimumLockAmount = (AssetTicker + minimumLockAmount) | |
139 | 139 | let aMaximumLockAmount = (AssetTicker + maximumLockAmount) | |
140 | 140 | [writeConstString(AssetTicker, AssetID), writeConstString(aStakingStore, AssetStakingStore), writeConstInteger(aMinimumLockAmount, AssetMinimumLockAmount), writeConstInteger(aMaximumLockAmount, AssetMaximumLockAmount)] | |
141 | 141 | } | |
142 | 142 | else throw("Strict value is not equal to itself.") | |
143 | 143 | } | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | ||
147 | 147 | @Callable(i) | |
148 | 148 | func getAssetIdByTicker (AssetTicker) = { | |
149 | 149 | let check = adminOnly(i) | |
150 | 150 | if ((check == check)) | |
151 | 151 | then { | |
152 | 152 | let a = throwOrReturnS(getS(AssetTicker), "asset not found") | |
153 | 153 | $Tuple2(nil, a) | |
154 | 154 | } | |
155 | 155 | else throw("Strict value is not equal to itself.") | |
156 | 156 | } | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | ||
160 | 160 | @Callable(i) | |
161 | 161 | func init (AdminAddress) = [writeConstString(admin, toString(addressFromStringValue(AdminAddress)))] | |
162 | 162 | ||
163 | 163 | ||
164 | 164 | ||
165 | 165 | @Callable(i) | |
166 | 166 | func addAdmin (AdminAddress) = { | |
167 | 167 | let check = adminOnly(i) | |
168 | 168 | if ((check == check)) | |
169 | 169 | then { | |
170 | 170 | let newAdmin = (admin + AdminAddress) | |
171 | 171 | [writeConstString(newAdmin, AdminAddress)] | |
172 | 172 | } | |
173 | 173 | else throw("Strict value is not equal to itself.") | |
174 | 174 | } | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | ||
178 | 178 | @Callable(i) | |
179 | 179 | func changeMainAdmin (address) = { | |
180 | 180 | let checks = adminOnly(i) | |
181 | 181 | if ((checks == checks)) | |
182 | 182 | then { | |
183 | 183 | let del = DeleteEntry(admin) | |
184 | 184 | if ((del == del)) | |
185 | 185 | then [writeConstString(admin, address)] | |
186 | 186 | else throw("Strict value is not equal to itself.") | |
187 | 187 | } | |
188 | 188 | else throw("Strict value is not equal to itself.") | |
189 | 189 | } | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | ||
193 | 193 | @Callable(i) | |
194 | 194 | func updateOtherAdminAddress (address) = { | |
195 | 195 | let checks = adminOnly(i) | |
196 | 196 | if ((checks == checks)) | |
197 | 197 | then { | |
198 | 198 | let caller = toString(i.caller) | |
199 | 199 | let otherAdmin = (admin + caller) | |
200 | 200 | let checkOldAddress = throwOrReturnS(getS(otherAdmin), "no previous address found") | |
201 | 201 | if ((checkOldAddress == checkOldAddress)) | |
202 | 202 | then { | |
203 | 203 | let delAddress = DeleteEntry(otherAdmin) | |
204 | 204 | if ((delAddress == delAddress)) | |
205 | 205 | then [writeConstString(otherAdmin, address)] | |
206 | 206 | else throw("Strict value is not equal to itself.") | |
207 | 207 | } | |
208 | 208 | else throw("Strict value is not equal to itself.") | |
209 | 209 | } | |
210 | 210 | else throw("Strict value is not equal to itself.") | |
211 | 211 | } | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | ||
215 | 215 | @Callable(i) | |
216 | 216 | func removeOtherAdmin (address) = { | |
217 | 217 | let checks = adminOnly(i) | |
218 | 218 | if ((checks == checks)) | |
219 | 219 | then { | |
220 | 220 | let otherAddress = (admin + address) | |
221 | 221 | let delAdmin = DeleteEntry(otherAddress) | |
222 | 222 | if ((delAdmin == delAdmin)) | |
223 | 223 | then nil | |
224 | 224 | else throw("Strict value is not equal to itself.") | |
225 | 225 | } | |
226 | 226 | else throw("Strict value is not equal to itself.") | |
227 | 227 | } | |
228 | 228 | ||
229 | 229 | ||
230 | 230 | ||
231 | 231 | @Callable(i) | |
232 | 232 | func updateConfigValue (key,data) = { | |
233 | 233 | let checks = adminOnly(i) | |
234 | 234 | if ((checks == checks)) | |
235 | 235 | then { | |
236 | 236 | let del = DeleteEntry(key) | |
237 | 237 | if ((del == del)) | |
238 | 238 | then [writeConfigValue(key, data)] | |
239 | 239 | else throw("Strict value is not equal to itself.") | |
240 | 240 | } | |
241 | 241 | else throw("Strict value is not equal to itself.") | |
242 | 242 | } | |
243 | 243 | ||
244 | 244 | ||
245 | 245 | ||
246 | 246 | @Callable(i) | |
247 | 247 | func Lock (LockPeriod,AssetTicker,APY) = { | |
248 | 248 | let check1 = throwIf((1 != size(i.payments)), "Attach amount you want to lock") | |
249 | 249 | if ((check1 == check1)) | |
250 | 250 | then { | |
251 | 251 | let asset = toBase58String(value(i.payments[0].assetId)) | |
252 | 252 | let check2 = throwIf((getS(AssetTicker) != asset), "Asset not supported") | |
253 | 253 | if ((check2 == check2)) | |
254 | 254 | then { | |
255 | 255 | let lockPeriod = LockPeriod | |
256 | 256 | let userId = toString(i.caller) | |
257 | 257 | let amountToStake = i.payments[0].amount | |
258 | 258 | let minToStake = throwOrReturnI(getI((AssetTicker + minimumLockAmount)), "internal error: minimum stacking amount not specified") | |
259 | 259 | let maxToStake = throwOrReturnI(getI((AssetTicker + maximumLockAmount)), "internal error: maximum staking amount not specified") | |
260 | 260 | let check3 = throwIf(if ((minToStake > amountToStake)) | |
261 | 261 | then true | |
262 | 262 | else (amountToStake > maxToStake), "staking amount is out of range") | |
263 | 263 | if ((check3 == check3)) | |
264 | 264 | then { | |
265 | 265 | let uUserId = (userId + user) | |
266 | 266 | let uAsset = (userId + lockedAsset) | |
267 | 267 | let uLockingPeriod = (userId + lockingPeriod) | |
268 | 268 | let uLockedAmount = (userId + lockedAmount) | |
269 | 269 | let uAPY = (userId + APY_Amount) | |
270 | 270 | let uUnlockEligibility = (userId + unlockEligibility) | |
271 | 271 | [writeStr(uUserId, userId), writeStr(uAsset, asset), writeInt(uLockingPeriod, lockPeriod), writeInt(uLockedAmount, i.payments[0].amount), writeInt(uUnlockEligibility, daysToBlocks(LockPeriod)), writeInt(uAPY, APY)] | |
272 | 272 | } | |
273 | 273 | else throw("Strict value is not equal to itself.") | |
274 | 274 | } | |
275 | 275 | else throw("Strict value is not equal to itself.") | |
276 | 276 | } | |
277 | 277 | else throw("Strict value is not equal to itself.") | |
278 | 278 | } | |
279 | 279 | ||
280 | 280 | ||
281 | 281 | ||
282 | 282 | @Callable(i) | |
283 | 283 | func Claim (AssetTicker) = { | |
284 | 284 | let userId = toString(i.caller) | |
285 | 285 | let uAsset = throwOrReturnS(getS((userId + lockedAsset)), ("there are no locked tokens for " + userId)) | |
286 | 286 | let uLockedAmount = throwOrReturnI(getI((userId + lockedAmount)), "internal error: could not retrieve locked amount") | |
287 | 287 | let stakingReserve = addressFromStringValue(throwOrReturnS(getS((AssetTicker + stakingStore)), "internal error: staking store not found for asset")) | |
288 | 288 | let APYAMount = throwOrReturnI(getI((userId + APY_Amount)), "internal error: failed to get APY") | |
289 | 289 | let period = throwOrReturnI(getI((userId + unlockEligibility)), "internal error: could not determine claim eligibility") | |
290 | 290 | let blocksLeft = if ((0 >= (period - height))) | |
291 | 291 | then 0 | |
292 | 292 | else (period - height) | |
293 | 293 | let daysLeft = blocksToDays(blocksLeft) | |
294 | 294 | let check1 = throwIf((period > height), (toString(daysLeft) + " days left to claim")) | |
295 | 295 | if ((check1 == check1)) | |
296 | 296 | then { | |
297 | 297 | let transferAPYAmount = invoke(stakingReserve, "transferInterest", [userId, APYAMount, toBytes(uAsset)], nil) | |
298 | 298 | if ((transferAPYAmount == transferAPYAmount)) | |
299 | 299 | then [ScriptTransfer(addressFromStringValue(userId), uLockedAmount, toBytes(uAsset))] | |
300 | 300 | else throw("Strict value is not equal to itself.") | |
301 | 301 | } | |
302 | 302 | else throw("Strict value is not equal to itself.") | |
303 | 303 | } | |
304 | 304 | ||
305 | 305 |
github/deemru/w8io/026f985 50.96 ms ◑