tx · Dpe98dDAc71EQtxLfhYS8D5Nbe4PqGre9t9WqXDrzDkE 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy: -0.01500000 Waves 2023.07.24 20:52 [2680268] smart account 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy > SELF 0.00000000 Waves
{ "type": 13, "id": "Dpe98dDAc71EQtxLfhYS8D5Nbe4PqGre9t9WqXDrzDkE", "fee": 1500000, "feeAssetId": null, "timestamp": 1690221142529, "version": 2, "chainId": 84, "sender": "3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy", "senderPublicKey": "FsR18761ZAsUqsTd7TK3XmR6bhihs1UXVmpHYxz5JzQ1", "proofs": [ "Aus5Aj5ndig8fTVAhrjvBuMweFvnhLNZmeEDSc7DWiNVzDgkRyhnV7V3285QxaqTBu4P6vkEASYdugf7KMQnBYd" ], "script": "base64:BgIbCAISBgoECAgICBIDCgEBEgMKAQESABIDCgEIWQACTTYAwIQ9AAJNOACAwtcvAAhNSUxMSU9ONgCAgOmDsd4WAA5NQVJLRVRJTkdTSEFSRQCgjQYACVRFQU1TSEFSRQDAmgwADUFDVElWSVRZU0hBUkUAoI0GAAtQTEFZRVJTSEFSRQCAtRgACllFQVJNSUxMSVMAgIbrx3UACUNIRUNLVElNRQCAyeCrsAEAA0RBWQCAuJkpABBtYXJrZXRpbmdBZGRyS2V5Ag1tYXJrZXRpbmdBZGRyAAt0ZWFtQWRkcktleQIIdGVhbUFkZHIAFGxhc3RNYXJrZXRpbmdUaW1lS2V5AhlsYXN0Q2xhaW1lZFRpbWVfbWFya2V0aW5nABZtYXJrZXRpbmdBbW91bnRMZWZ0S2V5AhNtYXJrZXRpbmdBbW91bnRMZWZ0AA9sYXN0VGVhbVRpbWVLZXkCFGxhc3RDbGFpbWVkVGltZV90ZWFtABF0ZWFtQW1vdW50TGVmdEtleQIOdGVhbUFtb3VudExlZnQAFWxhc3RBY3Rpdml0aWVzVGltZUtleQIabGFzdENsY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xwcm9sb2dSZXN1bHQJAQZwcm9sb2cAAwkBAiE9AgkAkAMBCAUBaQhwYXltZW50cwAACQACAQIUTm8gcGF5bWVudHMgcmVxdWlyZWQEB2FjdGlvbnMICQENY2xhaW1JbnRlcm5hbAEJAKUIAQgFAWkGY2FsbGVyAl8xCQCUCgIFB2FjdGlvbnMFDHByb2xvZ1Jlc3VsdAFpARJvblN0YWtlVW5zdGFrZUxhbmQBBGFkZHIDCQECIT0CCAUBaQZjYWxsZXIFD3N0YWtpbmdDb250cmFjdAkAAgECEVBlcm1pc3Npb24gZGVuaWVkCQENY2xhaW1JbnRlcm5hbAEFBGFkZHIANqjRUw==", "height": 2680268, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HWvsbYux8jNLTpt47giZL7mua7uPJzWYDUCAbteBostg Next: EQjLwVUFBbF3KRw7i5cbqA4m8psZwy6XKi9pkT1ryJFb Diff:
Old | New | Differences | |
---|---|---|---|
376 | 376 | else if ((MINSHOPPAYMENT > usdtAmt)) | |
377 | 377 | then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT")) | |
378 | 378 | else { | |
379 | - | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, govContract, wlgContract, puzzlePoolContract], usdtAssetId, usdtAmt) | |
379 | + | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, govContract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, usdtAmt) | |
380 | 380 | let curWlgAmount = curStats[idxWlgAmount] | |
381 | 381 | let fundsUsd = curStats[idxWlgFunds] | |
382 | 382 | let wlgPrice = fraction(fundsUsd, MULT8, curWlgAmount) | |
414 | 414 | let caller = i.caller | |
415 | 415 | let addr = toString(caller) | |
416 | 416 | let maxUsdt = getSwapLimit(addr) | |
417 | - | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, govContract, wlgContract, puzzlePoolContract], usdtAssetId, 0) | |
417 | + | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, govContract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0) | |
418 | 418 | let curWlgAmount = curStats[idxWlgAmount] | |
419 | 419 | let sellPrice = fraction(curStats[idxWlgPrice], 4, 5) | |
420 | 420 | let usdtAmt = fraction(wlgAmt, sellPrice, MULT8) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let M6 = 1000000 | |
5 | 5 | ||
6 | 6 | let M8 = 100000000 | |
7 | 7 | ||
8 | 8 | let MILLION6 = 100000000000000 | |
9 | 9 | ||
10 | 10 | let MARKETINGSHARE = 100000 | |
11 | 11 | ||
12 | 12 | let TEAMSHARE = 200000 | |
13 | 13 | ||
14 | 14 | let ACTIVITYSHARE = 100000 | |
15 | 15 | ||
16 | 16 | let PLAYERSHARE = 400000 | |
17 | 17 | ||
18 | 18 | let YEARMILLIS = 31557600000 | |
19 | 19 | ||
20 | 20 | let CHECKTIME = 47336400000 | |
21 | 21 | ||
22 | 22 | let DAY = 86400000 | |
23 | 23 | ||
24 | 24 | let marketingAddrKey = "marketingAddr" | |
25 | 25 | ||
26 | 26 | let teamAddrKey = "teamAddr" | |
27 | 27 | ||
28 | 28 | let lastMarketingTimeKey = "lastClaimedTime_marketing" | |
29 | 29 | ||
30 | 30 | let marketingAmountLeftKey = "marketingAmountLeft" | |
31 | 31 | ||
32 | 32 | let lastTeamTimeKey = "lastClaimedTime_team" | |
33 | 33 | ||
34 | 34 | let teamAmountLeftKey = "teamAmountLeft" | |
35 | 35 | ||
36 | 36 | let lastActivitiesTimeKey = "lastClaimedTime_activities" | |
37 | 37 | ||
38 | 38 | let actAmountLeftKey = "activitiesAmountLeft" | |
39 | 39 | ||
40 | 40 | let stakersAmountLeftKey = "stakersAmountLeft" | |
41 | 41 | ||
42 | 42 | func keyLastClaimedTimeByUser (addr) = ("lastClaimedTimeUser_" + addr) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func keyLastArbTimeByUser (addr) = ("lastArbTimeUser_" + addr) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func distributionByPeriod (period) = fraction(MILLION6, (PLAYERSHARE * (period + 1)), (6 * M6)) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | let wlgIssueTimeKey = "wlg_issueTime" | |
52 | 52 | ||
53 | 53 | let wlgIssuedAmountKey = "wlg_issuedAmount" | |
54 | 54 | ||
55 | 55 | let zbIssuedAmountKey = "zbill_issuedAmount" | |
56 | 56 | ||
57 | 57 | let idxWlgAmount = 0 | |
58 | 58 | ||
59 | 59 | let idxWlgPrice = 1 | |
60 | 60 | ||
61 | 61 | let idxWlgFunds = 2 | |
62 | 62 | ||
63 | 63 | let idxWlgIssueTime = 7 | |
64 | 64 | ||
65 | 65 | let idxWlgMarketingAmLeft = 10 | |
66 | 66 | ||
67 | 67 | let idxWlgMarketingAmAvailNow = 11 | |
68 | 68 | ||
69 | 69 | let idxWlgTeamAmLeft = 14 | |
70 | 70 | ||
71 | 71 | let idxWlgTeamAmAvailNow = 15 | |
72 | 72 | ||
73 | 73 | let idxWlgActAmLeft = 18 | |
74 | 74 | ||
75 | 75 | let idxWlgActAmAvailNow = 19 | |
76 | 76 | ||
77 | 77 | let idxWlgAmLeftTotal = 22 | |
78 | 78 | ||
79 | 79 | let idxWlgUserAmAvailNow = 25 | |
80 | 80 | ||
81 | 81 | let dappRest = 0 | |
82 | 82 | ||
83 | 83 | let dappStaking = 1 | |
84 | 84 | ||
85 | 85 | let dappEconomy = 2 | |
86 | 86 | ||
87 | 87 | let dappWlg = 4 | |
88 | 88 | ||
89 | 89 | let dappPuzzle = 5 | |
90 | 90 | ||
91 | 91 | let dappInvestFund = 6 | |
92 | 92 | ||
93 | 93 | func getPieces (userAddrStrOrEmpty,stakingContract) = { | |
94 | 94 | let props = split(valueOrElse(getString(stakingContract, "resTypesProportions"), "0_0_0_0_0_0"), "_") | |
95 | 95 | func adder (acc,item) = (acc + parseIntValue(item)) | |
96 | 96 | ||
97 | 97 | let totalPower = { | |
98 | 98 | let $l = props | |
99 | 99 | let $s = size($l) | |
100 | 100 | let $acc0 = 0 | |
101 | 101 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
102 | 102 | then $a | |
103 | 103 | else adder($a, $l[$i]) | |
104 | 104 | ||
105 | 105 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
106 | 106 | then $a | |
107 | 107 | else throw("List size exceeds 6") | |
108 | 108 | ||
109 | 109 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
110 | 110 | } | |
111 | 111 | let usersPower = valueOrElse(getInteger(stakingContract, ("stakedPiecesByOwner_" + userAddrStrOrEmpty)), 0) | |
112 | 112 | [totalPower, usersPower] | |
113 | 113 | } | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func getWlgStats (userAddrOpt,contracts,usdtId,usdtBalanceCorrection) = { | |
117 | 117 | let issuedAmount = valueOrErrorMessage(getInteger(contracts[dappWlg], wlgIssuedAmountKey), "WLGOLD is not issued yet") | |
118 | 118 | let economyUsd = assetBalance(contracts[dappEconomy], usdtId) | |
119 | 119 | let restUsd = assetBalance(contracts[dappRest], usdtId) | |
120 | 120 | let wlgUsd = (assetBalance(contracts[dappWlg], usdtId) - usdtBalanceCorrection) | |
121 | 121 | let puzzleUsd = assetBalance(contracts[dappPuzzle], usdtId) | |
122 | 122 | let investFundContract = contracts[dappInvestFund] | |
123 | 123 | let investFundTotal = (assetBalance(investFundContract, usdtId) + valueOrElse(getInteger(investFundContract, zbIssuedAmountKey), 0)) | |
124 | 124 | let totalFundsUsd = ((economyUsd + wlgUsd) + investFundTotal) | |
125 | 125 | let wlgId = valueOrErrorMessage(getBinary(contracts[dappWlg], "wlg_assetId"), "Not initialized yet") | |
126 | 126 | let now = lastBlock.timestamp | |
127 | 127 | let issueTime = valueOrErrorMessage(getInteger(contracts[dappWlg], wlgIssueTimeKey), "Not initialized") | |
128 | 128 | let marketingTotal = fraction(MILLION6, MARKETINGSHARE, M6) | |
129 | 129 | let marketingAmountLeft = valueOrElse(getInteger(contracts[dappWlg], marketingAmountLeftKey), marketingTotal) | |
130 | 130 | let lastMarketingTime = valueOrElse(getInteger(contracts[dappWlg], lastMarketingTimeKey), issueTime) | |
131 | 131 | let marketingAddr = addressFromStringValue(value(getString(contracts[dappWlg], marketingAddrKey))) | |
132 | 132 | let marketingAmountAvailableNow = min([fraction(marketingTotal, (now - lastMarketingTime), YEARMILLIS), marketingAmountLeft]) | |
133 | 133 | let marketingWlgold = assetBalance(marketingAddr, wlgId) | |
134 | 134 | let teamTotal = fraction(MILLION6, TEAMSHARE, M6) | |
135 | 135 | let teamAmountLeft = valueOrElse(getInteger(contracts[dappWlg], teamAmountLeftKey), teamTotal) | |
136 | 136 | let lastTeamTime = valueOrElse(getInteger(contracts[dappWlg], lastTeamTimeKey), issueTime) | |
137 | 137 | let teamAddr = addressFromStringValue(value(getString(contracts[dappWlg], teamAddrKey))) | |
138 | 138 | let teamAmountAvailableNow = min([fraction(teamTotal, (now - lastTeamTime), (3 * YEARMILLIS)), teamAmountLeft]) | |
139 | 139 | let teamWlgold = assetBalance(teamAddr, wlgId) | |
140 | 140 | let actTotal = fraction(MILLION6, ACTIVITYSHARE, M6) | |
141 | 141 | let actAmountLeft = valueOrElse(getInteger(contracts[dappWlg], actAmountLeftKey), actTotal) | |
142 | 142 | let lastActivitiesTime = valueOrElse(getInteger(contracts[dappWlg], lastActivitiesTimeKey), issueTime) | |
143 | 143 | let actAmountAvailableNow = min([fraction(actTotal, (now - lastActivitiesTime), (3 * YEARMILLIS)), actAmountLeft]) | |
144 | 144 | let actWlgold = assetBalance(contracts[dappRest], wlgId) | |
145 | 145 | let lastUserTime = valueOrElse(getInteger(contracts[dappWlg], keyLastClaimedTimeByUser(userAddrOpt)), issueTime) | |
146 | 146 | let lastUserPeriod = ((lastUserTime - issueTime) / YEARMILLIS) | |
147 | 147 | let nowLimited = min([now, (issueTime + (3 * YEARMILLIS))]) | |
148 | 148 | let curPeriod = min([((now - issueTime) / YEARMILLIS), 2]) | |
149 | 149 | let eff = getPieces(userAddrOpt, contracts[dappStaking]) | |
150 | 150 | let curPeriodDistribution = distributionByPeriod(curPeriod) | |
151 | 151 | let userAmount = fraction(if ((lastUserPeriod == curPeriod)) | |
152 | 152 | then fraction(curPeriodDistribution, (nowLimited - lastUserTime), YEARMILLIS) | |
153 | 153 | else if ((lastUserPeriod == (curPeriod - 1))) | |
154 | 154 | then (fraction(distributionByPeriod((curPeriod - 1)), ((issueTime + (YEARMILLIS * curPeriod)) - lastUserTime), YEARMILLIS) + fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEARMILLIS * curPeriod))), YEARMILLIS)) | |
155 | 155 | else ((fraction(distributionByPeriod((curPeriod - 2)), ((issueTime + (YEARMILLIS * (curPeriod - 1))) - lastUserTime), YEARMILLIS) + distributionByPeriod((curPeriod - 1))) + fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEARMILLIS * curPeriod))), YEARMILLIS)), eff[1], eff[0]) | |
156 | 156 | let sLandDailyAmount = fraction(fraction(curPeriodDistribution, DAY, YEARMILLIS), 25, eff[0]) | |
157 | 157 | let amountLeftTotal = valueOrElse(getInteger(contracts[dappWlg], stakersAmountLeftKey), 0) | |
158 | 158 | [issuedAmount, fraction(totalFundsUsd, M8, issuedAmount), totalFundsUsd, economyUsd, restUsd, wlgUsd, puzzleUsd, issueTime, lastMarketingTime, marketingTotal, marketingAmountLeft, marketingAmountAvailableNow, marketingWlgold, teamTotal, teamAmountLeft, teamAmountAvailableNow, teamWlgold, actTotal, actAmountLeft, actAmountAvailableNow, actWlgold, curPeriod, amountLeftTotal, curPeriodDistribution, lastUserTime, userAmount, sLandDailyAmount, investFundTotal] | |
159 | 159 | } | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | let KSALLOWWLGOLD = true | |
163 | 163 | ||
164 | 164 | let chain = take(drop(this.bytes, 1), 1) | |
165 | 165 | ||
166 | 166 | let usdtAssetId = match chain { | |
167 | 167 | case _ => | |
168 | 168 | if ((base58'2W' == $match0)) | |
169 | 169 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
170 | 170 | else if ((base58'2T' == $match0)) | |
171 | 171 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
172 | 172 | else throw("Unknown chain") | |
173 | 173 | } | |
174 | 174 | ||
175 | 175 | let defaultRestAddressStr = match chain { | |
176 | 176 | case _ => | |
177 | 177 | if ((base58'2W' == $match0)) | |
178 | 178 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
179 | 179 | else if ((base58'2T' == $match0)) | |
180 | 180 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
181 | 181 | else throw("Unknown chain") | |
182 | 182 | } | |
183 | 183 | ||
184 | 184 | let arbitrageDelay = match chain { | |
185 | 185 | case _ => | |
186 | 186 | if ((base58'2W' == $match0)) | |
187 | 187 | then 600000 | |
188 | 188 | else if ((base58'2T' == $match0)) | |
189 | 189 | then 60000 | |
190 | 190 | else throw("Unknown chain") | |
191 | 191 | } | |
192 | 192 | ||
193 | 193 | let SEP = "__" | |
194 | 194 | ||
195 | 195 | let MULT6 = 1000000 | |
196 | 196 | ||
197 | 197 | let MULT8 = 100000000 | |
198 | 198 | ||
199 | 199 | let MINSHOPPAYMENT = 100000 | |
200 | 200 | ||
201 | 201 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
202 | 202 | ||
203 | 203 | ||
204 | 204 | let IdxCfgStakingDapp = 1 | |
205 | 205 | ||
206 | 206 | let IdxCfgEconomyDapp = 2 | |
207 | 207 | ||
208 | 208 | let IdxCfgGovernanceDapp = 3 | |
209 | 209 | ||
210 | 210 | let IdxCfgWlgDapp = 4 | |
211 | 211 | ||
212 | 212 | let IdxCfgPuzzlePoolDapp = 5 | |
213 | 213 | ||
214 | 214 | let IdxCfgInvestFundDapp = 6 | |
215 | 215 | ||
216 | 216 | func keyRestCfg () = "%s__restConfig" | |
217 | 217 | ||
218 | 218 | ||
219 | 219 | func keyRestAddress () = "%s__restAddr" | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
223 | 223 | ||
224 | 224 | ||
225 | 225 | func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
226 | 226 | ||
227 | 227 | ||
228 | 228 | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
229 | 229 | ||
230 | 230 | let restCfg = readRestCfgOrFail(restContract) | |
231 | 231 | ||
232 | 232 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
233 | 233 | ||
234 | 234 | let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp) | |
235 | 235 | ||
236 | 236 | let govContract = getContractAddressOrFail(restCfg, IdxCfgGovernanceDapp) | |
237 | 237 | ||
238 | 238 | let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp) | |
239 | 239 | ||
240 | 240 | let puzzlePoolContract = getContractAddressOrFail(restCfg, IdxCfgPuzzlePoolDapp) | |
241 | 241 | ||
242 | 242 | let investFundContract = getContractAddressOrFail(restCfg, IdxCfgInvestFundDapp) | |
243 | 243 | ||
244 | 244 | let wlgAssetIdKey = "wlg_assetId" | |
245 | 245 | ||
246 | 246 | let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "Not initialized yet") | |
247 | 247 | ||
248 | 248 | let IdxEffUser = 1 | |
249 | 249 | ||
250 | 250 | func keyResProportions () = "resTypesProportions" | |
251 | 251 | ||
252 | 252 | ||
253 | 253 | func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr) | |
254 | 254 | ||
255 | 255 | ||
256 | 256 | func asInt (v) = match v { | |
257 | 257 | case n: Int => | |
258 | 258 | n | |
259 | 259 | case _ => | |
260 | 260 | throw("fail to cast into Int") | |
261 | 261 | } | |
262 | 262 | ||
263 | 263 | ||
264 | 264 | func getVotingPower (userAddrStrOrEmpty) = { | |
265 | 265 | let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_") | |
266 | 266 | func adder (acc,item) = (acc + parseIntValue(item)) | |
267 | 267 | ||
268 | 268 | let totalPower = { | |
269 | 269 | let $l = props | |
270 | 270 | let $s = size($l) | |
271 | 271 | let $acc0 = 0 | |
272 | 272 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
273 | 273 | then $a | |
274 | 274 | else adder($a, $l[$i]) | |
275 | 275 | ||
276 | 276 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
277 | 277 | then $a | |
278 | 278 | else throw("List size exceeds 6") | |
279 | 279 | ||
280 | 280 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
281 | 281 | } | |
282 | 282 | let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0) | |
283 | 283 | [totalPower, usersPower] | |
284 | 284 | } | |
285 | 285 | ||
286 | 286 | ||
287 | 287 | func fixedPoint (val,decimals) = { | |
288 | 288 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
289 | 289 | ((toString((val / tenPow)) + ".") + toString((val % tenPow))) | |
290 | 290 | } | |
291 | 291 | ||
292 | 292 | ||
293 | 293 | let A6 = 100000000 | |
294 | 294 | ||
295 | 295 | let B8 = 50000000 | |
296 | 296 | ||
297 | 297 | let profitAddrKey = "profitAddr" | |
298 | 298 | ||
299 | 299 | let stakersAmountPaidTotalKey = "stakersAmountPaidTotal" | |
300 | 300 | ||
301 | 301 | func keyStakersAmountPaidUser (addr) = ("stakersAmountPaidUser_" + addr) | |
302 | 302 | ||
303 | 303 | ||
304 | 304 | func prolog () = asInt(invoke(stakingContract, "saveLastTx", nil, nil)) | |
305 | 305 | ||
306 | 306 | ||
307 | 307 | func getSwapLimit (addr) = { | |
308 | 308 | let lastTime = valueOrElse(getInteger(keyLastArbTimeByUser(addr)), 0) | |
309 | 309 | let now = lastBlock.timestamp | |
310 | 310 | if ((arbitrageDelay > (now - lastTime))) | |
311 | 311 | then throw((("Arbitrages are possible once a " + toString((arbitrageDelay / 60000))) + "min")) | |
312 | 312 | else { | |
313 | 313 | let pieces = getVotingPower(addr)[IdxEffUser] | |
314 | 314 | let pow8 = pow(pieces, 0, B8, 8, 8, CEILING) | |
315 | 315 | fraction(A6, pow8, MULT8) | |
316 | 316 | } | |
317 | 317 | } | |
318 | 318 | ||
319 | 319 | ||
320 | 320 | func claimInternal (addr) = if (!(KSALLOWWLGOLD)) | |
321 | 321 | then $Tuple2(nil, 0) | |
322 | 322 | else { | |
323 | 323 | let caller = addressFromStringValue(addr) | |
324 | 324 | let curStats = getWlgStats(addr, [restContract, stakingContract, economyContract, govContract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0) | |
325 | 325 | let now = lastBlock.timestamp | |
326 | 326 | let issueTime = curStats[idxWlgIssueTime] | |
327 | 327 | let marketingAmountLeft = curStats[idxWlgMarketingAmLeft] | |
328 | 328 | let marketingAmount = curStats[idxWlgMarketingAmAvailNow] | |
329 | 329 | let teamAmountLeft = curStats[idxWlgTeamAmLeft] | |
330 | 330 | let teamAmount = curStats[idxWlgTeamAmAvailNow] | |
331 | 331 | let actAmountLeft = curStats[idxWlgActAmLeft] | |
332 | 332 | let actAmount = curStats[idxWlgActAmAvailNow] | |
333 | 333 | if (((now - issueTime) > CHECKTIME)) | |
334 | 334 | then throw("Please modify contract for next 1.5 years, according to stats") | |
335 | 335 | else { | |
336 | 336 | let userAmount = curStats[idxWlgUserAmAvailNow] | |
337 | 337 | let userKey = keyStakersAmountPaidUser(addr) | |
338 | 338 | $Tuple2([ScriptTransfer(addressFromStringValue(value(getString(marketingAddrKey))), marketingAmount, wlgAssetId), ScriptTransfer(addressFromStringValue(value(getString(teamAddrKey))), 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, (curStats[idxWlgAmLeftTotal] - userAmount)), IntegerEntry(marketingAmountLeftKey, (marketingAmountLeft - marketingAmount)), IntegerEntry(lastMarketingTimeKey, now), IntegerEntry(teamAmountLeftKey, (teamAmountLeft - teamAmount)), IntegerEntry(lastTeamTimeKey, now), IntegerEntry(actAmountLeftKey, (actAmountLeft - actAmount)), IntegerEntry(lastActivitiesTimeKey, now), IntegerEntry(keyLastClaimedTimeByUser(addr), now)], userAmount) | |
339 | 339 | } | |
340 | 340 | } | |
341 | 341 | ||
342 | 342 | ||
343 | 343 | @Callable(i) | |
344 | 344 | func constructorV1 (restAddr,marketingAddr,teamAddr,profitAddr) = if ((i.caller != this)) | |
345 | 345 | then throw("Permission denied") | |
346 | 346 | else if (isDefined(getBinary(wlgAssetIdKey))) | |
347 | 347 | then throw("Already initialized") | |
348 | 348 | else { | |
349 | 349 | let issuedAmount = MILLION6 | |
350 | 350 | let issue = Issue("WLGOLD", "WavesLands Gold investment token", issuedAmount, 8, true, unit, 0) | |
351 | 351 | let assetId = calculateAssetId(issue) | |
352 | 352 | [issue, IntegerEntry(wlgIssueTimeKey, lastBlock.timestamp), IntegerEntry(wlgIssuedAmountKey, issuedAmount), IntegerEntry(stakersAmountPaidTotalKey, 0), IntegerEntry(stakersAmountLeftKey, fraction(MILLION6, PLAYERSHARE, MULT6)), BinaryEntry(wlgAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr), StringEntry(marketingAddrKey, marketingAddr), StringEntry(teamAddrKey, teamAddr), StringEntry(profitAddrKey, profitAddr)] | |
353 | 353 | } | |
354 | 354 | ||
355 | 355 | ||
356 | 356 | ||
357 | 357 | @Callable(i) | |
358 | 358 | func buyWlg (minAmount) = if (!(KSALLOWWLGOLD)) | |
359 | 359 | then $Tuple2(nil, 0) | |
360 | 360 | else { | |
361 | 361 | let prologResult = prolog() | |
362 | 362 | if ((size(i.payments) != 1)) | |
363 | 363 | then throw("exactly 1 payment must be attached") | |
364 | 364 | else { | |
365 | 365 | let pmt = i.payments[0] | |
366 | 366 | let usdtAmt = pmt.amount | |
367 | 367 | let pmtAssetId = valueOrErrorMessage(pmt.assetId, "USDT payments only!") | |
368 | 368 | if ((pmtAssetId != usdtAssetId)) | |
369 | 369 | then throw("USDT payments only!") | |
370 | 370 | else { | |
371 | 371 | let caller = i.caller | |
372 | 372 | let addr = toString(caller) | |
373 | 373 | let maxUsdt = getSwapLimit(addr) | |
374 | 374 | if ((usdtAmt > maxUsdt)) | |
375 | 375 | then throw((("You can spend max " + fixedPoint(maxUsdt, 6)) + " USDT")) | |
376 | 376 | else if ((MINSHOPPAYMENT > usdtAmt)) | |
377 | 377 | then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT")) | |
378 | 378 | else { | |
379 | - | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, govContract, wlgContract, puzzlePoolContract], usdtAssetId, usdtAmt) | |
379 | + | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, govContract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, usdtAmt) | |
380 | 380 | let curWlgAmount = curStats[idxWlgAmount] | |
381 | 381 | let fundsUsd = curStats[idxWlgFunds] | |
382 | 382 | let wlgPrice = fraction(fundsUsd, MULT8, curWlgAmount) | |
383 | 383 | let buyPrice = fraction(wlgPrice, 6, 5) | |
384 | 384 | let wlgAmount = fraction(usdtAmt, MULT8, buyPrice) | |
385 | 385 | if ((minAmount > wlgAmount)) | |
386 | 386 | then throw("Price changed during operation, please try again") | |
387 | 387 | else { | |
388 | 388 | let profitAmount = (usdtAmt / 6) | |
389 | 389 | let deltaFunds = (usdtAmt - profitAmount) | |
390 | 390 | let reissued = fraction(curWlgAmount, deltaFunds, fundsUsd) | |
391 | 391 | $Tuple2([Reissue(wlgAssetId, reissued, true), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount + reissued)), IntegerEntry(keyLastArbTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, wlgAmount, wlgAssetId)], prologResult) | |
392 | 392 | } | |
393 | 393 | } | |
394 | 394 | } | |
395 | 395 | } | |
396 | 396 | } | |
397 | 397 | ||
398 | 398 | ||
399 | 399 | ||
400 | 400 | @Callable(i) | |
401 | 401 | func sellWlg (minAmount) = if (!(KSALLOWWLGOLD)) | |
402 | 402 | then $Tuple2(nil, 0) | |
403 | 403 | else { | |
404 | 404 | let prologResult = prolog() | |
405 | 405 | if ((size(i.payments) != 1)) | |
406 | 406 | then throw("exactly 1 payment must be attached") | |
407 | 407 | else { | |
408 | 408 | let pmt = i.payments[0] | |
409 | 409 | let wlgAmt = pmt.amount | |
410 | 410 | let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WLGOLD payments only!") | |
411 | 411 | if ((pmtAssetId != wlgAssetId)) | |
412 | 412 | then throw("WLGOLD payments only!") | |
413 | 413 | else { | |
414 | 414 | let caller = i.caller | |
415 | 415 | let addr = toString(caller) | |
416 | 416 | let maxUsdt = getSwapLimit(addr) | |
417 | - | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, govContract, wlgContract, puzzlePoolContract], usdtAssetId, 0) | |
417 | + | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, govContract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0) | |
418 | 418 | let curWlgAmount = curStats[idxWlgAmount] | |
419 | 419 | let sellPrice = fraction(curStats[idxWlgPrice], 4, 5) | |
420 | 420 | let usdtAmt = fraction(wlgAmt, sellPrice, MULT8) | |
421 | 421 | if ((usdtAmt > maxUsdt)) | |
422 | 422 | then throw((("You can get max " + fixedPoint(maxUsdt, 6)) + " USDT")) | |
423 | 423 | else if ((MINSHOPPAYMENT > usdtAmt)) | |
424 | 424 | then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT")) | |
425 | 425 | else if ((minAmount > usdtAmt)) | |
426 | 426 | then throw("Price changed during operation, please try again") | |
427 | 427 | else { | |
428 | 428 | let profitAmount = (usdtAmt / 4) | |
429 | 429 | let burned = fraction((usdtAmt + profitAmount), curWlgAmount, curStats[idxWlgFunds]) | |
430 | 430 | $Tuple2([Burn(wlgAssetId, burned), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount - burned)), IntegerEntry(keyLastArbTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, usdtAmt, usdtAssetId)], prologResult) | |
431 | 431 | } | |
432 | 432 | } | |
433 | 433 | } | |
434 | 434 | } | |
435 | 435 | ||
436 | 436 | ||
437 | 437 | ||
438 | 438 | @Callable(i) | |
439 | 439 | func claim () = { | |
440 | 440 | let prologResult = prolog() | |
441 | 441 | if ((size(i.payments) != 0)) | |
442 | 442 | then throw("No payments required") | |
443 | 443 | else { | |
444 | 444 | let actions = claimInternal(toString(i.caller))._1 | |
445 | 445 | $Tuple2(actions, prologResult) | |
446 | 446 | } | |
447 | 447 | } | |
448 | 448 | ||
449 | 449 | ||
450 | 450 | ||
451 | 451 | @Callable(i) | |
452 | 452 | func onStakeUnstakeLand (addr) = if ((i.caller != stakingContract)) | |
453 | 453 | then throw("Permission denied") | |
454 | 454 | else claimInternal(addr) | |
455 | 455 | ||
456 | 456 |
github/deemru/w8io/026f985 63.85 ms ◑