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/eDymXbbhPuAjvPWCmVqcHRjfJL2mzYHWKAyN4JAAIBAg1Vbmtub3duIGNoYWluAA9lY29ub215Q29udHJhY3QJARFAZXh0ck5hdGl2ZSgxMDYyKQEEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDACIzNQMnNrMUtuY1N4UmFaczhiNENXR1B3MmprdnZhdjc0dTREAwkAAAIBAVQFByRtYXRjaDACIzNOOHk0d3hYM0pDNFRkckNKQlhYMTZTaldmNlgyNTZocmVwCQACAQINVW5rbm93biBjaGFpbgAPc3Rha2luZ0NvbnRyYWN0CQERQGV4dHJOYXRpdmUoMTA2MikBBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2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fCQCkAwEIBQxwcm9kdWN0aXZpdHkCXzEJAMwIAgkAuQkCCQDMCAICBCVzJXMJAMwIAgINbGFuZEFydGVmYWN0cwkAzAgCCQCsAgICCFBSRVNBTEU6CQCkAwEIBQxwcm9kdWN0aXZpdHkCXzIFA25pbAUDU0VQCQDMCAIJAKwCAgIQJXMlc19fYXZhaWxSZXNfXwUGcmVzU3RyCQDMCAIJAKwCAgIUJXMlc19fbmVlZE1hdGVyaWFsX18FCm5lZWRNYXRTdHIJAMwIAgkArAICAhMlcyVzX19kdWNrQXNzZXRJZF9fCAUIZHVja0luZm8CXzEJAMwIAgkArAICAhAlcyVzX19sb2NhdGlvbl9fCAUIZHVja0luZm8CXzIJAMwIAgkArAICAg4lcyVkX19oZWFsdGhfXwkApAMBCAUIZHVja0luZm8CXzMJAMwIAgkArAICAhAlcyVzX19iYWNrUGFja19fCAUIZHVja0luZm8CXzQJAMwIAgkAuQkCCQDMCAICBiVzJWQlZAkAzAgCAgZ3YWxsZXQJAMwIAgkApAMBCQCRAwIFCGJhbGFuY2VzAAAJAMwIAgkApAMBCQCRAwIFCGJhbGFuY2VzAAEFA25pbAUDU0VQBQNuaWwArQG37A==", "height": 2411705, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5KcT4xXUZVYQvXbnho3Vpc9Qt8aJnW7u3fDe8r8y7Ch6 Next: CNjDxuPevRC6iUYR6Ym6yWH57kkKV7NWCpwpCpgSF6mF Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let chain = | |
4 | + | let chain = take(drop(this.bytes, 1), 1) | |
5 | 5 | ||
6 | 6 | let usdnAssetId = match chain { | |
7 | 7 | case _ => | |
8 | - | if (( | |
8 | + | if ((base58'2W' == $match0)) | |
9 | 9 | then base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
10 | - | else if (( | |
10 | + | else if ((base58'2T' == $match0)) | |
11 | 11 | then base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' | |
12 | 12 | else throw("Unknown chain") | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | let economyContract = addressFromStringValue(match chain { | |
16 | 16 | case _ => | |
17 | - | if (( | |
17 | + | if ((base58'2W' == $match0)) | |
18 | 18 | then "3P2sk1KncSxRaZs8b4CWGPw2jkvvav74u4D" | |
19 | - | else if (( | |
19 | + | else if ((base58'2T' == $match0)) | |
20 | 20 | then "3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep" | |
21 | 21 | else throw("Unknown chain") | |
22 | 22 | }) | |
23 | 23 | ||
24 | 24 | let stakingContract = addressFromStringValue(match chain { | |
25 | 25 | case _ => | |
26 | - | if (( | |
26 | + | if ((base58'2W' == $match0)) | |
27 | 27 | then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1" | |
28 | - | else if (( | |
28 | + | else if ((base58'2T' == $match0)) | |
29 | 29 | then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm" | |
30 | 30 | else throw("Unknown chain") | |
31 | 31 | }) | |
32 | 32 | ||
33 | 33 | let InfraUpgradeCostS = match chain { | |
34 | 34 | case _ => | |
35 | - | if (( | |
35 | + | if ((base58'2W' == $match0)) | |
36 | 36 | then 6307198406 | |
37 | - | else if (( | |
37 | + | else if ((base58'2T' == $match0)) | |
38 | 38 | then 63071984 | |
39 | 39 | else throw("Unknown chain") | |
40 | 40 | } | |
241 | 241 | } | |
242 | 242 | else $Tuple4("", "", -1, "") | |
243 | 243 | 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% | |
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)]) | |
245 | 245 | } | |
246 | 246 | } | |
247 | 247 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let chain = | |
4 | + | let chain = take(drop(this.bytes, 1), 1) | |
5 | 5 | ||
6 | 6 | let usdnAssetId = match chain { | |
7 | 7 | case _ => | |
8 | - | if (( | |
8 | + | if ((base58'2W' == $match0)) | |
9 | 9 | then base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
10 | - | else if (( | |
10 | + | else if ((base58'2T' == $match0)) | |
11 | 11 | then base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' | |
12 | 12 | else throw("Unknown chain") | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | let economyContract = addressFromStringValue(match chain { | |
16 | 16 | case _ => | |
17 | - | if (( | |
17 | + | if ((base58'2W' == $match0)) | |
18 | 18 | then "3P2sk1KncSxRaZs8b4CWGPw2jkvvav74u4D" | |
19 | - | else if (( | |
19 | + | else if ((base58'2T' == $match0)) | |
20 | 20 | then "3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep" | |
21 | 21 | else throw("Unknown chain") | |
22 | 22 | }) | |
23 | 23 | ||
24 | 24 | let stakingContract = addressFromStringValue(match chain { | |
25 | 25 | case _ => | |
26 | - | if (( | |
26 | + | if ((base58'2W' == $match0)) | |
27 | 27 | then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1" | |
28 | - | else if (( | |
28 | + | else if ((base58'2T' == $match0)) | |
29 | 29 | then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm" | |
30 | 30 | else throw("Unknown chain") | |
31 | 31 | }) | |
32 | 32 | ||
33 | 33 | let InfraUpgradeCostS = match chain { | |
34 | 34 | case _ => | |
35 | - | if (( | |
35 | + | if ((base58'2W' == $match0)) | |
36 | 36 | then 6307198406 | |
37 | - | else if (( | |
37 | + | else if ((base58'2T' == $match0)) | |
38 | 38 | then 63071984 | |
39 | 39 | else throw("Unknown chain") | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | let LANDPREFIX = "LAND" | |
43 | 43 | ||
44 | 44 | let DUCKPREFIX = "DUCK" | |
45 | 45 | ||
46 | 46 | let SEP = "__" | |
47 | 47 | ||
48 | 48 | let ARTPRESALE = "PRESALE" | |
49 | 49 | ||
50 | 50 | let DAILYRESBYPIECE = 3456000 | |
51 | 51 | ||
52 | 52 | let DAYMILLIS = 86400000 | |
53 | 53 | ||
54 | 54 | let NUMRES = 6 | |
55 | 55 | ||
56 | 56 | let SSIZE = 25 | |
57 | 57 | ||
58 | 58 | let MSIZE = 100 | |
59 | 59 | ||
60 | 60 | let LSIZE = 225 | |
61 | 61 | ||
62 | 62 | let XLSIZE = 400 | |
63 | 63 | ||
64 | 64 | let XXLSIZE = 625 | |
65 | 65 | ||
66 | 66 | let recLandNum = 0 | |
67 | 67 | ||
68 | 68 | let recLandSize = 1 | |
69 | 69 | ||
70 | 70 | let recTerrains = 2 | |
71 | 71 | ||
72 | 72 | let recContinent = 3 | |
73 | 73 | ||
74 | 74 | func keyDuckIdToOwner (assetId) = ("duckOwner_" + assetId) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func keyStakedTimeByAssetId (assetId) = ("stakedTime_" + assetId) | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func keyStakedTimeByTypeAssetIdAndOwner (nftType,assetId,ownerAddr) = ((((("stakedTimeByTypeAssetIdAndOwner_" + nftType) + "_") + assetId) + "_") + ownerAddr) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func keyBackpackByDuck (duckAssetId) = ("backPack_" + duckAssetId) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func keyDuckLocation (duckAssetId) = ("duckLocation_" + duckAssetId) | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func keyDuckHealth (duckAssetId) = ("duckHealth_" + duckAssetId) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func keyLandAssetIdToOwner (assetId) = ("nftOwner_" + assetId) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func keyInfraLevelByAssetId (assetId) = ("infraLevel_" + assetId) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func keyLandArtStatusByTypeAndAssetId (type,assetId) = makeString(["landArtStatus", type, assetId], "_") | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func keyPresaleArtActivatedByAssetId (assetId) = ("presaleArtActivated_" + assetId) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func asListIntCompacted (val) = match val { | |
108 | 108 | case valAnyList: List[Any] => | |
109 | 109 | if ((size(valAnyList) != NUMRES)) | |
110 | 110 | then throw(("Array size is " + toString(size(valAnyList)))) | |
111 | 111 | else { | |
112 | 112 | func conv (acc,item) = match item { | |
113 | 113 | case it: Int => | |
114 | 114 | (acc :+ toString(it)) | |
115 | 115 | case _ => | |
116 | 116 | throw("List type is not Int") | |
117 | 117 | } | |
118 | 118 | ||
119 | 119 | let r = { | |
120 | 120 | let $l = valAnyList | |
121 | 121 | let $s = size($l) | |
122 | 122 | let $acc0 = nil | |
123 | 123 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
124 | 124 | then $a | |
125 | 125 | else conv($a, $l[$i]) | |
126 | 126 | ||
127 | 127 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
128 | 128 | then $a | |
129 | 129 | else throw("List size exceeds 6") | |
130 | 130 | ||
131 | 131 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
132 | 132 | } | |
133 | 133 | makeString(r, "_") | |
134 | 134 | } | |
135 | 135 | case _ => | |
136 | 136 | throw("fail to cast into List") | |
137 | 137 | } | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func walletInternal (userAddressOpt) = { | |
141 | 141 | let addr = addressFromString(userAddressOpt) | |
142 | 142 | let balance = if (isDefined(addr)) | |
143 | 143 | then wavesBalance(value(addr)) | |
144 | 144 | else BalanceDetails(0, 0, 0, 0) | |
145 | 145 | let usdnBalance = if (isDefined(addr)) | |
146 | 146 | then assetBalance(value(addr), usdnAssetId) | |
147 | 147 | else 0 | |
148 | 148 | [balance.available, usdnBalance] | |
149 | 149 | } | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | func applyBonuses (landAssetId,pieces) = { | |
153 | 153 | let infraLevel = valueOrElse(getInteger(stakingContract, keyInfraLevelByAssetId(landAssetId)), 0) | |
154 | 154 | let artPieces = valueOrElse(getInteger(stakingContract, keyLandArtStatusByTypeAndAssetId(ARTPRESALE, landAssetId)), if (valueOrElse(getBoolean(stakingContract, keyPresaleArtActivatedByAssetId(landAssetId)), false)) | |
155 | 155 | then pieces | |
156 | 156 | else 0) | |
157 | 157 | $Tuple3(infraLevel, artPieces, ((DAILYRESBYPIECE + fraction(DAILYRESBYPIECE, infraLevel, 4)) + fraction(DAILYRESBYPIECE, (artPieces * 3), (pieces * 20)))) | |
158 | 158 | } | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | func numPiecesBySize (landSize) = match landSize { | |
162 | 162 | case _ => | |
163 | 163 | if (("S" == $match0)) | |
164 | 164 | then SSIZE | |
165 | 165 | else if (("M" == $match0)) | |
166 | 166 | then MSIZE | |
167 | 167 | else if (("L" == $match0)) | |
168 | 168 | then LSIZE | |
169 | 169 | else if (("XL" == $match0)) | |
170 | 170 | then XLSIZE | |
171 | 171 | else if (("XXL" == $match0)) | |
172 | 172 | then XXLSIZE | |
173 | 173 | else throw("Unknown land size") | |
174 | 174 | } | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | @Callable(i) | |
178 | 178 | func walletInfoREADONLY (userAddressOpt) = { | |
179 | 179 | let balances = walletInternal(userAddressOpt) | |
180 | 180 | $Tuple2(nil, makeString(["%s%d%d", "wallet", toString(balances[0]), toString(balances[1])], SEP)) | |
181 | 181 | } | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | ||
185 | 185 | @Callable(i) | |
186 | 186 | func duckInfoREADONLY (duckAssetId,userAddressOpt) = { | |
187 | 187 | let addr = addressFromString(userAddressOpt) | |
188 | 188 | let duckAsset = fromBase58String(duckAssetId) | |
189 | 189 | if ((duckAssetId == "")) | |
190 | 190 | then throw("duckAssetId is required") | |
191 | 191 | else { | |
192 | 192 | let stakedTime = valueOrElse(getInteger(stakingContract, keyStakedTimeByAssetId(duckAssetId)), 0) | |
193 | 193 | let owner = if ((stakedTime > 0)) | |
194 | 194 | then value(getString(stakingContract, keyDuckIdToOwner(duckAssetId))) | |
195 | 195 | else if (if (isDefined(addr)) | |
196 | 196 | then (assetBalance(value(addr), duckAsset) == 1) | |
197 | 197 | else false) | |
198 | 198 | then userAddressOpt | |
199 | 199 | else throw("unknown owner") | |
200 | 200 | let asset = value(assetInfo(duckAsset)) | |
201 | 201 | let name = asset.name | |
202 | 202 | let curLocation = valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), "") | |
203 | 203 | let health = valueOrElse(getInteger(stakingContract, keyDuckHealth(duckAssetId)), -1) | |
204 | 204 | let backpack = valueOrElse(getString(stakingContract, keyBackpackByDuck(duckAssetId)), "0:0_0_0_0_0_0:0_0_0_0_0_0:") | |
205 | 205 | let balances = walletInternal(userAddressOpt) | |
206 | 206 | $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)]) | |
207 | 207 | } | |
208 | 208 | } | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | ||
212 | 212 | @Callable(i) | |
213 | 213 | func landInfoREADONLY (landAssetId,userAddressOpt) = { | |
214 | 214 | let addr = addressFromString(userAddressOpt) | |
215 | 215 | let landAsset = fromBase58String(landAssetId) | |
216 | 216 | if ((landAssetId == "")) | |
217 | 217 | then throw("landAssetId is required") | |
218 | 218 | else { | |
219 | 219 | let stakedTime = valueOrElse(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId)), 0) | |
220 | 220 | let owner = if ((stakedTime > 0)) | |
221 | 221 | then value(getString(stakingContract, keyLandAssetIdToOwner(landAssetId))) | |
222 | 222 | else if (if (isDefined(addr)) | |
223 | 223 | then (assetBalance(value(addr), landAsset) == 1) | |
224 | 224 | else false) | |
225 | 225 | then userAddressOpt | |
226 | 226 | else "" | |
227 | 227 | let descr = value(assetInfo(landAsset)).description | |
228 | 228 | let pieces = numPiecesBySize(split(descr, "_")[recLandSize]) | |
229 | 229 | let productivity = applyBonuses(landAssetId, pieces) | |
230 | 230 | let deltaTime = (lastBlock.timestamp - stakedTime) | |
231 | 231 | let availRes = fraction(deltaTime, (productivity._3 * pieces), DAYMILLIS) | |
232 | 232 | let resStr = if ((stakedTime > 0)) | |
233 | 233 | then asListIntCompacted(invoke(stakingContract, "splitByProportionsREADONLY", [availRes], nil)) | |
234 | 234 | else "" | |
235 | 235 | let needMat = fraction(InfraUpgradeCostS, (pieces * (productivity._1 + 1)), SSIZE) | |
236 | 236 | let needMatStr = asListIntCompacted(invoke(stakingContract, "splitByProportionsREADONLY", [needMat], nil)) | |
237 | 237 | let duckInfo = if (isDefined(addr)) | |
238 | 238 | then { | |
239 | 239 | let duckAssetId = value(getString(stakingContract, keyStakedDuckByOwner(userAddressOpt))) | |
240 | 240 | $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:")) | |
241 | 241 | } | |
242 | 242 | else $Tuple4("", "", -1, "") | |
243 | 243 | 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% | |
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)]) | |
245 | 245 | } | |
246 | 246 | } | |
247 | 247 | ||
248 | 248 |
github/deemru/w8io/026f985 42.17 ms ◑