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:CAIQCAISABIFCgMICAESAwoBCAADAWkBDWxpc3RBbGxBc3NldHMABAt3YXZlc0Ftb3VudAgJAO8HAQUEdGhpcwdyZWd1bGFyBA9zcGVjaWZpY0Fzc2V0SWQJANkEAQIsRExORVdOcDg0d0p1UE1nS2sxaFFHTEh4Z29ybW91a0pKTmpGUm9WNW4xajYEFHNwZWNpZmljQXNzZXRCYWxhbmNlCQDwBwIFBHRoaXMFD3NwZWNpZmljQXNzZXRJZAQMYXNzZXREZXRhaWxzBAckbWF0Y2gwCQDsBwEFD3NwZWNpZmljQXNzZXRJZAMJAAECBQckbWF0Y2gwAgVBc3NldAQBYQUHJG1hdGNoMAkAlAoCCAUBYQRuYW1lCAUBYQhkZWNpbWFscwkAAgECGUFzc2V0IGJpbGdpc2kgYnVsdW5hbWFkxLEEBnJlc3VsdAkAzAgCCQEMSW50ZWdlckVudHJ5AgINd2F2ZXNfYmFsYW5jZQULd2F2ZXNBbW91bnQJAMwIAgkBC1N0cmluZ0VudHJ5AgIIYXNzZXRfaWQCLERMTkVXTnA4NHdKdVBNZ0trMWhRR0xIeGdvcm1vdWtKSk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AgdiYWxhbmNlBQdiYWxhbmNlCQDMCAIJAQxJbnRlZ2VyRW50cnkCAghkZWNpbWFscwgFDGFzc2V0RGV0YWlscwJfMgUDbmlsBQdiYWxhbmNlAQJ0eAEGdmVyaWZ5AAQHJG1hdGNoMAUCdHgDCQABAgUHJG1hdGNoMAIXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24GCQDEEwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5s6ZS8w==", "chainId": 84, "height": 3368719, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 549hCTwGimtbiPzzGWqc5y3Rump1TL83hPzSEun1ckds Next: 32TDuEcaFms6Ws9fERfW2Rjbav8qXVeJccSGHEjyy9bB Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 8 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# 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ı") | |
7 | 16 | } | |
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 | + | ||
8 | 21 | ||
9 | 22 | ||
10 | 23 | @Callable(i) | |
45 | 58 | else { | |
46 | 59 | let assetId = fromBase58String(assetIdStr) | |
47 | 60 | 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ı") | |
49 | 66 | } | |
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 | + | } | |
59 | 69 | ||
60 | 70 | ||
61 | 71 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 8 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# 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ı") | |
7 | 16 | } | |
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 | + | ||
8 | 21 | ||
9 | 22 | ||
10 | 23 | @Callable(i) | |
11 | 24 | func transferToken (recipientStr,assetIdStr,amount) = { | |
12 | 25 | let recipient = addressFromStringValue(recipientStr) | |
13 | 26 | if ((assetIdStr == "WAVES")) | |
14 | 27 | then { | |
15 | 28 | let currentBalance = wavesBalance(this).regular | |
16 | 29 | if ((currentBalance >= amount)) | |
17 | 30 | then { | |
18 | 31 | let transfer = ScriptTransfer(recipient, amount, unit) | |
19 | 32 | let txData = [BinaryEntry("lastTransferTxId", i.transactionId), StringEntry("lastRecipient", recipientStr), IntegerEntry("lastAmount", amount), StringEntry("lastAsset", "WAVES")] | |
20 | 33 | $Tuple2((txData :+ transfer), unit) | |
21 | 34 | } | |
22 | 35 | else throw("Yetersiz WAVES bakiyesi") | |
23 | 36 | } | |
24 | 37 | else { | |
25 | 38 | let assetId = fromBase58String(assetIdStr) | |
26 | 39 | let currentBalance = assetBalance(this, assetId) | |
27 | 40 | if ((currentBalance >= amount)) | |
28 | 41 | then { | |
29 | 42 | let transfer = ScriptTransfer(recipient, amount, assetId) | |
30 | 43 | let txData = [BinaryEntry("lastTransferTxId", i.transactionId), StringEntry("lastRecipient", recipientStr), IntegerEntry("lastAmount", amount), StringEntry("lastAsset", assetIdStr)] | |
31 | 44 | $Tuple2((txData :+ transfer), unit) | |
32 | 45 | } | |
33 | 46 | else throw("Yetersiz token bakiyesi") | |
34 | 47 | } | |
35 | 48 | } | |
36 | 49 | ||
37 | 50 | ||
38 | 51 | ||
39 | 52 | @Callable(i) | |
40 | 53 | func getBalance (assetIdStr) = if ((assetIdStr == "WAVES")) | |
41 | 54 | then { | |
42 | 55 | let balance = wavesBalance(this).regular | |
43 | 56 | $Tuple2([StringEntry("queriedAsset", "WAVES"), IntegerEntry("balance", balance)], balance) | |
44 | 57 | } | |
45 | 58 | else { | |
46 | 59 | let assetId = fromBase58String(assetIdStr) | |
47 | 60 | 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ı") | |
49 | 66 | } | |
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 | + | } | |
59 | 69 | ||
60 | 70 | ||
61 | 71 | @Verifier(tx) | |
62 | 72 | func verify () = match tx { | |
63 | 73 | case _: InvokeScriptTransaction => | |
64 | 74 | true | |
65 | 75 | case _ => | |
66 | 76 | sigVerify_8Kb(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
67 | 77 | } | |
68 | 78 |
github/deemru/w8io/026f985 18.80 ms ◑