tx · 3RGwQj4cUoEMVvJbuDmiiqREfYbdCAdSFUape7GHDtVY 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy: -0.01100000 Waves 2023.06.29 21:00 [2644269] smart account 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy > SELF 0.00000000 Waves
{ "type": 13, "id": "3RGwQj4cUoEMVvJbuDmiiqREfYbdCAdSFUape7GHDtVY", "fee": 1100000, "feeAssetId": null, "timestamp": 1688061725964, "version": 2, "chainId": 84, "sender": "3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy", "senderPublicKey": "FsR18761ZAsUqsTd7TK3XmR6bhihs1UXVmpHYxz5JzQ1", "proofs": [ "59PDC2Xy2rmR1cSCJH9FgbgmkK6cUVA7W4Q5eKrrzA7irsKEZtTz8NvjaRYsAAyktBCPSNRyNwF6FppSuppz6nUY" ], "script": "base64:BgIZCAISBQoDCAgIEgASABIAEgMKAQgSAwoBCEIBCmtleUJsb2NrZWQAAhBjb250cmFjdHNCbG9ja2VkAAtJZHhFZmZUb3RhbAAAAApJZHhFZmZVc2VyAAEABWNoYWluCQDJAQIJAMoBAggFBHRoaXMFYnl0ZXMAAQABAAt1c2R0QXNzZXRJZAQHJG1hdGNoMAUFY2hhaW4DCQAAAgEBVwUHJG1hdGNoMAEghNp6sggDP07Ru8qO7ouTvMmC3Qtd+geWqNQj+agP/7kDCQAAAgEBVAUHJG1hdGNoMAEgVbHYn3KHgu/l41uNrAWrZd6aQ6EvFrsF8xq3h6XxxRgJAAIBAg1Vbmtub3duIGNoYWluABVkZWZhdWx0UmVzdEFkZHJlc3NTdHIEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDACIzNQUUN1dkZidmg0TGtQVW5yblUxejNqbmJBMXA5bTNXTmh2AwkAAAIBAVQFByRtYXRjaDACIzNNdW1rR0d6dENLQVhwV0RxeGtkZG9mcVhTVWJxUWt2U0p5CQACAQINVW5rbm93biBjaGFpbgAOYXJ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0aW1lc3RhbXAFA25pbAgFCWxhc3RCbG9jawl0aW1lc3RhbXABaQENb25VbnN0YWtlTGFuZAEEYWRkcgMJAQIhPQIIBQFpBmNhbGxlcgUPc3Rha2luZ0NvbnRyYWN0CQACAQIRUGVybWlzc2lvbiBkZW5pZWQJAJQKAgkAzAgCCQELRGVsZXRlRW50cnkBCQEYa2V5TGFzdENsYWltZWRUaW1lQnlVc2VyAQUEYWRkcgUDbmlsAAAAoN5bTg==", "height": 2644269, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Cyb8hCxo8i4m7RVwPD9uzviw4WkWkshEPUimvLtD2Fmv Next: 8BxwmeViHPzVizosVW5M3V4xLwkVece7uM5UAkcPQT7T Diff:
Old | New | Differences | |
---|---|---|---|
25 | 25 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
26 | 26 | else if ((base58'2T' == $match0)) | |
27 | 27 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
28 | + | else throw("Unknown chain") | |
29 | + | } | |
30 | + | ||
31 | + | let arbitrageDelay = match chain { | |
32 | + | case _ => | |
33 | + | if ((base58'2W' == $match0)) | |
34 | + | then 600000 | |
35 | + | else if ((base58'2T' == $match0)) | |
36 | + | then 60000 | |
28 | 37 | else throw("Unknown chain") | |
29 | 38 | } | |
30 | 39 | ||
194 | 203 | ||
195 | 204 | let MAXPERIOD = 156 | |
196 | 205 | ||
197 | - | let TENMINUTESMILLIS = 600000 | |
198 | - | ||
199 | 206 | let A6 = 100000000 | |
200 | 207 | ||
201 | 208 | let B8 = 50000000 | |
237 | 244 | func getSwapLimit (addr) = { | |
238 | 245 | let lastTime = valueOrElse(getInteger(keyLastArbTimeByUser(addr)), 0) | |
239 | 246 | let now = lastBlock.timestamp | |
240 | - | if (( | |
247 | + | if ((arbitrageDelay > (now - lastTime))) | |
241 | 248 | then throw("Arbitrages are possible once a 10 minutes") | |
242 | 249 | else { | |
243 | 250 | let pieces = getVotingPower(addr)[IdxEffUser] |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func keyBlocked () = "contractsBlocked" | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | let IdxEffTotal = 0 | |
8 | 8 | ||
9 | 9 | let IdxEffUser = 1 | |
10 | 10 | ||
11 | 11 | let chain = take(drop(this.bytes, 1), 1) | |
12 | 12 | ||
13 | 13 | let usdtAssetId = match chain { | |
14 | 14 | case _ => | |
15 | 15 | if ((base58'2W' == $match0)) | |
16 | 16 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
17 | 17 | else if ((base58'2T' == $match0)) | |
18 | 18 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
19 | 19 | else throw("Unknown chain") | |
20 | 20 | } | |
21 | 21 | ||
22 | 22 | let defaultRestAddressStr = match chain { | |
23 | 23 | case _ => | |
24 | 24 | if ((base58'2W' == $match0)) | |
25 | 25 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
26 | 26 | else if ((base58'2T' == $match0)) | |
27 | 27 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
28 | + | else throw("Unknown chain") | |
29 | + | } | |
30 | + | ||
31 | + | let arbitrageDelay = match chain { | |
32 | + | case _ => | |
33 | + | if ((base58'2W' == $match0)) | |
34 | + | then 600000 | |
35 | + | else if ((base58'2T' == $match0)) | |
36 | + | then 60000 | |
28 | 37 | else throw("Unknown chain") | |
29 | 38 | } | |
30 | 39 | ||
31 | 40 | let SEP = "__" | |
32 | 41 | ||
33 | 42 | let MULT6 = 1000000 | |
34 | 43 | ||
35 | 44 | let MULT8 = 100000000 | |
36 | 45 | ||
37 | 46 | let SSIZE = 25 | |
38 | 47 | ||
39 | 48 | let MSIZE = 100 | |
40 | 49 | ||
41 | 50 | let LSIZE = 225 | |
42 | 51 | ||
43 | 52 | let XLSIZE = 400 | |
44 | 53 | ||
45 | 54 | let XXLSIZE = 625 | |
46 | 55 | ||
47 | 56 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
48 | 57 | ||
49 | 58 | ||
50 | 59 | let IdxCfgStakingDapp = 1 | |
51 | 60 | ||
52 | 61 | let IdxCfgEconomyDapp = 2 | |
53 | 62 | ||
54 | 63 | let IdxCfgWlgDapp = 4 | |
55 | 64 | ||
56 | 65 | let IdxCfgPuzzlePoolDapp = 5 | |
57 | 66 | ||
58 | 67 | func keyRestCfg () = "%s__restConfig" | |
59 | 68 | ||
60 | 69 | ||
61 | 70 | func keyRestAddress () = "%s__restAddr" | |
62 | 71 | ||
63 | 72 | ||
64 | 73 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
65 | 74 | ||
66 | 75 | ||
67 | 76 | func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
68 | 77 | ||
69 | 78 | ||
70 | 79 | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
71 | 80 | ||
72 | 81 | let restCfg = readRestCfgOrFail(restContract) | |
73 | 82 | ||
74 | 83 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
75 | 84 | ||
76 | 85 | let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp) | |
77 | 86 | ||
78 | 87 | let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp) | |
79 | 88 | ||
80 | 89 | let puzzlePoolContract = getContractAddressOrFail(restCfg, IdxCfgPuzzlePoolDapp) | |
81 | 90 | ||
82 | 91 | let recLandSize = 1 | |
83 | 92 | ||
84 | 93 | func keyResProportions () = "resTypesProportions" | |
85 | 94 | ||
86 | 95 | ||
87 | 96 | func keyStakedLandsByOwner (ownerAddr) = ("stakedLandsByOwner_" + ownerAddr) | |
88 | 97 | ||
89 | 98 | ||
90 | 99 | let wlgIssuedAmountKey = "wlg_issuedAmount" | |
91 | 100 | ||
92 | 101 | let idxWlgAmount = 0 | |
93 | 102 | ||
94 | 103 | let idxWlgPrice = 1 | |
95 | 104 | ||
96 | 105 | let idxWlgFunds = 2 | |
97 | 106 | ||
98 | 107 | func asInt (v) = match v { | |
99 | 108 | case n: Int => | |
100 | 109 | n | |
101 | 110 | case _ => | |
102 | 111 | throw("fail to cast into Int") | |
103 | 112 | } | |
104 | 113 | ||
105 | 114 | ||
106 | 115 | func numPiecesBySize (landSize) = match landSize { | |
107 | 116 | case _ => | |
108 | 117 | if (("S" == $match0)) | |
109 | 118 | then SSIZE | |
110 | 119 | else if (("M" == $match0)) | |
111 | 120 | then MSIZE | |
112 | 121 | else if (("L" == $match0)) | |
113 | 122 | then LSIZE | |
114 | 123 | else if (("XL" == $match0)) | |
115 | 124 | then XLSIZE | |
116 | 125 | else if (("XXL" == $match0)) | |
117 | 126 | then XXLSIZE | |
118 | 127 | else throw("Unknown land size") | |
119 | 128 | } | |
120 | 129 | ||
121 | 130 | ||
122 | 131 | func getVotingPower (userAddrStrOrEmpty) = { | |
123 | 132 | let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_") | |
124 | 133 | func adder (acc,item) = (acc + parseIntValue(item)) | |
125 | 134 | ||
126 | 135 | let totalPower = { | |
127 | 136 | let $l = props | |
128 | 137 | let $s = size($l) | |
129 | 138 | let $acc0 = 0 | |
130 | 139 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
131 | 140 | then $a | |
132 | 141 | else adder($a, $l[$i]) | |
133 | 142 | ||
134 | 143 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
135 | 144 | then $a | |
136 | 145 | else throw("List size exceeds 6") | |
137 | 146 | ||
138 | 147 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
139 | 148 | } | |
140 | 149 | let usersPower = if ((userAddrStrOrEmpty == "")) | |
141 | 150 | then 0 | |
142 | 151 | else { | |
143 | 152 | let landsStr = getString(stakingContract, keyStakedLandsByOwner(userAddrStrOrEmpty)) | |
144 | 153 | let lands = if (isDefined(landsStr)) | |
145 | 154 | then split_51C(value(landsStr), "_") | |
146 | 155 | else nil | |
147 | 156 | func oneLand (acc,landAssetId) = { | |
148 | 157 | let asset = value(assetInfo(fromBase58String(landAssetId))) | |
149 | 158 | let landSize = split(asset.description, "_")[recLandSize] | |
150 | 159 | (acc + numPiecesBySize(landSize)) | |
151 | 160 | } | |
152 | 161 | ||
153 | 162 | let $l = lands | |
154 | 163 | let $s = size($l) | |
155 | 164 | let $acc0 = 0 | |
156 | 165 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
157 | 166 | then $a | |
158 | 167 | else oneLand($a, $l[$i]) | |
159 | 168 | ||
160 | 169 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
161 | 170 | then $a | |
162 | 171 | else throw("List size exceeds 100") | |
163 | 172 | ||
164 | 173 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($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), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
165 | 174 | } | |
166 | 175 | [totalPower, usersPower] | |
167 | 176 | } | |
168 | 177 | ||
169 | 178 | ||
170 | 179 | func getWlgStats () = { | |
171 | 180 | let issuedAmount = valueOrErrorMessage(getInteger(wlgContract, wlgIssuedAmountKey), "WLGOLD is not issued yet") | |
172 | 181 | let economyUsd = assetBalance(economyContract, usdtAssetId) | |
173 | 182 | let restUsd = assetBalance(restContract, usdtAssetId) | |
174 | 183 | let wlgUsd = assetBalance(wlgContract, usdtAssetId) | |
175 | 184 | let puzzleUsd = assetBalance(puzzlePoolContract, usdtAssetId) | |
176 | 185 | let totalUsd = (((economyUsd + restUsd) + wlgUsd) + puzzleUsd) | |
177 | 186 | [issuedAmount, fraction(totalUsd, MULT8, issuedAmount), totalUsd, economyUsd, restUsd, wlgUsd, puzzleUsd] | |
178 | 187 | } | |
179 | 188 | ||
180 | 189 | ||
181 | 190 | let MULT14 = 100000000000000 | |
182 | 191 | ||
183 | 192 | let MARKETINGSHARE = 100000 | |
184 | 193 | ||
185 | 194 | let TEAMSHARE = 200000 | |
186 | 195 | ||
187 | 196 | let ACTIVITYSHARE = 100000 | |
188 | 197 | ||
189 | 198 | let PLAYERSHARE = 400000 | |
190 | 199 | ||
191 | 200 | let YEARMILLIS = 31557600000 | |
192 | 201 | ||
193 | 202 | let WEEKMILLIS = 604800000 | |
194 | 203 | ||
195 | 204 | let MAXPERIOD = 156 | |
196 | 205 | ||
197 | - | let TENMINUTESMILLIS = 600000 | |
198 | - | ||
199 | 206 | let A6 = 100000000 | |
200 | 207 | ||
201 | 208 | let B8 = 50000000 | |
202 | 209 | ||
203 | 210 | let wlgAssetIdKey = "wlg_assetId" | |
204 | 211 | ||
205 | 212 | let wlgIssueTimeKey = "wlg_issueTime" | |
206 | 213 | ||
207 | 214 | let marketingAddrKey = "marketingAddr" | |
208 | 215 | ||
209 | 216 | let teamAddrKey = "teamAddr" | |
210 | 217 | ||
211 | 218 | let lastMarketingTimeKey = "lastClaimedTime_marketing" | |
212 | 219 | ||
213 | 220 | let lastTeamTimeKey = "lastClaimedTime_team" | |
214 | 221 | ||
215 | 222 | let lastActivitiesTimeKey = "lastClaimedTime_activities" | |
216 | 223 | ||
217 | 224 | func keyLastClaimedTimeByUser (addr) = ("lastClaimedTimeUser_" + addr) | |
218 | 225 | ||
219 | 226 | ||
220 | 227 | func keyLastArbTimeByUser (addr) = ("lastArbTimeUser_" + addr) | |
221 | 228 | ||
222 | 229 | ||
223 | 230 | let stakersAmountLeftKey = "stakersAmountLeft" | |
224 | 231 | ||
225 | 232 | let stakersAmountPaidTotalKey = "stakersAmountPaidTotal" | |
226 | 233 | ||
227 | 234 | func keyStakersAmountPaidUser (addr) = ("stakersAmountPaidUser_" + addr) | |
228 | 235 | ||
229 | 236 | ||
230 | 237 | let wlgAssetId = valueOrErrorMessage(getBinary(wlgAssetIdKey), "Not initialized yet") | |
231 | 238 | ||
232 | 239 | func prolog () = if (valueOrElse(getBoolean(stakingContract, keyBlocked()), false)) | |
233 | 240 | then throw("Contracts are under maintenance") | |
234 | 241 | else asInt(invoke(stakingContract, "saveLastTx", nil, nil)) | |
235 | 242 | ||
236 | 243 | ||
237 | 244 | func getSwapLimit (addr) = { | |
238 | 245 | let lastTime = valueOrElse(getInteger(keyLastArbTimeByUser(addr)), 0) | |
239 | 246 | let now = lastBlock.timestamp | |
240 | - | if (( | |
247 | + | if ((arbitrageDelay > (now - lastTime))) | |
241 | 248 | then throw("Arbitrages are possible once a 10 minutes") | |
242 | 249 | else { | |
243 | 250 | let pieces = getVotingPower(addr)[IdxEffUser] | |
244 | 251 | let pow8 = pow(pieces, 0, B8, 8, 8, CEILING) | |
245 | 252 | fraction(A6, pow8, MULT8) | |
246 | 253 | } | |
247 | 254 | } | |
248 | 255 | ||
249 | 256 | ||
250 | 257 | @Callable(i) | |
251 | 258 | func constructorV1 (restAddr,marketingAddr,teamAddr) = if ((i.caller != this)) | |
252 | 259 | then throw("Permission denied") | |
253 | 260 | else if (isDefined(getBinary(wlgAssetIdKey))) | |
254 | 261 | then throw("Already initialized") | |
255 | 262 | else { | |
256 | 263 | let issuedAmount = MULT14 | |
257 | 264 | let issue = Issue("WLGOLD", "WavesLands Gold investment token", issuedAmount, 8, true, unit, 0) | |
258 | 265 | let assetId = calculateAssetId(issue) | |
259 | 266 | [issue, IntegerEntry(wlgIssueTimeKey, lastBlock.timestamp), IntegerEntry(wlgIssuedAmountKey, issuedAmount), IntegerEntry(stakersAmountPaidTotalKey, 0), IntegerEntry(stakersAmountLeftKey, fraction(MULT14, PLAYERSHARE, MULT6)), BinaryEntry(wlgAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr), StringEntry(marketingAddrKey, marketingAddr), StringEntry(teamAddrKey, teamAddr)] | |
260 | 267 | } | |
261 | 268 | ||
262 | 269 | ||
263 | 270 | ||
264 | 271 | @Callable(i) | |
265 | 272 | func buyWlg () = { | |
266 | 273 | let prologResult = prolog() | |
267 | 274 | if ((size(i.payments) != 1)) | |
268 | 275 | then throw("exactly 1 payment must be attached") | |
269 | 276 | else { | |
270 | 277 | let pmt = i.payments[0] | |
271 | 278 | let usdtAmt = pmt.amount | |
272 | 279 | let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment") | |
273 | 280 | if ((pmtAssetId != usdtAssetId)) | |
274 | 281 | then throw("USDT payments only!") | |
275 | 282 | else { | |
276 | 283 | let caller = i.caller | |
277 | 284 | let addr = toString(caller) | |
278 | 285 | let maxUsdt = getSwapLimit(addr) | |
279 | 286 | if ((usdtAmt > maxUsdt)) | |
280 | 287 | then throw((("You can spend max " + toString(maxUsdt)) + " USDT")) | |
281 | 288 | else { | |
282 | 289 | let curStats = getWlgStats() | |
283 | 290 | let curAmount = curStats[idxWlgAmount] | |
284 | 291 | let buyPrice = fraction(curStats[idxWlgPrice], 6, 5) | |
285 | 292 | let wlgAmount = fraction(usdtAmt, MULT8, buyPrice) | |
286 | 293 | let reissued = fraction(usdtAmt, curAmount, (curStats[idxWlgFunds] - usdtAmt)) | |
287 | 294 | $Tuple2([Reissue(wlgAssetId, reissued, true), IntegerEntry(wlgIssuedAmountKey, (curAmount + reissued)), IntegerEntry(keyLastArbTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(caller, wlgAmount, wlgAssetId)], prologResult) | |
288 | 295 | } | |
289 | 296 | } | |
290 | 297 | } | |
291 | 298 | } | |
292 | 299 | ||
293 | 300 | ||
294 | 301 | ||
295 | 302 | @Callable(i) | |
296 | 303 | func sellWlg () = { | |
297 | 304 | let prologResult = prolog() | |
298 | 305 | if ((size(i.payments) != 1)) | |
299 | 306 | then throw("exactly 1 payment must be attached") | |
300 | 307 | else { | |
301 | 308 | let pmt = i.payments[0] | |
302 | 309 | let wlgAmt = pmt.amount | |
303 | 310 | let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment") | |
304 | 311 | if ((pmtAssetId != wlgAssetId)) | |
305 | 312 | then throw("WLGOLD payments only!") | |
306 | 313 | else { | |
307 | 314 | let caller = i.caller | |
308 | 315 | let addr = toString(caller) | |
309 | 316 | let maxUsdt = getSwapLimit(addr) | |
310 | 317 | let curStats = getWlgStats() | |
311 | 318 | let curAmount = (curStats[idxWlgAmount] - wlgAmt) | |
312 | 319 | let sellPrice = fraction(curStats[idxWlgPrice], 4, 5) | |
313 | 320 | let usdtAmount = fraction(wlgAmt, sellPrice, MULT8) | |
314 | 321 | if ((usdtAmount > maxUsdt)) | |
315 | 322 | then throw((("You can get max " + toString(maxUsdt)) + " USDT")) | |
316 | 323 | else { | |
317 | 324 | let burned = fraction(usdtAmount, curAmount, curStats[idxWlgFunds]) | |
318 | 325 | $Tuple2([Burn(wlgAssetId, burned), IntegerEntry(wlgIssuedAmountKey, (curAmount - burned)), IntegerEntry(keyLastArbTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(caller, usdtAmount, usdtAssetId)], prologResult) | |
319 | 326 | } | |
320 | 327 | } | |
321 | 328 | } | |
322 | 329 | } | |
323 | 330 | ||
324 | 331 | ||
325 | 332 | ||
326 | 333 | @Callable(i) | |
327 | 334 | func claim () = { | |
328 | 335 | let prologResult = prolog() | |
329 | 336 | let caller = i.caller | |
330 | 337 | let callerAddr = toString(caller) | |
331 | 338 | let now = lastBlock.timestamp | |
332 | 339 | let issueTime = valueOrErrorMessage(getInteger(wlgIssueTimeKey), "Not initialized") | |
333 | 340 | let lastMarketingTime = valueOrElse(getInteger(lastMarketingTimeKey), issueTime) | |
334 | 341 | let marketingAddr = addressFromStringValue(value(getString(marketingAddrKey))) | |
335 | 342 | let marketingAmount = fraction(fraction(MULT14, MARKETINGSHARE, MULT6), (now - lastMarketingTime), YEARMILLIS) | |
336 | 343 | let lastTeamTime = valueOrElse(getInteger(lastTeamTimeKey), issueTime) | |
337 | 344 | let teamAddr = addressFromStringValue(value(getString(teamAddrKey))) | |
338 | 345 | let teamAmount = fraction(fraction(MULT14, TEAMSHARE, MULT6), (now - lastTeamTime), (3 * YEARMILLIS)) | |
339 | 346 | let lastActivitiesTime = valueOrElse(getInteger(lastActivitiesTimeKey), issueTime) | |
340 | 347 | let actAmount = fraction(fraction(MULT14, ACTIVITYSHARE, MULT6), (now - lastActivitiesTime), (3 * YEARMILLIS)) | |
341 | 348 | let curPeriod = ((now - issueTime) / WEEKMILLIS) | |
342 | 349 | if ((curPeriod > (MAXPERIOD / 2))) | |
343 | 350 | then throw("Please modify contract for next 1.5 years, according to stats") | |
344 | 351 | else { | |
345 | 352 | let eff = getVotingPower(callerAddr) | |
346 | 353 | let totalPieces = eff[IdxEffTotal] | |
347 | 354 | let amountLeftTotal = valueOrElse(getInteger(stakersAmountLeftKey), 0) | |
348 | 355 | let curPeriodDistribution = fraction(amountLeftTotal, (2 * totalPieces), (totalPieces + (max([100000, totalPieces]) * (MAXPERIOD - curPeriod)))) | |
349 | 356 | let userTimeKey = keyLastClaimedTimeByUser(callerAddr) | |
350 | 357 | let lastUserTime = valueOrElse(getInteger(userTimeKey), issueTime) | |
351 | 358 | let userAmount = fraction(fraction(curPeriodDistribution, eff[IdxEffUser], totalPieces), (now - lastUserTime), (3 * YEARMILLIS)) | |
352 | 359 | let userKey = keyStakersAmountPaidUser(callerAddr) | |
353 | 360 | $Tuple2([ScriptTransfer(marketingAddr, marketingAmount, wlgAssetId), ScriptTransfer(teamAddr, teamAmount, wlgAssetId), ScriptTransfer(restContract, actAmount, wlgAssetId), ScriptTransfer(caller, userAmount, wlgAssetId), IntegerEntry(userKey, (valueOrElse(getInteger(userKey), 0) + userAmount)), IntegerEntry(stakersAmountPaidTotalKey, (valueOrElse(getInteger(stakersAmountPaidTotalKey), 0) + userAmount)), IntegerEntry(stakersAmountLeftKey, (amountLeftTotal - userAmount)), IntegerEntry(lastMarketingTimeKey, now), IntegerEntry(lastTeamTimeKey, now), IntegerEntry(lastActivitiesTimeKey, now), IntegerEntry(userTimeKey, now)], prologResult) | |
354 | 361 | } | |
355 | 362 | } | |
356 | 363 | ||
357 | 364 | ||
358 | 365 | ||
359 | 366 | @Callable(i) | |
360 | 367 | func onStakeLand (addr) = if ((i.caller != stakingContract)) | |
361 | 368 | then throw("Permission denied") | |
362 | 369 | else $Tuple2([IntegerEntry(keyLastClaimedTimeByUser(addr), lastBlock.timestamp)], lastBlock.timestamp) | |
363 | 370 | ||
364 | 371 | ||
365 | 372 | ||
366 | 373 | @Callable(i) | |
367 | 374 | func onUnstakeLand (addr) = if ((i.caller != stakingContract)) | |
368 | 375 | then throw("Permission denied") | |
369 | 376 | else $Tuple2([DeleteEntry(keyLastClaimedTimeByUser(addr))], 0) | |
370 | 377 | ||
371 | 378 |
github/deemru/w8io/169f3d6 51.33 ms ◑