tx · E3Nz8TkeiFediEXxoCr1UTQN64v2Y5UwxW3oazLfUNbx

3NAfrN5xp6G6o34pzEhDwKDjz37NUaEpi8E:  -0.00300000 Waves

2024.11.13 00:06 [3368719] smart account 3NAfrN5xp6G6o34pzEhDwKDjz37NUaEpi8E > SELF 0.00000000 Waves

{ "type": 13, "id": "E3Nz8TkeiFediEXxoCr1UTQN64v2Y5UwxW3oazLfUNbx", "fee": 300000, "feeAssetId": null, "timestamp": 1731445665720, "version": 1, "sender": "3NAfrN5xp6G6o34pzEhDwKDjz37NUaEpi8E", "senderPublicKey": "4Hyg7NjV4cswejcnGeMvk6x68P2RLt9Y1ontHkWtTcEQ", "proofs": [ "4qLuNGxVoQ8oF8k9QHwQFfucsJMcUPVDcXp9odhRVg9U5nY5hu4Ko5dAa4D6PVPNkTjdoavYAJf7xMonHuSg6CYS" ], "script": "base64:CAIQCAISABIFCgMICAESAwoBCAADAWkBDWxpc3RBbGxBc3NldHMABAt3YXZlc0Ftb3VudAgJAO8HAQUEdGhpcwdyZWd1bGFyBA9zcGVjaWZpY0Fzc2V0SWQJANkEAQIsRExORVdOcDg0d0p1UE1nS2sxaFFHTEh4Z29ybW91a0pKTmpGUm9WNW4xajYEFHNwZWNpZmljQXNzZXRCYWxhbmNlCQDwBwIFBHRoaXMFD3NwZWNpZmljQXNzZXRJZAQMYXNzZXREZXRhaWxzBAckbWF0Y2gwCQDsBwEFD3NwZWNpZmljQXNzZXRJZAMJAAECBQckbWF0Y2gwAgVBc3NldAQBYQUHJG1hdGNoMAkAlAoCCAUBYQRuYW1lCAUBYQhkZWNpbWFscwkAAgECGUFzc2V0IGJpbGdpc2kgYnVsdW5hbWFkxLEEBnJlc3VsdAkAzAgCCQEMSW50ZWdlckVudHJ5AgINd2F2ZXNfYmFsYW5jZQULd2F2ZXNBbW91bnQJAMwIAgkBC1N0cmluZ0VudHJ5AgIIYXNzZXRfaWQCLERMTkVXTnA4NHdKdVBNZ0trMWhRR0xIeGdvcm1vdWtKS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CAgdiYWxhbmNlBQdiYWxhbmNlCQDMCAIJAQxJbnRlZ2VyRW50cnkCAghkZWNpbWFscwgFDGFzc2V0RGV0YWlscwJfMgUDbmlsBQdiYWxhbmNlAQJ0eAEGdmVyaWZ5AAQHJG1hdGNoMAUCdHgDCQABAgUHJG1hdGNoMAIXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24GCQDEEwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5s6ZS8w==", "chainId": 84, "height": 3368719, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 549hCTwGimtbiPzzGWqc5y3Rump1TL83hPzSEun1ckds Next: 32TDuEcaFms6Ws9fERfW2Rjbav8qXVeJccSGHEjyy9bB Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 8 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-func getAssetName (assetId) = {
5- let info = value(assetInfo(assetId))
6- info.name
4+
5+
6+@Callable(i)
7+func listAllAssets () = {
8+ let wavesAmount = wavesBalance(this).regular
9+ let specificAssetId = fromBase58String("DLNEWNp84wJuPMgKk1hQGLHxgormoukJJNjFRoV5n1j6")
10+ let specificAssetBalance = assetBalance(this, specificAssetId)
11+ let assetDetails = match assetInfo(specificAssetId) {
12+ case a: Asset =>
13+ $Tuple2(a.name, a.decimals)
14+ case _ =>
15+ throw("Asset bilgisi bulunamadı")
716 }
17+ let result = [IntegerEntry("waves_balance", wavesAmount), StringEntry("asset_id", "DLNEWNp84wJuPMgKk1hQGLHxgormoukJJNjFRoV5n1j6"), StringEntry("asset_name", assetDetails._1), IntegerEntry("asset_balance", specificAssetBalance), IntegerEntry("asset_decimals", assetDetails._2)]
18+ $Tuple2(result, unit)
19+ }
20+
821
922
1023 @Callable(i)
4558 else {
4659 let assetId = fromBase58String(assetIdStr)
4760 let balance = assetBalance(this, assetId)
48- $Tuple2([StringEntry("queriedAsset", assetIdStr), IntegerEntry("balance", balance)], balance)
61+ let assetDetails = match assetInfo(assetId) {
62+ case a: Asset =>
63+ $Tuple2(a.name, a.decimals)
64+ case _ =>
65+ throw("Asset bilgisi bulunamadı")
4966 }
50-
51-
52-
53-@Callable(i)
54-func listAllAssets () = {
55- let wavesAmount = wavesBalance(this).regular
56- let result = [StringEntry("WAVES_balance", toString(wavesAmount))]
57- $Tuple2(result, unit)
58- }
67+ $Tuple2([StringEntry("queriedAsset", assetIdStr), StringEntry("assetName", assetDetails._1), IntegerEntry("balance", balance), IntegerEntry("decimals", assetDetails._2)], balance)
68+ }
5969
6070
6171 @Verifier(tx)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 8 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-func getAssetName (assetId) = {
5- let info = value(assetInfo(assetId))
6- info.name
4+
5+
6+@Callable(i)
7+func listAllAssets () = {
8+ let wavesAmount = wavesBalance(this).regular
9+ let specificAssetId = fromBase58String("DLNEWNp84wJuPMgKk1hQGLHxgormoukJJNjFRoV5n1j6")
10+ let specificAssetBalance = assetBalance(this, specificAssetId)
11+ let assetDetails = match assetInfo(specificAssetId) {
12+ case a: Asset =>
13+ $Tuple2(a.name, a.decimals)
14+ case _ =>
15+ throw("Asset bilgisi bulunamadı")
716 }
17+ let result = [IntegerEntry("waves_balance", wavesAmount), StringEntry("asset_id", "DLNEWNp84wJuPMgKk1hQGLHxgormoukJJNjFRoV5n1j6"), StringEntry("asset_name", assetDetails._1), IntegerEntry("asset_balance", specificAssetBalance), IntegerEntry("asset_decimals", assetDetails._2)]
18+ $Tuple2(result, unit)
19+ }
20+
821
922
1023 @Callable(i)
1124 func transferToken (recipientStr,assetIdStr,amount) = {
1225 let recipient = addressFromStringValue(recipientStr)
1326 if ((assetIdStr == "WAVES"))
1427 then {
1528 let currentBalance = wavesBalance(this).regular
1629 if ((currentBalance >= amount))
1730 then {
1831 let transfer = ScriptTransfer(recipient, amount, unit)
1932 let txData = [BinaryEntry("lastTransferTxId", i.transactionId), StringEntry("lastRecipient", recipientStr), IntegerEntry("lastAmount", amount), StringEntry("lastAsset", "WAVES")]
2033 $Tuple2((txData :+ transfer), unit)
2134 }
2235 else throw("Yetersiz WAVES bakiyesi")
2336 }
2437 else {
2538 let assetId = fromBase58String(assetIdStr)
2639 let currentBalance = assetBalance(this, assetId)
2740 if ((currentBalance >= amount))
2841 then {
2942 let transfer = ScriptTransfer(recipient, amount, assetId)
3043 let txData = [BinaryEntry("lastTransferTxId", i.transactionId), StringEntry("lastRecipient", recipientStr), IntegerEntry("lastAmount", amount), StringEntry("lastAsset", assetIdStr)]
3144 $Tuple2((txData :+ transfer), unit)
3245 }
3346 else throw("Yetersiz token bakiyesi")
3447 }
3548 }
3649
3750
3851
3952 @Callable(i)
4053 func getBalance (assetIdStr) = if ((assetIdStr == "WAVES"))
4154 then {
4255 let balance = wavesBalance(this).regular
4356 $Tuple2([StringEntry("queriedAsset", "WAVES"), IntegerEntry("balance", balance)], balance)
4457 }
4558 else {
4659 let assetId = fromBase58String(assetIdStr)
4760 let balance = assetBalance(this, assetId)
48- $Tuple2([StringEntry("queriedAsset", assetIdStr), IntegerEntry("balance", balance)], balance)
61+ let assetDetails = match assetInfo(assetId) {
62+ case a: Asset =>
63+ $Tuple2(a.name, a.decimals)
64+ case _ =>
65+ throw("Asset bilgisi bulunamadı")
4966 }
50-
51-
52-
53-@Callable(i)
54-func listAllAssets () = {
55- let wavesAmount = wavesBalance(this).regular
56- let result = [StringEntry("WAVES_balance", toString(wavesAmount))]
57- $Tuple2(result, unit)
58- }
67+ $Tuple2([StringEntry("queriedAsset", assetIdStr), StringEntry("assetName", assetDetails._1), IntegerEntry("balance", balance), IntegerEntry("decimals", assetDetails._2)], balance)
68+ }
5969
6070
6171 @Verifier(tx)
6272 func verify () = match tx {
6373 case _: InvokeScriptTransaction =>
6474 true
6575 case _ =>
6676 sigVerify_8Kb(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
6777 }
6878

github/deemru/w8io/026f985 
18.80 ms