tx · 5KcT4xXUZVYQvXbnho3Vpc9Qt8aJnW7u3fDe8r8y7Ch6

3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy:  -0.01000000 Waves

2023.01.18 13:56 [2410280] smart account 3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy > SELF 0.00000000 Waves

{ "type": 13, "id": "5KcT4xXUZVYQvXbnho3Vpc9Qt8aJnW7u3fDe8r8y7Ch6", "fee": 1000000, "feeAssetId": null, "timestamp": 1674039442114, "version": 2, "chainId": 84, "sender": "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy", "senderPublicKey": "C3PaRKeL8AUKbwUqdniMQtThgcTh5DYHV1777Hkxy7rp", "proofs": [ "2V1mSCdDDEBcmt8hsTunjHVwgumHvbB67g7o7CKAi3Y8Z7vxCvdQ8sbxwDAZJhsVeENLc6HG7Tu7km8hcTuovmHB" ], "script": "base64:BgITCAISAwoBCBIECgIICBIECgIICCQABWNoYWluCQCwCQEJAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEAC3VzZG5Bc3NldElkBAckbWF0Y2gwBQVjaGFpbgMJAAACAgFXBQckbWF0Y2gwASC2JinDBPXOU5GkDkt1JC9kjFGx+t+vVCm9SNIdKrKq0QMJAAACAgFUBQckbWF0Y2gwASD3dur394PKZdtuE+4CO89YKZWpwdGN8kvabNgdYoDI3gkAAgECDVVua25vd24gY2hhaW4AD2Vjb25vbXlDb250cmFjdAkBEUBleHRyTmF0aXZlKDEwNjIpAQQHJG1hdGNoMAUFY2hhaW4DCQAAAgIBVwUHJG1hdGNoMAIjM1Ayc2sxS25jU3hSYVpzOGI0Q1dHUHcyamt2dmF2NzR1NEQDCQAAAgIBVAUHJG1hdGNoMAIjM044eTR3eFgzSkM0VGRyQ0pCWFgxNlNqV2Y2WDI1NmhyZXAJAAIBAg1Vbmtub3duIGNoYWluAA9zdGFraW5nQ29udHJhY3QJARFAZXh0ck5hdGl2ZSgxMDYyKQEEByRtYXRjaDAFBWNoYWluAwkAA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MCAIJAKwCAgITJXMlc19fZGVzY3JpcHRpb25fXwUFZGVzY3IJAMwIAgkArAICAhIlcyVkX19pbmZyYUxldmVsX18JAKQDAQgFDHByb2R1Y3Rpdml0eQJfMQkAzAgCCQCsAgICESVzJWRfX2FydFBpZWNlc19fCQCkAwEIBQxwcm9kdWN0aXZpdHkCXzIJAMwIAgkArAICAhAlcyVzX19hdmFpbFJlc19fBQZyZXNTdHIJAMwIAgkArAICAhQlcyVzX19uZWVkTWF0ZXJpYWxfXwUKbmVlZE1hdFN0cgkAzAgCCQCsAgICEyVzJXNfX2R1Y2tBc3NldElkX18IBQhkdWNrSW5mbwJfMQkAzAgCCQCsAgICECVzJXNfX2xvY2F0aW9uX18IBQhkdWNrSW5mbwJfMgkAzAgCCQCsAgICDiVzJWRfX2hlYWx0aF9fCQCkAwEIBQhkdWNrSW5mbwJfMwkAzAgCCQCsAgICECVzJXNfX2JhY2tQYWNrX18IBQhkdWNrSW5mbwJfNAkAzAgCCQC5CQIJAMwIAgIGJXMlZCVkCQDMCAICBndhbGxldAkAzAgCCQCkAwEJAJEDAgUIYmFsYW5jZXMAAAkAzAgCCQCkAwEJAJEDAgUIYmFsYW5jZXMAAQUDbmlsBQNTRVAFA25pbADPw5iz", "height": 2410280, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CNbGmGxXbT51HmW5T9HnLSpvLXU6Wi2qEsdeMGo9eySy Next: 6Fsf4AyN7k7jZsBU6N3xK5o4xTobqC8gFWEDqCM1oMfM Diff:
OldNewDifferences
223223 then (assetBalance(value(addr), landAsset) == 1)
224224 else false)
225225 then userAddressOpt
226- else throw("unknown owner")
226+ 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)
232- let resStr = asListIntCompacted(invoke(stakingContract, "splitByProportionsREADONLY", [availRes], nil))
232+ let resStr = if ((stakedTime > 0))
233+ then asListIntCompacted(invoke(stakingContract, "splitByProportionsREADONLY", [availRes], nil))
234+ else ""
233235 let needMat = fraction(InfraUpgradeCostS, (pieces * (productivity._1 + 1)), SSIZE)
234236 let needMatStr = asListIntCompacted(invoke(stakingContract, "splitByProportionsREADONLY", [needMat], nil))
235237 let duckInfo = if (isDefined(addr))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let chain = toUtf8String(take(drop(this.bytes, 1), 1))
55
66 let usdnAssetId = match chain {
77 case _ =>
88 if (("W" == $match0))
99 then base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p'
1010 else if (("T" == $match0))
1111 then base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ'
1212 else throw("Unknown chain")
1313 }
1414
1515 let economyContract = addressFromStringValue(match chain {
1616 case _ =>
1717 if (("W" == $match0))
1818 then "3P2sk1KncSxRaZs8b4CWGPw2jkvvav74u4D"
1919 else if (("T" == $match0))
2020 then "3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep"
2121 else throw("Unknown chain")
2222 })
2323
2424 let stakingContract = addressFromStringValue(match chain {
2525 case _ =>
2626 if (("W" == $match0))
2727 then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1"
2828 else if (("T" == $match0))
2929 then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm"
3030 else throw("Unknown chain")
3131 })
3232
3333 let InfraUpgradeCostS = match chain {
3434 case _ =>
3535 if (("W" == $match0))
3636 then 6307198406
3737 else if (("T" == $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
226- else throw("unknown owner")
226+ 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)
232- let resStr = asListIntCompacted(invoke(stakingContract, "splitByProportionsREADONLY", [availRes], nil))
232+ let resStr = if ((stakedTime > 0))
233+ then asListIntCompacted(invoke(stakingContract, "splitByProportionsREADONLY", [availRes], nil))
234+ else ""
233235 let needMat = fraction(InfraUpgradeCostS, (pieces * (productivity._1 + 1)), SSIZE)
234236 let needMatStr = asListIntCompacted(invoke(stakingContract, "splitByProportionsREADONLY", [needMat], nil))
235237 let duckInfo = if (isDefined(addr))
236238 then {
237239 let duckAssetId = value(getString(stakingContract, keyStakedDuckByOwner(userAddressOpt)))
238240 $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:"))
239241 }
240242 else $Tuple4("", "", -1, "")
241243 let balances = walletInternal(userAddressOpt)
242244 $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)])
243245 }
244246 }
245247
246248

github/deemru/w8io/026f985 
34.97 ms