tx · 6QoWLHuwmreHtGSqvVqffhK3ycJ1mAynKFhPt2eA5Yt

3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv:  -0.00600000 Waves

2024.09.12 20:47 [3280734] smart account 3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv > SELF 0.00000000 Waves

{ "type": 13, "id": "6QoWLHuwmreHtGSqvVqffhK3ycJ1mAynKFhPt2eA5Yt", "fee": 600000, "feeAssetId": null, "timestamp": 1726163253745, "version": 2, "chainId": 84, "sender": "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv", "senderPublicKey": "2fNSk5gmWbXBDTkSYSKd66xSgVvAYzrJnP9YSAFNvTwC", "proofs": [ "aaPGsJ55V8Np44saEv8aUDUycFAaGqt6mej7ct7jG25cDcYaL797R5N8qbexEu1mTuGohsKtGpZHhheCkdM6htQ" ], "script": "base64:BgIRCAISAwoBGBIDCgEIEgMKAQghAANTRVACAl9fAAVjaGFpbgkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQAWZGVmYXVsdFJlc3QyQWRkcmVzc1N0cgQHJG1hdGNoMAUFY2hhaW4DCQAAAgEBVwUHJG1hdGNoMAIjM1BGd1l0YThiaUV6MzF6cGVGZTVESks4d0U1dHJTcFFWRjgDCQAAAgEBVAUHJG1hdGNoMAIjM043VXVZYXI2MjY0UDU4RkJoVldLUFFBaDRZdWEyaGduZ3YJAAIBAg1Vbmtub3duIGNoYWluABVvbGRTdGFraW5nQ29udHJhY3RTdHIEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDACIzNQTG5jWHRTMVU4M0Q2Y1FiRkQzSDhyQkhQTGd6eFNGS1oxAwkAAAIBAVQFByRtYXRjaDACIzNOREN5Qkc1cTg1SnVhUmlpZ1VlRXRhaW55akNRVDNYcFptCQACAQINVW5rbm93biBjaGFpbgEPZ2V0U3RyaW5nT3JGYWlsAgdhZGRyZXNzA2tleQkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCdCAIF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3gfYDFdrUW1uLVVzQGXZcsbNPymDn9WVSZMztvZ Diff:
OldNewDifferences
184184
185185 @Callable(i)
186186 func conversionInfoREADONLY (userAddressOpt) = {
187- let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey))
188- let $t040354157 = asTuple2Ints(invoke(oldAcresAddress, "unstakeAllAcresREADONLY", [userAddressOpt], nil))
189- let unstakedAcres = $t040354157._1
190- let claimedAcres = $t040354157._2
191- let $t041604309 = asTuple4Ints(invoke(acres2Contract, "unstakeLandsREADONLY", [userAddressOpt], nil))
192- let acresFromPieces = $t041604309._1
193- let acresFromRes = $t041604309._2
194- let acresFromMat = $t041604309._3
195- let acresFromProd = $t041604309._4
187+ let oldAcresAddress = addressFromStringValue(getStringValue(acres2Contract, oldAcresContractKey))
188+ let $t040504172 = asTuple2Ints(invoke(oldAcresAddress, "unstakeAllAcresREADONLY", [userAddressOpt], nil))
189+ let unstakedAcres = $t040504172._1
190+ let claimedAcres = $t040504172._2
191+ let $t041754324 = asTuple4Ints(invoke(acres2Contract, "unstakeLandsREADONLY", [userAddressOpt], nil))
192+ let acresFromPieces = $t041754324._1
193+ let acresFromRes = $t041754324._2
194+ let acresFromMat = $t041754324._3
195+ let acresFromProd = $t041754324._4
196196 let oldStakingAddress = addressFromStringValue(oldStakingContractStr)
197197 let duckAssetId = valueOrElse(getString(oldStakingAddress, keyStakedDuckByOwner(userAddressOpt)), "")
198- let $t044874709 = if ((duckAssetId != ""))
198+ let $t045024724 = if ((duckAssetId != ""))
199199 then asTuple3Ints(invoke(oldStakingAddress, "unstakeDuckREADONLY", [duckAssetId, userAddressOpt], nil))
200200 else $Tuple3(0, 0, 0)
201- let acresFromDuckRes = $t044874709._1
202- let acresFromDuckMat = $t044874709._2
203- let acresFromDuckProd = $t044874709._3
201+ let acresFromDuckRes = $t045024724._1
202+ let acresFromDuckMat = $t045024724._2
203+ let acresFromDuckProd = $t045024724._3
204204 $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))])
205205 }
206206
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)
77
88 let defaultRest2AddressStr = match chain {
99 case _ =>
1010 if ((base58'2W' == $match0))
1111 then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8"
1212 else if ((base58'2T' == $match0))
1313 then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv"
1414 else throw("Unknown chain")
1515 }
1616
1717 let oldStakingContractStr = match chain {
1818 case _ =>
1919 if ((base58'2W' == $match0))
2020 then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1"
2121 else if ((base58'2T' == $match0))
2222 then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm"
2323 else throw("Unknown chain")
2424 }
2525
2626 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
2727
2828
2929 let IdxCfgAcres2Dapp = 1
3030
3131 let IdxCfgWlgDapp = 2
3232
3333 func keyRestCfg () = "%s__restConfig"
3434
3535
3636 func keyRest2Address () = "%s__rest2Addr"
3737
3838
3939 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
4040
4141
4242 func getContractAddressOrFail (rest2Cfg,idx) = valueOrErrorMessage(addressFromString(rest2Cfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
4343
4444
4545 let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr))
4646
4747 let rest2Cfg = readRestCfgOrFail(rest2Contract)
4848
4949 let acres2Contract = getContractAddressOrFail(rest2Cfg, IdxCfgAcres2Dapp)
5050
5151 let wlgContract = getContractAddressOrFail(rest2Cfg, IdxCfgWlgDapp)
5252
5353 let oldAcresContractKey = "oldAcresContract"
5454
5555 func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr)
5656
5757
5858 let wlgAssetIdKey = "wlg_assetId"
5959
6060 let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet")
6161
6262 let acresAssetIdKey = "acresAssetId"
6363
6464 let acresAssetId = valueOrErrorMessage(getBinary(acres2Contract, acresAssetIdKey), "ACRES is not issued yet")
6565
6666 func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr)
6767
6868
6969 func keyAddressToCustomName (addr) = ("accountCustomNameByAddr_" + addr)
7070
7171
7272 func keyAddressRefBy (addr) = ("accRefBy_" + addr)
7373
7474
7575 func keyAddressReferrals (addr) = ("accReferrals_" + addr)
7676
7777
7878 func asTuple4Ints (val) = match val {
7979 case t: (Int, Int, Int, Int) =>
8080 t
8181 case _ =>
8282 throw("fail to cast into (Int, Int, Int, Int)")
8383 }
8484
8585
8686 func asTuple3Ints (val) = match val {
8787 case t: (Int, Int, Int) =>
8888 t
8989 case _ =>
9090 throw("fail to cast into (Int, Int, Int)")
9191 }
9292
9393
9494 func asTuple2Ints (val) = match val {
9595 case t: (Int, Int) =>
9696 t
9797 case _ =>
9898 throw("fail to cast into (Int, Int)")
9999 }
100100
101101
102102 let M8_ = 100000000
103103
104104 func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr)
105105
106106
107107 let levels = [10, 20, 40, 80, 150, 250, 400, 700, 1000]
108108
109109 func getLevelByAcres (acres) = {
110110 let acr = (acres / M8_)
111111 func checker (acc,item) = if ((item > acr))
112112 then acc
113113 else (acc + 1)
114114
115115 let idx = {
116116 let $l = levels
117117 let $s = size($l)
118118 let $acc0 = 0
119119 func $f0_1 ($a,$i) = if (($i >= $s))
120120 then $a
121121 else checker($a, $l[$i])
122122
123123 func $f0_2 ($a,$i) = if (($i >= $s))
124124 then $a
125125 else throw("List size exceeds 10")
126126
127127 $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)
128128 }
129129 (idx + 1)
130130 }
131131
132132
133133 func walletInternal (userAddressOpt) = {
134134 let addr = addressFromString(userAddressOpt)
135135 let balance = if (isDefined(addr))
136136 then wavesBalance(value(addr))
137137 else BalanceDetails(0, 0, 0, 0)
138138 let wlgoldBalance = if (isDefined(addr))
139139 then assetBalance(value(addr), wlgAssetId)
140140 else 0
141141 let customName = valueOrElse(getString(acres2Contract, keyAddressToCustomName(userAddressOpt)), userAddressOpt)
142142 let refByKey = keyAddressRefBy(userAddressOpt)
143143 let refBy = getString(acres2Contract, refByKey)
144144 let refs = valueOrElse(getString(acres2Contract, keyAddressReferrals(userAddressOpt)), "")
145145 let lastTxId = valueOrElse(getString(acres2Contract, keyLastTxIdByUser(userAddressOpt)), "")
146146 let acresBalance = if (isDefined(addr))
147147 then assetBalance(value(addr), acresAssetId)
148148 else 0
149149 let stakedAcres = valueOrElse(getInteger(acres2Contract, keyAcresStakedAmtByUser(userAddressOpt)), 0)
150150 let lvl = getLevelByAcres(acresBalance)
151151 [("%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))]
152152 }
153153
154154
155155 @Callable(i)
156156 func constructorV1 (contracts) = if ((i.caller != this))
157157 then throw("permissions denied")
158158 else {
159159 func descriptor (acc,ignoredItem) = (acc + "%s")
160160
161161 let descr = {
162162 let $l = contracts
163163 let $s = size($l)
164164 let $acc0 = ""
165165 func $f0_1 ($a,$i) = if (($i >= $s))
166166 then $a
167167 else descriptor($a, $l[$i])
168168
169169 func $f0_2 ($a,$i) = if (($i >= $s))
170170 then $a
171171 else throw("List size exceeds 10")
172172
173173 $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)
174174 }
175175 [StringEntry(keyRestCfg(), makeString(descr :: contracts, SEP)), StringEntry(keyRest2Address(), toString(this))]
176176 }
177177
178178
179179
180180 @Callable(i)
181181 func walletInfoREADONLY (userAddressOpt) = $Tuple2(nil, walletInternal(userAddressOpt))
182182
183183
184184
185185 @Callable(i)
186186 func conversionInfoREADONLY (userAddressOpt) = {
187- let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey))
188- let $t040354157 = asTuple2Ints(invoke(oldAcresAddress, "unstakeAllAcresREADONLY", [userAddressOpt], nil))
189- let unstakedAcres = $t040354157._1
190- let claimedAcres = $t040354157._2
191- let $t041604309 = asTuple4Ints(invoke(acres2Contract, "unstakeLandsREADONLY", [userAddressOpt], nil))
192- let acresFromPieces = $t041604309._1
193- let acresFromRes = $t041604309._2
194- let acresFromMat = $t041604309._3
195- let acresFromProd = $t041604309._4
187+ let oldAcresAddress = addressFromStringValue(getStringValue(acres2Contract, oldAcresContractKey))
188+ let $t040504172 = asTuple2Ints(invoke(oldAcresAddress, "unstakeAllAcresREADONLY", [userAddressOpt], nil))
189+ let unstakedAcres = $t040504172._1
190+ let claimedAcres = $t040504172._2
191+ let $t041754324 = asTuple4Ints(invoke(acres2Contract, "unstakeLandsREADONLY", [userAddressOpt], nil))
192+ let acresFromPieces = $t041754324._1
193+ let acresFromRes = $t041754324._2
194+ let acresFromMat = $t041754324._3
195+ let acresFromProd = $t041754324._4
196196 let oldStakingAddress = addressFromStringValue(oldStakingContractStr)
197197 let duckAssetId = valueOrElse(getString(oldStakingAddress, keyStakedDuckByOwner(userAddressOpt)), "")
198- let $t044874709 = if ((duckAssetId != ""))
198+ let $t045024724 = if ((duckAssetId != ""))
199199 then asTuple3Ints(invoke(oldStakingAddress, "unstakeDuckREADONLY", [duckAssetId, userAddressOpt], nil))
200200 else $Tuple3(0, 0, 0)
201- let acresFromDuckRes = $t044874709._1
202- let acresFromDuckMat = $t044874709._2
203- let acresFromDuckProd = $t044874709._3
201+ let acresFromDuckRes = $t045024724._1
202+ let acresFromDuckMat = $t045024724._2
203+ let acresFromDuckProd = $t045024724._3
204204 $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))])
205205 }
206206
207207

github/deemru/w8io/169f3d6 
103.59 ms