tx · fjM7qt9tfLoajfYJBzDKRimZRsEEdtmshVnhCrQcFPy 3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy: -0.01000000 Waves 2023.01.17 03:47 [2408232] smart account 3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy > SELF 0.00000000 Waves
{ "type": 13, "id": "fjM7qt9tfLoajfYJBzDKRimZRsEEdtmshVnhCrQcFPy", "fee": 1000000, "feeAssetId": null, "timestamp": 1673916544443, "version": 2, "chainId": 84, "sender": "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy", "senderPublicKey": "C3PaRKeL8AUKbwUqdniMQtThgcTh5DYHV1777Hkxy7rp", "proofs": [ "btkHyXmUL3STts5chWPt6wkSkDR7owwNkUvU9AHcRSK3oxvEuJWCpJoXND9rJQJfnt8citvWVSRu352NNjA3Kcz" ], "script": "base64:BgINCAISAwoBCBIECgIICA4ABWNoYWluCQCwCQEJAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEAC3VzZG5Bc3NldElkBAckbWF0Y2gwBQVjaGFpbgMJAAACAgFXBQckbWF0Y2gwASC2JinDBPXOU5GkDkt1JC9kjFGx+t+vVCm9SNIdKrKq0QMJAAACAgFUBQckbWF0Y2gwASD3dur394PKZdtuE+4CO89YKZWpwdGN8kvabNgdYoDI3gkAAgECDVVua25vd24gY2hhaW4AD2Vjb25vbXlDb250cmFjdAkBEUBleHRyTmF0aXZlKDEwNjIpAQQHJG1hdGNoMAUFY2hhaW4DCQAAAgIBVwUHJG1hdGNoMAIjM1Ayc2sxS25jU3hSYVpzOGI0Q1dHUHcyamt2dmF2NzR1NEQDCQAAAgIBVAUHJG1hdGNoMAIjM044eTR3eFgzSkM0VGRyQ0pCWFgxNlNqV2Y2WDI1NmhyZXAJAAIBAg1Vbmtub3duIGNoYWluAA9zdGFraW5nQ29udHJhY3QJARFAZXh0ck5hdGl2ZSgxMDYyKQEEByRtYXRjaDAFBWNoYWluAwkAAAICAVcFByRtYXRjaDACIzNQTG5jWHR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dAkBD2tleUR1Y2tMb2NhdGlvbgEFC2R1Y2tBc3NldElkAgAEBmhlYWx0aAkBC3ZhbHVlT3JFbHNlAgkAmggCBQ9zdGFraW5nQ29udHJhY3QJAQ1rZXlEdWNrSGVhbHRoAQULZHVja0Fzc2V0SWQA////////////AQQIYmFja3BhY2sJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUPc3Rha2luZ0NvbnRyYWN0CQERa2V5QmFja3BhY2tCeUR1Y2sBBQtkdWNrQXNzZXRJZAIaMDowXzBfMF8wXzBfMDowXzBfMF8wXzBfMDoECGJhbGFuY2VzCQEOd2FsbGV0SW50ZXJuYWwBBQ51c2VyQWRkcmVzc09wdAkAlAoCBQNuaWwJAMwIAgkArAICAhIlcyVkX19zdGFrZWRUaW1lX18JAKQDAQUKc3Rha2VkVGltZQkAzAgCCQCsAgICDSVzJXNfX293bmVyX18FBW93bmVyCQDMCAIJAKwCAgIMJXMlc19fbmFtZV9fBQRuYW1lCQDMCAIJAKwCAgIQJXMlc19fbG9jYXRpb25fXwULY3VyTG9jYXRpb24JAMwIAgkArAICAg4lcyVkX19oZWFsdGhfXwkApAMBBQZoZWFsdGgJAMwIAgkArAICAhAlcyVzX19iYWNrUGFja19fBQhiYWNrcGFjawkAzAgCCQCsAgIJAKwCAgkArAICAhAlcyVkJWRfX3dhbGxldF9fCQCkAwEJAJEDAgUIYmFsYW5jZXMAAAIBXwkApAMBCQCRAwIFCGJhbGFuY2VzAAEFA25pbABTy3L7", "height": 2408232, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: KxeNzrMhp4EsChMTVU7HAWStTu45vwiDoBBMLACbQGh Next: 8HMZYJMs9UXbDHsgvNRp6HwckFteiC9jLyBofqXirWQy Diff:
Old | New | Differences | |
---|---|---|---|
70 | 70 | @Callable(i) | |
71 | 71 | func walletInfoREADONLY (userAddressOpt) = { | |
72 | 72 | let balances = walletInternal(userAddressOpt) | |
73 | - | $Tuple2(nil, | |
73 | + | $Tuple2(nil, ((("%s%d%d__wallet__" + toString(balances[0])) + "_") + toString(balances[1]))) | |
74 | 74 | } | |
75 | 75 | ||
76 | 76 | ||
96 | 96 | let health = valueOrElse(getInteger(stakingContract, keyDuckHealth(duckAssetId)), -1) | |
97 | 97 | let backpack = valueOrElse(getString(stakingContract, keyBackpackByDuck(duckAssetId)), "0:0_0_0_0_0_0:0_0_0_0_0_0:") | |
98 | 98 | let balances = walletInternal(userAddressOpt) | |
99 | - | $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), | |
99 | + | $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), ((("%s%d%d__wallet__" + toString(balances[0])) + "_") + toString(balances[1]))]) | |
100 | 100 | } | |
101 | 101 | } | |
102 | 102 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let chain = toUtf8String(take(drop(this.bytes, 1), 1)) | |
5 | 5 | ||
6 | 6 | let usdnAssetId = match chain { | |
7 | 7 | case _ => | |
8 | 8 | if (("W" == $match0)) | |
9 | 9 | then base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
10 | 10 | else if (("T" == $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 | 17 | if (("W" == $match0)) | |
18 | 18 | then "3P2sk1KncSxRaZs8b4CWGPw2jkvvav74u4D" | |
19 | 19 | else if (("T" == $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 | 26 | if (("W" == $match0)) | |
27 | 27 | then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1" | |
28 | 28 | else if (("T" == $match0)) | |
29 | 29 | then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm" | |
30 | 30 | else throw("Unknown chain") | |
31 | 31 | }) | |
32 | 32 | ||
33 | 33 | let LANDPREFIX = "LAND" | |
34 | 34 | ||
35 | 35 | let DUCKPREFIX = "DUCK" | |
36 | 36 | ||
37 | 37 | func keyDuckIdToOwner (assetId) = ("duckOwner_" + assetId) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func keyStakedTimeByAssetId (assetId) = ("stakedTime_" + assetId) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func keyStakedTimeByTypeAssetIdAndOwner (nftType,assetId,ownerAddr) = ((((("stakedTimeByTypeAssetIdAndOwner_" + nftType) + "_") + assetId) + "_") + ownerAddr) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func keyBackpackByDuck (duckAssetId) = ("backPack_" + duckAssetId) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func keyDuckLocation (duckAssetId) = ("duckLocation_" + duckAssetId) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func keyDuckHealth (duckAssetId) = ("duckHealth_" + duckAssetId) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func walletInternal (userAddressOpt) = { | |
59 | 59 | let addr = addressFromString(userAddressOpt) | |
60 | 60 | let balance = if (isDefined(addr)) | |
61 | 61 | then wavesBalance(value(addr)) | |
62 | 62 | else BalanceDetails(0, 0, 0, 0) | |
63 | 63 | let usdnBalance = if (isDefined(addr)) | |
64 | 64 | then assetBalance(value(addr), usdnAssetId) | |
65 | 65 | else 0 | |
66 | 66 | [balance.available, usdnBalance] | |
67 | 67 | } | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | @Callable(i) | |
71 | 71 | func walletInfoREADONLY (userAddressOpt) = { | |
72 | 72 | let balances = walletInternal(userAddressOpt) | |
73 | - | $Tuple2(nil, | |
73 | + | $Tuple2(nil, ((("%s%d%d__wallet__" + toString(balances[0])) + "_") + toString(balances[1]))) | |
74 | 74 | } | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | ||
78 | 78 | @Callable(i) | |
79 | 79 | func duckInfoREADONLY (duckAssetId,userAddressOpt) = { | |
80 | 80 | let addr = addressFromString(userAddressOpt) | |
81 | 81 | let duckAsset = fromBase58String(duckAssetId) | |
82 | 82 | if ((duckAssetId == "")) | |
83 | 83 | then throw("duckAssetId is required") | |
84 | 84 | else { | |
85 | 85 | let stakedTime = valueOrElse(getInteger(stakingContract, keyStakedTimeByAssetId(duckAssetId)), 0) | |
86 | 86 | let owner = if ((stakedTime > 0)) | |
87 | 87 | then value(getString(stakingContract, keyDuckIdToOwner(duckAssetId))) | |
88 | 88 | else if (if (isDefined(addr)) | |
89 | 89 | then (assetBalance(value(addr), duckAsset) == 1) | |
90 | 90 | else false) | |
91 | 91 | then userAddressOpt | |
92 | 92 | else throw("unknown owner") | |
93 | 93 | let asset = value(assetInfo(duckAsset)) | |
94 | 94 | let name = asset.name | |
95 | 95 | let curLocation = valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), "") | |
96 | 96 | let health = valueOrElse(getInteger(stakingContract, keyDuckHealth(duckAssetId)), -1) | |
97 | 97 | let backpack = valueOrElse(getString(stakingContract, keyBackpackByDuck(duckAssetId)), "0:0_0_0_0_0_0:0_0_0_0_0_0:") | |
98 | 98 | let balances = walletInternal(userAddressOpt) | |
99 | - | $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), | |
99 | + | $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), ((("%s%d%d__wallet__" + toString(balances[0])) + "_") + toString(balances[1]))]) | |
100 | 100 | } | |
101 | 101 | } | |
102 | 102 | ||
103 | 103 |
github/deemru/w8io/026f985 35.06 ms ◑