tx · n6Nb3gfYDFdrUW1uLVVzQGXZcsbNPymDn9WVSZMztvZ

3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv:  -0.01400000 Waves

2024.09.13 04:46 [3281211] smart account 3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv > SELF 0.00000000 Waves

{ "type": 13, "id": "n6Nb3gfYDFdrUW1uLVVzQGXZcsbNPymDn9WVSZMztvZ", "fee": 1400000, "feeAssetId": null, "timestamp": 1726191979348, "version": 2, "chainId": 84, "sender": "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv", "senderPublicKey": "2fNSk5gmWbXBDTkSYSKd66xSgVvAYzrJnP9YSAFNvTwC", "proofs": [ "5edBsyqZL95QH9UAXJHy6gxfdt1qGD35NjCbo8ihydd9zivZoH7TejjerKoRxoqH76mouNkDVZNcP6bypaF6VJif" ], "script": "base64:BgIWCAISAwoBGBIDCgEIEgMKAQgSAwoBCFsAA1NFUAICX18ABWNoYWluCQDJAQIJAMoBAggFBHRoaXMFYnl0ZXMAAQABAAt1c2R0QXNzZXRJZAQHJG1hdGNoMAUFY2hhaW4DCQAAAgEBVwUHJG1hdGNoMAEghNp6sggDP07Ru8qO7ouTvMmC3Qtd+geWqNQj+agP/7kDCQAAAgEBVAUHJG1hdGNoMAEgVbHYn3KHgu/l41uNrAWrZd6aQ6EvFrsF8xq3h6XxxRgJAAIBAg1Vbmtub3duIGNoYWluABZkZWZhdWx0UmVzdDJBZGRyZXNzU3RyBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwAiMzUEZ3WXRhOGJpRXozMXpwZUZlNURKSzh3RTV0clNwUVZGOAMJAAACAQFUBQckbWF0Y2gwAiMzTjdVdVlhcjYyNjRQNThGQmhWV0tQUUFoNFl1YTJoZ25ndgkAAgECDVVua25vd24gY2hhaW4AFW9sZFN0YWtpbmdDb250cmFjdFN0cgQHJG1hdGNoMAUFY2hhaW4DCQAAAgEBVwUHJG1hdGNoMAIjM1BMbmNYdFMx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applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6QoWLHuwmreHtGSqvVqffhK3ycJ1mAynKFhPt2eA5Yt Next: G2mdREjNEm7rvRZHwiL82oYnhVh3Eu1rkoBAopBkocoS Diff:
OldNewDifferences
44 let SEP = "__"
55
66 let chain = take(drop(this.bytes, 1), 1)
7+
8+let usdtAssetId = match chain {
9+ case _ =>
10+ if ((base58'2W' == $match0))
11+ then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
12+ else if ((base58'2T' == $match0))
13+ then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63'
14+ else throw("Unknown chain")
15+}
716
817 let defaultRest2AddressStr = match chain {
918 case _ =>
3039
3140 let IdxCfgWlgDapp = 2
3241
42+let IdxCfgPuzzlePoolDapp = 4
43+
44+let IdxCfgInvestFundDapp = 5
45+
3346 func keyRestCfg () = "%s__restConfig"
3447
3548
4962 let acres2Contract = getContractAddressOrFail(rest2Cfg, IdxCfgAcres2Dapp)
5063
5164 let wlgContract = getContractAddressOrFail(rest2Cfg, IdxCfgWlgDapp)
65+
66+let puzzlePoolContract = getContractAddressOrFail(rest2Cfg, IdxCfgPuzzlePoolDapp)
67+
68+let investFundContract = getContractAddressOrFail(rest2Cfg, IdxCfgInvestFundDapp)
5269
5370 let oldAcresContractKey = "oldAcresContract"
5471
99116 }
100117
101118
119+let M6_ = 1000000
120+
102121 let M8_ = 100000000
122+
123+let MILL6 = 100000000000000
124+
125+let TEAM_SHARE = 200000
126+
127+let ACTIVITY_SHARE = 100000
128+
129+let PLAYER_SHARE = 400000
130+
131+let YEAR_MILLIS = 31557600000
132+
133+let chn = take(drop(this.bytes, 1), 1)
134+
135+let USDT_TVL_CORR = match chn {
136+ case _ =>
137+ if ((base58'2W' == $match0))
138+ then 1208630000
139+ else if ((base58'2T' == $match0))
140+ then 0
141+ else throw("Unknown chain")
142+}
143+
144+let teamAdrKey = "teamAddr"
145+
146+let lastTeamTimKey = "lastClaimedTime_team"
147+
148+let teamAmtLeftKey = "teamAmountLeft"
149+
150+let lastActivitiesTimKey = "lastClaimedTime_activities"
151+
152+let actAmtLeftKey = "activitiesAmountLeft"
153+
154+let stakersAmtLeftKey = "stakersAmountLeft"
155+
156+func keyLastClaimTimeByUser (addr) = ("lastClaimedTimeUser_" + addr)
157+
158+
159+func distrByPeriod (period) = fraction(MILL6, (PLAYER_SHARE * (period + 1)), (6 * M6_))
160+
161+
162+let wlgIssueTimKey = "wlg_issueTime"
163+
164+let wlgIssuedAmtKey = "wlg_issuedAmount"
165+
166+let zbIssuedAmtKey = "zbill_issuedAmount"
103167
104168 func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr)
105169
170+
171+let acresStakdTotalKey = "acresStakedAmountTotal"
172+
173+let dapp2Rest = 0
174+
175+let dapp2Staking = 1
176+
177+let dapp2Wlg = 2
178+
179+let dapp2Puzzle = 3
180+
181+let dapp2InvestFund = 4
106182
107183 let levels = [10, 20, 40, 80, 150, 250, 400, 700, 1000]
108184
127203 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
128204 }
129205 (idx + 1)
206+ }
207+
208+
209+func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4))
210+
211+
212+func getFarmingPowers (userAddrStrOrEmpty,stakingContract) = {
213+ let totalAcres = valueOrElse(getInteger(stakingContract, acresStakdTotalKey), 0)
214+ let totalFP = getFarmingPowerByAcres(totalAcres)
215+ let userAcres = valueOrElse(getInteger(stakingContract, keyAcresStakedAmtByUser(userAddrStrOrEmpty)), 0)
216+ let userFP = getFarmingPowerByAcres(userAcres)
217+[totalFP, userFP]
218+ }
219+
220+
221+let idxTotalFP = 0
222+
223+let idxUserFP = 1
224+
225+let ixWlgAmount = 0
226+
227+let ixWlgPrice = 1
228+
229+let ixWlgFunds = 2
230+
231+let ixWlgActivity = 3
232+
233+let ixWlgArbitrage = 4
234+
235+let ixWlgPool = 5
236+
237+let ixWlgIssueTime = 6
238+
239+let ixWlgLastTeamActTime = 7
240+
241+let ixWlgTeamTotal = 8
242+
243+let ixWlgTeamAmLeft = 9
244+
245+let ixWlgTeamAmAvailNow = 10
246+
247+let ixWlgTeamWlgold = 11
248+
249+let ixWlgActTotal = 12
250+
251+let ixWlgActAmLeft = 13
252+
253+let ixWlgActAmAvailNow = 14
254+
255+let ixWlgActWlgold = 15
256+
257+let ixWlgCurPeriod = 16
258+
259+let ixWlgAmLeftTotal = 17
260+
261+let ixWlgCurPeriodDistribution = 18
262+
263+let ixWlgLastUserTime = 19
264+
265+let ixWlgInvestFundAmount = 20
266+
267+let ixWlgUserAmAvailNow = 21
268+
269+let ixWlgEffUserTime = 22
270+
271+func getWlgStats2 (userAddrOpt,contracts,usdtId,usdtBalanceCorrection) = {
272+ let issuedAmount = valueOrErrorMessage(getInteger(contracts[dapp2Wlg], wlgIssuedAmtKey), "WLGOLD is not issued yet")
273+ let restUsd = assetBalance(contracts[dapp2Rest], usdtId)
274+ let wlgUsd = (assetBalance(contracts[dapp2Wlg], usdtId) - usdtBalanceCorrection)
275+ let puzzleUsd = assetBalance(contracts[dapp2Puzzle], usdtId)
276+ let investFndContract = contracts[dapp2InvestFund]
277+ let investFundTotal = (assetBalance(investFndContract, usdtId) + valueOrElse(getInteger(investFndContract, zbIssuedAmtKey), 0))
278+ let totalFundsUsd = (wlgUsd + investFundTotal)
279+ let wlgId = valueOrErrorMessage(getBinary(contracts[dapp2Wlg], "wlg_assetId"), "Not initialized yet")
280+ let now = lastBlock.timestamp
281+ let issueTime = valueOrErrorMessage(getInteger(contracts[dapp2Wlg], wlgIssueTimKey), "Not initialized")
282+ let teamTotal = fraction(MILL6, TEAM_SHARE, M6_)
283+ let teamAmountLeft = valueOrElse(getInteger(contracts[dapp2Wlg], teamAmtLeftKey), teamTotal)
284+ let lastTeamTime = valueOrElse(getInteger(contracts[dapp2Wlg], lastTeamTimKey), issueTime)
285+ let teamAddr = addressFromStringValue(value(getString(contracts[dapp2Wlg], teamAdrKey)))
286+ let teamAmountAvailableNow = min([fraction(teamTotal, (now - lastTeamTime), (3 * YEAR_MILLIS)), teamAmountLeft])
287+ let teamWlgold = assetBalance(teamAddr, wlgId)
288+ let actTotal = fraction(MILL6, ACTIVITY_SHARE, M6_)
289+ let actAmountLeft = valueOrElse(getInteger(contracts[dapp2Wlg], actAmtLeftKey), actTotal)
290+ let lastActivitiesTime = valueOrElse(getInteger(contracts[dapp2Wlg], lastActivitiesTimKey), issueTime)
291+ let actAmountAvailableNow = min([fraction(actTotal, (now - lastActivitiesTime), (3 * YEAR_MILLIS)), actAmountLeft])
292+ let actWlgold = assetBalance(contracts[dapp2Rest], wlgId)
293+ let lastUserTime = valueOrElse(getInteger(contracts[dapp2Wlg], keyLastClaimTimeByUser(userAddrOpt)), issueTime)
294+ let lastUserPeriod = ((lastUserTime - issueTime) / YEAR_MILLIS)
295+ let nowLimited = min([now, (issueTime + (3 * YEAR_MILLIS))])
296+ let curPeriod = min([((now - issueTime) / YEAR_MILLIS), 2])
297+ let eff = getFarmingPowers(userAddrOpt, contracts[dapp2Staking])
298+ let curPeriodDistribution = distrByPeriod(curPeriod)
299+ let $t079119 = if ((lastUserPeriod == curPeriod))
300+ then {
301+ let a0 = fraction(curPeriodDistribution, (nowLimited - lastUserTime), YEAR_MILLIS)
302+ let effTime = ((lastUserTime + nowLimited) - lastUserTime)
303+ $Tuple2(a0, effTime)
304+ }
305+ else if ((lastUserPeriod == (curPeriod - 1)))
306+ then {
307+ let a1 = fraction(distrByPeriod((curPeriod - 1)), ((issueTime + (YEAR_MILLIS * curPeriod)) - lastUserTime), YEAR_MILLIS)
308+ let a0 = fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEAR_MILLIS * curPeriod))), YEAR_MILLIS)
309+ let avail = (a1 + a0)
310+ let effTime = if ((a1 >= avail))
311+ then (lastUserTime + fraction(YEAR_MILLIS, avail, distrByPeriod((curPeriod - 1))))
312+ else ((issueTime + (YEAR_MILLIS * curPeriod)) + fraction(YEAR_MILLIS, (avail - a1), curPeriodDistribution))
313+ $Tuple2(avail, effTime)
314+ }
315+ else {
316+ let a2 = fraction(distrByPeriod((curPeriod - 2)), ((issueTime + (YEAR_MILLIS * (curPeriod - 1))) - lastUserTime), YEAR_MILLIS)
317+ let a1 = distrByPeriod((curPeriod - 1))
318+ let a0 = fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEAR_MILLIS * curPeriod))), YEAR_MILLIS)
319+ let avail = ((a2 + a1) + a0)
320+ let effTime = if ((a2 >= avail))
321+ then (lastUserTime + fraction(YEAR_MILLIS, avail, distrByPeriod((curPeriod - 2))))
322+ else if (((a2 + a1) >= avail))
323+ then ((issueTime + (YEAR_MILLIS * (curPeriod - 1))) + fraction(YEAR_MILLIS, (avail - a2), distrByPeriod((curPeriod - 1))))
324+ else ((issueTime + (YEAR_MILLIS * curPeriod)) + fraction(YEAR_MILLIS, ((avail - a2) - a1), curPeriodDistribution))
325+ $Tuple2(avail, effTime)
326+ }
327+ let userAvailable = $t079119._1
328+ let effLastTime = $t079119._2
329+ let amountLeftTotal = valueOrElse(getInteger(contracts[dapp2Wlg], stakersAmtLeftKey), 0)
330+ let unrobbedUser = fraction(userAvailable, eff[idxUserFP], eff[idxTotalFP])
331+[issuedAmount, fraction((totalFundsUsd - USDT_TVL_CORR), M8_, issuedAmount), totalFundsUsd, restUsd, wlgUsd, puzzleUsd, issueTime, lastTeamTime, teamTotal, teamAmountLeft, teamAmountAvailableNow, teamWlgold, actTotal, actAmountLeft, actAmountAvailableNow, actWlgold, curPeriod, amountLeftTotal, curPeriodDistribution, lastUserTime, investFundTotal, unrobbedUser, effLastTime]
130332 }
131333
132334
205407 }
206408
207409
410+
411+@Callable(i)
412+func wlgStatsREADONLY (userAddrOpt) = {
413+ let curStats = getWlgStats2(userAddrOpt, [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0)
414+ $Tuple2(nil, [("%s%d__wlgAmount__" + toString(curStats[ixWlgAmount])), ("%s%d__wlgPrice__" + toString(curStats[ixWlgPrice])), ("%s%d__usdtFunds__" + toString(curStats[ixWlgFunds])), ("%s%d__usdtActivity__" + toString(curStats[ixWlgActivity])), ("%s%d__usdtArbitrage__" + toString(curStats[ixWlgArbitrage])), ("%s%d__usdtPool__" + toString(curStats[ixWlgPool])), ("%s%d__wlgIssueTime__" + toString(curStats[ixWlgIssueTime])), ("%s%d__wlgLastMarketingTeamActTime__" + toString(curStats[ixWlgLastTeamActTime])), ("%s%d__wlgTeamTotal__" + toString(curStats[ixWlgTeamTotal])), ("%s%d__wlgTeamAmLeft__" + toString(curStats[ixWlgTeamAmLeft])), ("%s%d__wlgTeamAmAvailNow__" + toString(curStats[ixWlgTeamAmAvailNow])), ("%s%d__wlgTeamWlgold__" + toString(curStats[ixWlgTeamWlgold])), ("%s%d__wlgActTotal__" + toString(curStats[ixWlgActTotal])), ("%s%d__wlgActAmLeft__" + toString(curStats[ixWlgActAmLeft])), ("%s%d__wlgActAmAvailNow__" + toString(curStats[ixWlgActAmAvailNow])), ("%s%d__wlgActWlgold__" + toString(curStats[ixWlgActWlgold])), ("%s%d__wlgCurPeriod__" + toString(curStats[ixWlgCurPeriod])), ("%s%d__wlgAmLeftTotal__" + toString(curStats[ixWlgAmLeftTotal])), ("%s%d__wlgCurPeriodDistribution__" + toString(curStats[ixWlgCurPeriodDistribution])), ("%s%d__wlgLastUserTime__" + toString(curStats[ixWlgLastUserTime])), ("%s%d__wlgInvestFundTotal__" + toString(curStats[ixWlgInvestFundAmount])), ("%s%d__wlgUserAmAvailNow__" + toString(curStats[ixWlgUserAmAvailNow])), ("%s%d__wlgEffUserTime__" + toString(curStats[ixWlgEffUserTime]))])
415+ }
416+
417+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let chain = take(drop(this.bytes, 1), 1)
7+
8+let usdtAssetId = match chain {
9+ case _ =>
10+ if ((base58'2W' == $match0))
11+ then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
12+ else if ((base58'2T' == $match0))
13+ then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63'
14+ else throw("Unknown chain")
15+}
716
817 let defaultRest2AddressStr = match chain {
918 case _ =>
1019 if ((base58'2W' == $match0))
1120 then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8"
1221 else if ((base58'2T' == $match0))
1322 then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv"
1423 else throw("Unknown chain")
1524 }
1625
1726 let oldStakingContractStr = match chain {
1827 case _ =>
1928 if ((base58'2W' == $match0))
2029 then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1"
2130 else if ((base58'2T' == $match0))
2231 then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm"
2332 else throw("Unknown chain")
2433 }
2534
2635 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
2736
2837
2938 let IdxCfgAcres2Dapp = 1
3039
3140 let IdxCfgWlgDapp = 2
3241
42+let IdxCfgPuzzlePoolDapp = 4
43+
44+let IdxCfgInvestFundDapp = 5
45+
3346 func keyRestCfg () = "%s__restConfig"
3447
3548
3649 func keyRest2Address () = "%s__rest2Addr"
3750
3851
3952 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
4053
4154
4255 func getContractAddressOrFail (rest2Cfg,idx) = valueOrErrorMessage(addressFromString(rest2Cfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
4356
4457
4558 let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr))
4659
4760 let rest2Cfg = readRestCfgOrFail(rest2Contract)
4861
4962 let acres2Contract = getContractAddressOrFail(rest2Cfg, IdxCfgAcres2Dapp)
5063
5164 let wlgContract = getContractAddressOrFail(rest2Cfg, IdxCfgWlgDapp)
65+
66+let puzzlePoolContract = getContractAddressOrFail(rest2Cfg, IdxCfgPuzzlePoolDapp)
67+
68+let investFundContract = getContractAddressOrFail(rest2Cfg, IdxCfgInvestFundDapp)
5269
5370 let oldAcresContractKey = "oldAcresContract"
5471
5572 func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr)
5673
5774
5875 let wlgAssetIdKey = "wlg_assetId"
5976
6077 let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet")
6178
6279 let acresAssetIdKey = "acresAssetId"
6380
6481 let acresAssetId = valueOrErrorMessage(getBinary(acres2Contract, acresAssetIdKey), "ACRES is not issued yet")
6582
6683 func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr)
6784
6885
6986 func keyAddressToCustomName (addr) = ("accountCustomNameByAddr_" + addr)
7087
7188
7289 func keyAddressRefBy (addr) = ("accRefBy_" + addr)
7390
7491
7592 func keyAddressReferrals (addr) = ("accReferrals_" + addr)
7693
7794
7895 func asTuple4Ints (val) = match val {
7996 case t: (Int, Int, Int, Int) =>
8097 t
8198 case _ =>
8299 throw("fail to cast into (Int, Int, Int, Int)")
83100 }
84101
85102
86103 func asTuple3Ints (val) = match val {
87104 case t: (Int, Int, Int) =>
88105 t
89106 case _ =>
90107 throw("fail to cast into (Int, Int, Int)")
91108 }
92109
93110
94111 func asTuple2Ints (val) = match val {
95112 case t: (Int, Int) =>
96113 t
97114 case _ =>
98115 throw("fail to cast into (Int, Int)")
99116 }
100117
101118
119+let M6_ = 1000000
120+
102121 let M8_ = 100000000
122+
123+let MILL6 = 100000000000000
124+
125+let TEAM_SHARE = 200000
126+
127+let ACTIVITY_SHARE = 100000
128+
129+let PLAYER_SHARE = 400000
130+
131+let YEAR_MILLIS = 31557600000
132+
133+let chn = take(drop(this.bytes, 1), 1)
134+
135+let USDT_TVL_CORR = match chn {
136+ case _ =>
137+ if ((base58'2W' == $match0))
138+ then 1208630000
139+ else if ((base58'2T' == $match0))
140+ then 0
141+ else throw("Unknown chain")
142+}
143+
144+let teamAdrKey = "teamAddr"
145+
146+let lastTeamTimKey = "lastClaimedTime_team"
147+
148+let teamAmtLeftKey = "teamAmountLeft"
149+
150+let lastActivitiesTimKey = "lastClaimedTime_activities"
151+
152+let actAmtLeftKey = "activitiesAmountLeft"
153+
154+let stakersAmtLeftKey = "stakersAmountLeft"
155+
156+func keyLastClaimTimeByUser (addr) = ("lastClaimedTimeUser_" + addr)
157+
158+
159+func distrByPeriod (period) = fraction(MILL6, (PLAYER_SHARE * (period + 1)), (6 * M6_))
160+
161+
162+let wlgIssueTimKey = "wlg_issueTime"
163+
164+let wlgIssuedAmtKey = "wlg_issuedAmount"
165+
166+let zbIssuedAmtKey = "zbill_issuedAmount"
103167
104168 func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr)
105169
170+
171+let acresStakdTotalKey = "acresStakedAmountTotal"
172+
173+let dapp2Rest = 0
174+
175+let dapp2Staking = 1
176+
177+let dapp2Wlg = 2
178+
179+let dapp2Puzzle = 3
180+
181+let dapp2InvestFund = 4
106182
107183 let levels = [10, 20, 40, 80, 150, 250, 400, 700, 1000]
108184
109185 func getLevelByAcres (acres) = {
110186 let acr = (acres / M8_)
111187 func checker (acc,item) = if ((item > acr))
112188 then acc
113189 else (acc + 1)
114190
115191 let idx = {
116192 let $l = levels
117193 let $s = size($l)
118194 let $acc0 = 0
119195 func $f0_1 ($a,$i) = if (($i >= $s))
120196 then $a
121197 else checker($a, $l[$i])
122198
123199 func $f0_2 ($a,$i) = if (($i >= $s))
124200 then $a
125201 else throw("List size exceeds 10")
126202
127203 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
128204 }
129205 (idx + 1)
206+ }
207+
208+
209+func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4))
210+
211+
212+func getFarmingPowers (userAddrStrOrEmpty,stakingContract) = {
213+ let totalAcres = valueOrElse(getInteger(stakingContract, acresStakdTotalKey), 0)
214+ let totalFP = getFarmingPowerByAcres(totalAcres)
215+ let userAcres = valueOrElse(getInteger(stakingContract, keyAcresStakedAmtByUser(userAddrStrOrEmpty)), 0)
216+ let userFP = getFarmingPowerByAcres(userAcres)
217+[totalFP, userFP]
218+ }
219+
220+
221+let idxTotalFP = 0
222+
223+let idxUserFP = 1
224+
225+let ixWlgAmount = 0
226+
227+let ixWlgPrice = 1
228+
229+let ixWlgFunds = 2
230+
231+let ixWlgActivity = 3
232+
233+let ixWlgArbitrage = 4
234+
235+let ixWlgPool = 5
236+
237+let ixWlgIssueTime = 6
238+
239+let ixWlgLastTeamActTime = 7
240+
241+let ixWlgTeamTotal = 8
242+
243+let ixWlgTeamAmLeft = 9
244+
245+let ixWlgTeamAmAvailNow = 10
246+
247+let ixWlgTeamWlgold = 11
248+
249+let ixWlgActTotal = 12
250+
251+let ixWlgActAmLeft = 13
252+
253+let ixWlgActAmAvailNow = 14
254+
255+let ixWlgActWlgold = 15
256+
257+let ixWlgCurPeriod = 16
258+
259+let ixWlgAmLeftTotal = 17
260+
261+let ixWlgCurPeriodDistribution = 18
262+
263+let ixWlgLastUserTime = 19
264+
265+let ixWlgInvestFundAmount = 20
266+
267+let ixWlgUserAmAvailNow = 21
268+
269+let ixWlgEffUserTime = 22
270+
271+func getWlgStats2 (userAddrOpt,contracts,usdtId,usdtBalanceCorrection) = {
272+ let issuedAmount = valueOrErrorMessage(getInteger(contracts[dapp2Wlg], wlgIssuedAmtKey), "WLGOLD is not issued yet")
273+ let restUsd = assetBalance(contracts[dapp2Rest], usdtId)
274+ let wlgUsd = (assetBalance(contracts[dapp2Wlg], usdtId) - usdtBalanceCorrection)
275+ let puzzleUsd = assetBalance(contracts[dapp2Puzzle], usdtId)
276+ let investFndContract = contracts[dapp2InvestFund]
277+ let investFundTotal = (assetBalance(investFndContract, usdtId) + valueOrElse(getInteger(investFndContract, zbIssuedAmtKey), 0))
278+ let totalFundsUsd = (wlgUsd + investFundTotal)
279+ let wlgId = valueOrErrorMessage(getBinary(contracts[dapp2Wlg], "wlg_assetId"), "Not initialized yet")
280+ let now = lastBlock.timestamp
281+ let issueTime = valueOrErrorMessage(getInteger(contracts[dapp2Wlg], wlgIssueTimKey), "Not initialized")
282+ let teamTotal = fraction(MILL6, TEAM_SHARE, M6_)
283+ let teamAmountLeft = valueOrElse(getInteger(contracts[dapp2Wlg], teamAmtLeftKey), teamTotal)
284+ let lastTeamTime = valueOrElse(getInteger(contracts[dapp2Wlg], lastTeamTimKey), issueTime)
285+ let teamAddr = addressFromStringValue(value(getString(contracts[dapp2Wlg], teamAdrKey)))
286+ let teamAmountAvailableNow = min([fraction(teamTotal, (now - lastTeamTime), (3 * YEAR_MILLIS)), teamAmountLeft])
287+ let teamWlgold = assetBalance(teamAddr, wlgId)
288+ let actTotal = fraction(MILL6, ACTIVITY_SHARE, M6_)
289+ let actAmountLeft = valueOrElse(getInteger(contracts[dapp2Wlg], actAmtLeftKey), actTotal)
290+ let lastActivitiesTime = valueOrElse(getInteger(contracts[dapp2Wlg], lastActivitiesTimKey), issueTime)
291+ let actAmountAvailableNow = min([fraction(actTotal, (now - lastActivitiesTime), (3 * YEAR_MILLIS)), actAmountLeft])
292+ let actWlgold = assetBalance(contracts[dapp2Rest], wlgId)
293+ let lastUserTime = valueOrElse(getInteger(contracts[dapp2Wlg], keyLastClaimTimeByUser(userAddrOpt)), issueTime)
294+ let lastUserPeriod = ((lastUserTime - issueTime) / YEAR_MILLIS)
295+ let nowLimited = min([now, (issueTime + (3 * YEAR_MILLIS))])
296+ let curPeriod = min([((now - issueTime) / YEAR_MILLIS), 2])
297+ let eff = getFarmingPowers(userAddrOpt, contracts[dapp2Staking])
298+ let curPeriodDistribution = distrByPeriod(curPeriod)
299+ let $t079119 = if ((lastUserPeriod == curPeriod))
300+ then {
301+ let a0 = fraction(curPeriodDistribution, (nowLimited - lastUserTime), YEAR_MILLIS)
302+ let effTime = ((lastUserTime + nowLimited) - lastUserTime)
303+ $Tuple2(a0, effTime)
304+ }
305+ else if ((lastUserPeriod == (curPeriod - 1)))
306+ then {
307+ let a1 = fraction(distrByPeriod((curPeriod - 1)), ((issueTime + (YEAR_MILLIS * curPeriod)) - lastUserTime), YEAR_MILLIS)
308+ let a0 = fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEAR_MILLIS * curPeriod))), YEAR_MILLIS)
309+ let avail = (a1 + a0)
310+ let effTime = if ((a1 >= avail))
311+ then (lastUserTime + fraction(YEAR_MILLIS, avail, distrByPeriod((curPeriod - 1))))
312+ else ((issueTime + (YEAR_MILLIS * curPeriod)) + fraction(YEAR_MILLIS, (avail - a1), curPeriodDistribution))
313+ $Tuple2(avail, effTime)
314+ }
315+ else {
316+ let a2 = fraction(distrByPeriod((curPeriod - 2)), ((issueTime + (YEAR_MILLIS * (curPeriod - 1))) - lastUserTime), YEAR_MILLIS)
317+ let a1 = distrByPeriod((curPeriod - 1))
318+ let a0 = fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEAR_MILLIS * curPeriod))), YEAR_MILLIS)
319+ let avail = ((a2 + a1) + a0)
320+ let effTime = if ((a2 >= avail))
321+ then (lastUserTime + fraction(YEAR_MILLIS, avail, distrByPeriod((curPeriod - 2))))
322+ else if (((a2 + a1) >= avail))
323+ then ((issueTime + (YEAR_MILLIS * (curPeriod - 1))) + fraction(YEAR_MILLIS, (avail - a2), distrByPeriod((curPeriod - 1))))
324+ else ((issueTime + (YEAR_MILLIS * curPeriod)) + fraction(YEAR_MILLIS, ((avail - a2) - a1), curPeriodDistribution))
325+ $Tuple2(avail, effTime)
326+ }
327+ let userAvailable = $t079119._1
328+ let effLastTime = $t079119._2
329+ let amountLeftTotal = valueOrElse(getInteger(contracts[dapp2Wlg], stakersAmtLeftKey), 0)
330+ let unrobbedUser = fraction(userAvailable, eff[idxUserFP], eff[idxTotalFP])
331+[issuedAmount, fraction((totalFundsUsd - USDT_TVL_CORR), M8_, issuedAmount), totalFundsUsd, restUsd, wlgUsd, puzzleUsd, issueTime, lastTeamTime, teamTotal, teamAmountLeft, teamAmountAvailableNow, teamWlgold, actTotal, actAmountLeft, actAmountAvailableNow, actWlgold, curPeriod, amountLeftTotal, curPeriodDistribution, lastUserTime, investFundTotal, unrobbedUser, effLastTime]
130332 }
131333
132334
133335 func walletInternal (userAddressOpt) = {
134336 let addr = addressFromString(userAddressOpt)
135337 let balance = if (isDefined(addr))
136338 then wavesBalance(value(addr))
137339 else BalanceDetails(0, 0, 0, 0)
138340 let wlgoldBalance = if (isDefined(addr))
139341 then assetBalance(value(addr), wlgAssetId)
140342 else 0
141343 let customName = valueOrElse(getString(acres2Contract, keyAddressToCustomName(userAddressOpt)), userAddressOpt)
142344 let refByKey = keyAddressRefBy(userAddressOpt)
143345 let refBy = getString(acres2Contract, refByKey)
144346 let refs = valueOrElse(getString(acres2Contract, keyAddressReferrals(userAddressOpt)), "")
145347 let lastTxId = valueOrElse(getString(acres2Contract, keyLastTxIdByUser(userAddressOpt)), "")
146348 let acresBalance = if (isDefined(addr))
147349 then assetBalance(value(addr), acresAssetId)
148350 else 0
149351 let stakedAcres = valueOrElse(getInteger(acres2Contract, keyAcresStakedAmtByUser(userAddressOpt)), 0)
150352 let lvl = getLevelByAcres(acresBalance)
151353 [("%s%s__customName__" + customName), ("%s%s__referredBy__" + valueOrElse(refBy, "")), ("%s%s__referrals__" + refs), ("%s%s__lastTxId__" + lastTxId), ("%s%d__wavesBalance__" + toString(balance.available)), ("%s%d__wlgoldBalance__" + toString(wlgoldBalance)), ("%s%d__acresBalance__" + toString(acresBalance)), ("%s%d__stakedAcres__" + toString(stakedAcres)), ("%s%d__currentLvl__" + toString(lvl))]
152354 }
153355
154356
155357 @Callable(i)
156358 func constructorV1 (contracts) = if ((i.caller != this))
157359 then throw("permissions denied")
158360 else {
159361 func descriptor (acc,ignoredItem) = (acc + "%s")
160362
161363 let descr = {
162364 let $l = contracts
163365 let $s = size($l)
164366 let $acc0 = ""
165367 func $f0_1 ($a,$i) = if (($i >= $s))
166368 then $a
167369 else descriptor($a, $l[$i])
168370
169371 func $f0_2 ($a,$i) = if (($i >= $s))
170372 then $a
171373 else throw("List size exceeds 10")
172374
173375 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
174376 }
175377 [StringEntry(keyRestCfg(), makeString(descr :: contracts, SEP)), StringEntry(keyRest2Address(), toString(this))]
176378 }
177379
178380
179381
180382 @Callable(i)
181383 func walletInfoREADONLY (userAddressOpt) = $Tuple2(nil, walletInternal(userAddressOpt))
182384
183385
184386
185387 @Callable(i)
186388 func conversionInfoREADONLY (userAddressOpt) = {
187389 let oldAcresAddress = addressFromStringValue(getStringValue(acres2Contract, oldAcresContractKey))
188390 let $t040504172 = asTuple2Ints(invoke(oldAcresAddress, "unstakeAllAcresREADONLY", [userAddressOpt], nil))
189391 let unstakedAcres = $t040504172._1
190392 let claimedAcres = $t040504172._2
191393 let $t041754324 = asTuple4Ints(invoke(acres2Contract, "unstakeLandsREADONLY", [userAddressOpt], nil))
192394 let acresFromPieces = $t041754324._1
193395 let acresFromRes = $t041754324._2
194396 let acresFromMat = $t041754324._3
195397 let acresFromProd = $t041754324._4
196398 let oldStakingAddress = addressFromStringValue(oldStakingContractStr)
197399 let duckAssetId = valueOrElse(getString(oldStakingAddress, keyStakedDuckByOwner(userAddressOpt)), "")
198400 let $t045024724 = if ((duckAssetId != ""))
199401 then asTuple3Ints(invoke(oldStakingAddress, "unstakeDuckREADONLY", [duckAssetId, userAddressOpt], nil))
200402 else $Tuple3(0, 0, 0)
201403 let acresFromDuckRes = $t045024724._1
202404 let acresFromDuckMat = $t045024724._2
203405 let acresFromDuckProd = $t045024724._3
204406 $Tuple2(nil, [("%s%d__unstakedAcres__" + toString(unstakedAcres)), ("%s%d__claimedAcres__" + toString(claimedAcres)), ("%s%d__acresFromPieces__" + toString(acresFromPieces)), ("%s%d__acresFromRes__" + toString(acresFromRes)), ("%s%d__acresFromMat__" + toString(acresFromMat)), ("%s%d__acresFromProd__" + toString(acresFromProd)), ("%s%d__acresFromDuckRes__" + toString(acresFromDuckRes)), ("%s%d__acresFromDuckMat__" + toString(acresFromDuckMat)), ("%s%d__acresFromDuckProd__" + toString(acresFromDuckProd))])
205407 }
206408
207409
410+
411+@Callable(i)
412+func wlgStatsREADONLY (userAddrOpt) = {
413+ let curStats = getWlgStats2(userAddrOpt, [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0)
414+ $Tuple2(nil, [("%s%d__wlgAmount__" + toString(curStats[ixWlgAmount])), ("%s%d__wlgPrice__" + toString(curStats[ixWlgPrice])), ("%s%d__usdtFunds__" + toString(curStats[ixWlgFunds])), ("%s%d__usdtActivity__" + toString(curStats[ixWlgActivity])), ("%s%d__usdtArbitrage__" + toString(curStats[ixWlgArbitrage])), ("%s%d__usdtPool__" + toString(curStats[ixWlgPool])), ("%s%d__wlgIssueTime__" + toString(curStats[ixWlgIssueTime])), ("%s%d__wlgLastMarketingTeamActTime__" + toString(curStats[ixWlgLastTeamActTime])), ("%s%d__wlgTeamTotal__" + toString(curStats[ixWlgTeamTotal])), ("%s%d__wlgTeamAmLeft__" + toString(curStats[ixWlgTeamAmLeft])), ("%s%d__wlgTeamAmAvailNow__" + toString(curStats[ixWlgTeamAmAvailNow])), ("%s%d__wlgTeamWlgold__" + toString(curStats[ixWlgTeamWlgold])), ("%s%d__wlgActTotal__" + toString(curStats[ixWlgActTotal])), ("%s%d__wlgActAmLeft__" + toString(curStats[ixWlgActAmLeft])), ("%s%d__wlgActAmAvailNow__" + toString(curStats[ixWlgActAmAvailNow])), ("%s%d__wlgActWlgold__" + toString(curStats[ixWlgActWlgold])), ("%s%d__wlgCurPeriod__" + toString(curStats[ixWlgCurPeriod])), ("%s%d__wlgAmLeftTotal__" + toString(curStats[ixWlgAmLeftTotal])), ("%s%d__wlgCurPeriodDistribution__" + toString(curStats[ixWlgCurPeriodDistribution])), ("%s%d__wlgLastUserTime__" + toString(curStats[ixWlgLastUserTime])), ("%s%d__wlgInvestFundTotal__" + toString(curStats[ixWlgInvestFundAmount])), ("%s%d__wlgUserAmAvailNow__" + toString(curStats[ixWlgUserAmAvailNow])), ("%s%d__wlgEffUserTime__" + toString(curStats[ixWlgEffUserTime]))])
415+ }
416+
417+

github/deemru/w8io/169f3d6 
51.35 ms