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