tx · 6Fsf4AyN7k7jZsBU6N3xK5o4xTobqC8gFWEDqCM1oMfM

3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy:  -0.01000000 Waves

2023.01.19 13:42 [2411705] smart account 3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy > SELF 0.00000000 Waves

{ "type": 13, "id": "6Fsf4AyN7k7jZsBU6N3xK5o4xTobqC8gFWEDqCM1oMfM", "fee": 1000000, "feeAssetId": null, "timestamp": 1674124971583, "version": 2, "chainId": 84, "sender": "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy", "senderPublicKey": "C3PaRKeL8AUKbwUqdniMQtThgcTh5DYHV1777Hkxy7rp", "proofs": [ "2QRbfY7nuftiDhCpEPN4RNN3TMv3yj31Ghtv9DS2i7a7J1SVd939bhfiJjYgWitCKZ5GzqQwV1K8eyvonbrGG3L5" ], "script": "base64:BgITCAISAwoBCBIECgIICBIECgIICCQABWNoYWluCQDJAQIJAMoBAggFBHRoaXMFYnl0ZXMAAQABAAt1c2RuQXNzZXRJZAQHJG1hdGNoMAUFY2hhaW4DCQAAAgEBVwUHJG1hdGNoMAEgtiYpwwT1zlORpA5LdSQvZIxRsfrfr1QpvUjSHSqyqtEDCQAAAgEBVAUHJG1hdGNoMAEg93bq9/eDymXbbhPuAjvPWCmVqcHRjfJL2mzYHWKAyN4JAAIBAg1Vbmtub3duIGNoYWluAA9lY29ub215Q29udHJhY3QJARFAZXh0ck5hdGl2ZSgxMDYyKQEEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDACIzNQMnNrMUtuY1N4UmFaczhiNENXR1B3MmprdnZhdjc0dTREAwkAAAIBAVQFByRtYXRjaDACIzNOOHk0d3hYM0pDNFRkckNKQlhYMTZTaldmNlgyNTZocmVwCQACAQINVW5rbm93biBjaGFpbgAPc3Rha2luZ0NvbnRyYWN0CQERQGV4dHJOYXRpdmUoMTA2MikBBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y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9fCQCkAwEIBQxwcm9kdWN0aXZpdHkCXzEJAMwIAgkAuQkCCQDMCAICBCVzJXMJAMwIAgINbGFuZEFydGVmYWN0cwkAzAgCCQCsAgICCFBSRVNBTEU6CQCkAwEIBQxwcm9kdWN0aXZpdHkCXzIFA25pbAUDU0VQCQDMCAIJAKwCAgIQJXMlc19fYXZhaWxSZXNfXwUGcmVzU3RyCQDMCAIJAKwCAgIUJXMlc19fbmVlZE1hdGVyaWFsX18FCm5lZWRNYXRTdHIJAMwIAgkArAICAhMlcyVzX19kdWNrQXNzZXRJZF9fCAUIZHVja0luZm8CXzEJAMwIAgkArAICAhAlcyVzX19sb2NhdGlvbl9fCAUIZHVja0luZm8CXzIJAMwIAgkArAICAg4lcyVkX19oZWFsdGhfXwkApAMBCAUIZHVja0luZm8CXzMJAMwIAgkArAICAhAlcyVzX19iYWNrUGFja19fCAUIZHVja0luZm8CXzQJAMwIAgkAuQkCCQDMCAICBiVzJWQlZAkAzAgCAgZ3YWxsZXQJAMwIAgkApAMBCQCRAwIFCGJhbGFuY2VzAAAJAMwIAgkApAMBCQCRAwIFCGJhbGFuY2VzAAEFA25pbAUDU0VQBQNuaWwArQG37A==", "height": 2411705, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5KcT4xXUZVYQvXbnho3Vpc9Qt8aJnW7u3fDe8r8y7Ch6 Next: CNjDxuPevRC6iUYR6Ym6yWH57kkKV7NWCpwpCpgSF6mF Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let chain = toUtf8String(take(drop(this.bytes, 1), 1))
4+let chain = take(drop(this.bytes, 1), 1)
55
66 let usdnAssetId = match chain {
77 case _ =>
8- if (("W" == $match0))
8+ if ((base58'2W' == $match0))
99 then base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p'
10- else if (("T" == $match0))
10+ else if ((base58'2T' == $match0))
1111 then base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ'
1212 else throw("Unknown chain")
1313 }
1414
1515 let economyContract = addressFromStringValue(match chain {
1616 case _ =>
17- if (("W" == $match0))
17+ if ((base58'2W' == $match0))
1818 then "3P2sk1KncSxRaZs8b4CWGPw2jkvvav74u4D"
19- else if (("T" == $match0))
19+ else if ((base58'2T' == $match0))
2020 then "3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep"
2121 else throw("Unknown chain")
2222 })
2323
2424 let stakingContract = addressFromStringValue(match chain {
2525 case _ =>
26- if (("W" == $match0))
26+ if ((base58'2W' == $match0))
2727 then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1"
28- else if (("T" == $match0))
28+ else if ((base58'2T' == $match0))
2929 then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm"
3030 else throw("Unknown chain")
3131 })
3232
3333 let InfraUpgradeCostS = match chain {
3434 case _ =>
35- if (("W" == $match0))
35+ if ((base58'2W' == $match0))
3636 then 6307198406
37- else if (("T" == $match0))
37+ else if ((base58'2T' == $match0))
3838 then 63071984
3939 else throw("Unknown chain")
4040 }
241241 }
242242 else $Tuple4("", "", -1, "")
243243 let balances = walletInternal(userAddressOpt)
244- $Tuple2(nil, [("%s%d__stakedTime__" + toString(stakedTime)), ("%s%s__owner__" + owner), ("%s%s__description__" + descr), ("%s%d__infraLevel__" + toString(productivity._1)), ("%s%d__artPieces__" + toString(productivity._2)), ("%s%s__availRes__" + resStr), ("%s%s__needMaterial__" + needMatStr), ("%s%s__duckAssetId__" + duckInfo._1), ("%s%s__location__" + duckInfo._2), ("%s%d__health__" + toString(duckInfo._3)), ("%s%s__backPack__" + duckInfo._4), makeString(["%s%d%d", "wallet", toString(balances[0]), toString(balances[1])], SEP)])
244+ $Tuple2(nil, [("%s%d__stakedTime__" + toString(stakedTime)), ("%s%s__owner__" + owner), ("%s%s__description__" + descr), ("%s%d__infraLevel__" + toString(productivity._1)), makeString(["%s%s", "landArtefacts", ("PRESALE:" + toString(productivity._2))], SEP), ("%s%s__availRes__" + resStr), ("%s%s__needMaterial__" + needMatStr), ("%s%s__duckAssetId__" + duckInfo._1), ("%s%s__location__" + duckInfo._2), ("%s%d__health__" + toString(duckInfo._3)), ("%s%s__backPack__" + duckInfo._4), makeString(["%s%d%d", "wallet", toString(balances[0]), toString(balances[1])], SEP)])
245245 }
246246 }
247247
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let chain = toUtf8String(take(drop(this.bytes, 1), 1))
4+let chain = take(drop(this.bytes, 1), 1)
55
66 let usdnAssetId = match chain {
77 case _ =>
8- if (("W" == $match0))
8+ if ((base58'2W' == $match0))
99 then base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p'
10- else if (("T" == $match0))
10+ else if ((base58'2T' == $match0))
1111 then base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ'
1212 else throw("Unknown chain")
1313 }
1414
1515 let economyContract = addressFromStringValue(match chain {
1616 case _ =>
17- if (("W" == $match0))
17+ if ((base58'2W' == $match0))
1818 then "3P2sk1KncSxRaZs8b4CWGPw2jkvvav74u4D"
19- else if (("T" == $match0))
19+ else if ((base58'2T' == $match0))
2020 then "3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep"
2121 else throw("Unknown chain")
2222 })
2323
2424 let stakingContract = addressFromStringValue(match chain {
2525 case _ =>
26- if (("W" == $match0))
26+ if ((base58'2W' == $match0))
2727 then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1"
28- else if (("T" == $match0))
28+ else if ((base58'2T' == $match0))
2929 then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm"
3030 else throw("Unknown chain")
3131 })
3232
3333 let InfraUpgradeCostS = match chain {
3434 case _ =>
35- if (("W" == $match0))
35+ if ((base58'2W' == $match0))
3636 then 6307198406
37- else if (("T" == $match0))
37+ else if ((base58'2T' == $match0))
3838 then 63071984
3939 else throw("Unknown chain")
4040 }
4141
4242 let LANDPREFIX = "LAND"
4343
4444 let DUCKPREFIX = "DUCK"
4545
4646 let SEP = "__"
4747
4848 let ARTPRESALE = "PRESALE"
4949
5050 let DAILYRESBYPIECE = 3456000
5151
5252 let DAYMILLIS = 86400000
5353
5454 let NUMRES = 6
5555
5656 let SSIZE = 25
5757
5858 let MSIZE = 100
5959
6060 let LSIZE = 225
6161
6262 let XLSIZE = 400
6363
6464 let XXLSIZE = 625
6565
6666 let recLandNum = 0
6767
6868 let recLandSize = 1
6969
7070 let recTerrains = 2
7171
7272 let recContinent = 3
7373
7474 func keyDuckIdToOwner (assetId) = ("duckOwner_" + assetId)
7575
7676
7777 func keyStakedTimeByAssetId (assetId) = ("stakedTime_" + assetId)
7878
7979
8080 func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr)
8181
8282
8383 func keyStakedTimeByTypeAssetIdAndOwner (nftType,assetId,ownerAddr) = ((((("stakedTimeByTypeAssetIdAndOwner_" + nftType) + "_") + assetId) + "_") + ownerAddr)
8484
8585
8686 func keyBackpackByDuck (duckAssetId) = ("backPack_" + duckAssetId)
8787
8888
8989 func keyDuckLocation (duckAssetId) = ("duckLocation_" + duckAssetId)
9090
9191
9292 func keyDuckHealth (duckAssetId) = ("duckHealth_" + duckAssetId)
9393
9494
9595 func keyLandAssetIdToOwner (assetId) = ("nftOwner_" + assetId)
9696
9797
9898 func keyInfraLevelByAssetId (assetId) = ("infraLevel_" + assetId)
9999
100100
101101 func keyLandArtStatusByTypeAndAssetId (type,assetId) = makeString(["landArtStatus", type, assetId], "_")
102102
103103
104104 func keyPresaleArtActivatedByAssetId (assetId) = ("presaleArtActivated_" + assetId)
105105
106106
107107 func asListIntCompacted (val) = match val {
108108 case valAnyList: List[Any] =>
109109 if ((size(valAnyList) != NUMRES))
110110 then throw(("Array size is " + toString(size(valAnyList))))
111111 else {
112112 func conv (acc,item) = match item {
113113 case it: Int =>
114114 (acc :+ toString(it))
115115 case _ =>
116116 throw("List type is not Int")
117117 }
118118
119119 let r = {
120120 let $l = valAnyList
121121 let $s = size($l)
122122 let $acc0 = nil
123123 func $f0_1 ($a,$i) = if (($i >= $s))
124124 then $a
125125 else conv($a, $l[$i])
126126
127127 func $f0_2 ($a,$i) = if (($i >= $s))
128128 then $a
129129 else throw("List size exceeds 6")
130130
131131 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
132132 }
133133 makeString(r, "_")
134134 }
135135 case _ =>
136136 throw("fail to cast into List")
137137 }
138138
139139
140140 func walletInternal (userAddressOpt) = {
141141 let addr = addressFromString(userAddressOpt)
142142 let balance = if (isDefined(addr))
143143 then wavesBalance(value(addr))
144144 else BalanceDetails(0, 0, 0, 0)
145145 let usdnBalance = if (isDefined(addr))
146146 then assetBalance(value(addr), usdnAssetId)
147147 else 0
148148 [balance.available, usdnBalance]
149149 }
150150
151151
152152 func applyBonuses (landAssetId,pieces) = {
153153 let infraLevel = valueOrElse(getInteger(stakingContract, keyInfraLevelByAssetId(landAssetId)), 0)
154154 let artPieces = valueOrElse(getInteger(stakingContract, keyLandArtStatusByTypeAndAssetId(ARTPRESALE, landAssetId)), if (valueOrElse(getBoolean(stakingContract, keyPresaleArtActivatedByAssetId(landAssetId)), false))
155155 then pieces
156156 else 0)
157157 $Tuple3(infraLevel, artPieces, ((DAILYRESBYPIECE + fraction(DAILYRESBYPIECE, infraLevel, 4)) + fraction(DAILYRESBYPIECE, (artPieces * 3), (pieces * 20))))
158158 }
159159
160160
161161 func numPiecesBySize (landSize) = match landSize {
162162 case _ =>
163163 if (("S" == $match0))
164164 then SSIZE
165165 else if (("M" == $match0))
166166 then MSIZE
167167 else if (("L" == $match0))
168168 then LSIZE
169169 else if (("XL" == $match0))
170170 then XLSIZE
171171 else if (("XXL" == $match0))
172172 then XXLSIZE
173173 else throw("Unknown land size")
174174 }
175175
176176
177177 @Callable(i)
178178 func walletInfoREADONLY (userAddressOpt) = {
179179 let balances = walletInternal(userAddressOpt)
180180 $Tuple2(nil, makeString(["%s%d%d", "wallet", toString(balances[0]), toString(balances[1])], SEP))
181181 }
182182
183183
184184
185185 @Callable(i)
186186 func duckInfoREADONLY (duckAssetId,userAddressOpt) = {
187187 let addr = addressFromString(userAddressOpt)
188188 let duckAsset = fromBase58String(duckAssetId)
189189 if ((duckAssetId == ""))
190190 then throw("duckAssetId is required")
191191 else {
192192 let stakedTime = valueOrElse(getInteger(stakingContract, keyStakedTimeByAssetId(duckAssetId)), 0)
193193 let owner = if ((stakedTime > 0))
194194 then value(getString(stakingContract, keyDuckIdToOwner(duckAssetId)))
195195 else if (if (isDefined(addr))
196196 then (assetBalance(value(addr), duckAsset) == 1)
197197 else false)
198198 then userAddressOpt
199199 else throw("unknown owner")
200200 let asset = value(assetInfo(duckAsset))
201201 let name = asset.name
202202 let curLocation = valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), "")
203203 let health = valueOrElse(getInteger(stakingContract, keyDuckHealth(duckAssetId)), -1)
204204 let backpack = valueOrElse(getString(stakingContract, keyBackpackByDuck(duckAssetId)), "0:0_0_0_0_0_0:0_0_0_0_0_0:")
205205 let balances = walletInternal(userAddressOpt)
206206 $Tuple2(nil, [("%s%d__stakedTime__" + toString(stakedTime)), ("%s%s__owner__" + owner), ("%s%s__name__" + name), ("%s%s__location__" + curLocation), ("%s%d__health__" + toString(health)), ("%s%s__backPack__" + backpack), makeString(["%s%d%d", "wallet", toString(balances[0]), toString(balances[1])], SEP)])
207207 }
208208 }
209209
210210
211211
212212 @Callable(i)
213213 func landInfoREADONLY (landAssetId,userAddressOpt) = {
214214 let addr = addressFromString(userAddressOpt)
215215 let landAsset = fromBase58String(landAssetId)
216216 if ((landAssetId == ""))
217217 then throw("landAssetId is required")
218218 else {
219219 let stakedTime = valueOrElse(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId)), 0)
220220 let owner = if ((stakedTime > 0))
221221 then value(getString(stakingContract, keyLandAssetIdToOwner(landAssetId)))
222222 else if (if (isDefined(addr))
223223 then (assetBalance(value(addr), landAsset) == 1)
224224 else false)
225225 then userAddressOpt
226226 else ""
227227 let descr = value(assetInfo(landAsset)).description
228228 let pieces = numPiecesBySize(split(descr, "_")[recLandSize])
229229 let productivity = applyBonuses(landAssetId, pieces)
230230 let deltaTime = (lastBlock.timestamp - stakedTime)
231231 let availRes = fraction(deltaTime, (productivity._3 * pieces), DAYMILLIS)
232232 let resStr = if ((stakedTime > 0))
233233 then asListIntCompacted(invoke(stakingContract, "splitByProportionsREADONLY", [availRes], nil))
234234 else ""
235235 let needMat = fraction(InfraUpgradeCostS, (pieces * (productivity._1 + 1)), SSIZE)
236236 let needMatStr = asListIntCompacted(invoke(stakingContract, "splitByProportionsREADONLY", [needMat], nil))
237237 let duckInfo = if (isDefined(addr))
238238 then {
239239 let duckAssetId = value(getString(stakingContract, keyStakedDuckByOwner(userAddressOpt)))
240240 $Tuple4(duckAssetId, valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), ""), valueOrElse(getInteger(stakingContract, keyDuckHealth(duckAssetId)), -1), valueOrElse(getString(stakingContract, keyBackpackByDuck(duckAssetId)), "0:0_0_0_0_0_0:0_0_0_0_0_0:"))
241241 }
242242 else $Tuple4("", "", -1, "")
243243 let balances = walletInternal(userAddressOpt)
244- $Tuple2(nil, [("%s%d__stakedTime__" + toString(stakedTime)), ("%s%s__owner__" + owner), ("%s%s__description__" + descr), ("%s%d__infraLevel__" + toString(productivity._1)), ("%s%d__artPieces__" + toString(productivity._2)), ("%s%s__availRes__" + resStr), ("%s%s__needMaterial__" + needMatStr), ("%s%s__duckAssetId__" + duckInfo._1), ("%s%s__location__" + duckInfo._2), ("%s%d__health__" + toString(duckInfo._3)), ("%s%s__backPack__" + duckInfo._4), makeString(["%s%d%d", "wallet", toString(balances[0]), toString(balances[1])], SEP)])
244+ $Tuple2(nil, [("%s%d__stakedTime__" + toString(stakedTime)), ("%s%s__owner__" + owner), ("%s%s__description__" + descr), ("%s%d__infraLevel__" + toString(productivity._1)), makeString(["%s%s", "landArtefacts", ("PRESALE:" + toString(productivity._2))], SEP), ("%s%s__availRes__" + resStr), ("%s%s__needMaterial__" + needMatStr), ("%s%s__duckAssetId__" + duckInfo._1), ("%s%s__location__" + duckInfo._2), ("%s%d__health__" + toString(duckInfo._3)), ("%s%s__backPack__" + duckInfo._4), makeString(["%s%d%d", "wallet", toString(balances[0]), toString(balances[1])], SEP)])
245245 }
246246 }
247247
248248

github/deemru/w8io/026f985 
42.17 ms