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