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 a (b) = { | |
5 | - | let c = value(assetInfo(b)) | |
6 | - | c.name | |
4 | + | ||
5 | + | ||
6 | + | @Callable(a) | |
7 | + | func listAllAssets () = { | |
8 | + | let b = wavesBalance(this).regular | |
9 | + | let c = fromBase58String("DLNEWNp84wJuPMgKk1hQGLHxgormoukJJNjFRoV5n1j6") | |
10 | + | let d = assetBalance(this, c) | |
11 | + | let e = { | |
12 | + | let f = assetInfo(c) | |
13 | + | if ($isInstanceOf(f, "Asset")) | |
14 | + | then { | |
15 | + | let g = f | |
16 | + | $Tuple2(g.name, g.decimals) | |
17 | + | } | |
18 | + | else throw("Asset bilgisi bulunamadı") | |
19 | + | } | |
20 | + | let h = [IntegerEntry("waves_balance", b), StringEntry("asset_id", "DLNEWNp84wJuPMgKk1hQGLHxgormoukJJNjFRoV5n1j6"), StringEntry("asset_name", e._1), IntegerEntry("asset_balance", d), IntegerEntry("asset_decimals", e._2)] | |
21 | + | $Tuple2(h, unit) | |
7 | 22 | } | |
8 | 23 | ||
9 | 24 | ||
10 | - | @Callable(d) | |
11 | - | func transferToken (e,f,g) = { | |
12 | - | let h = addressFromStringValue(e) | |
13 | - | if ((f == "WAVES")) | |
25 | + | ||
26 | + | @Callable(a) | |
27 | + | func transferToken (i,j,k) = { | |
28 | + | let l = addressFromStringValue(i) | |
29 | + | if ((j == "WAVES")) | |
14 | 30 | then { | |
15 | - | let | |
16 | - | if (( | |
31 | + | let m = wavesBalance(this).regular | |
32 | + | if ((m >= k)) | |
17 | 33 | then { | |
18 | - | let | |
19 | - | let | |
20 | - | $Tuple2(( | |
34 | + | let n = ScriptTransfer(l, k, unit) | |
35 | + | let o = [BinaryEntry("lastTransferTxId", a.transactionId), StringEntry("lastRecipient", i), IntegerEntry("lastAmount", k), StringEntry("lastAsset", "WAVES")] | |
36 | + | $Tuple2((o :+ n), unit) | |
21 | 37 | } | |
22 | 38 | else throw("Yetersiz WAVES bakiyesi") | |
23 | 39 | } | |
24 | 40 | else { | |
25 | - | let | |
26 | - | let | |
27 | - | if (( | |
41 | + | let p = fromBase58String(j) | |
42 | + | let m = assetBalance(this, p) | |
43 | + | if ((m >= k)) | |
28 | 44 | then { | |
29 | - | let | |
30 | - | let | |
31 | - | $Tuple2(( | |
45 | + | let n = ScriptTransfer(l, k, p) | |
46 | + | let o = [BinaryEntry("lastTransferTxId", a.transactionId), StringEntry("lastRecipient", i), IntegerEntry("lastAmount", k), StringEntry("lastAsset", j)] | |
47 | + | $Tuple2((o :+ n), unit) | |
32 | 48 | } | |
33 | 49 | else throw("Yetersiz token bakiyesi") | |
34 | 50 | } | |
36 | 52 | ||
37 | 53 | ||
38 | 54 | ||
39 | - | @Callable( | |
40 | - | func getBalance ( | |
55 | + | @Callable(a) | |
56 | + | func getBalance (j) = if ((j == "WAVES")) | |
41 | 57 | then { | |
42 | - | let | |
43 | - | $Tuple2([StringEntry("queriedAsset", "WAVES"), IntegerEntry("balance", | |
58 | + | let q = wavesBalance(this).regular | |
59 | + | $Tuple2([StringEntry("queriedAsset", "WAVES"), IntegerEntry("balance", q)], q) | |
44 | 60 | } | |
45 | 61 | else { | |
46 | - | let b = fromBase58String(f) | |
47 | - | let l = assetBalance(this, b) | |
48 | - | $Tuple2([StringEntry("queriedAsset", f), IntegerEntry("balance", l)], l) | |
62 | + | let p = fromBase58String(j) | |
63 | + | let q = assetBalance(this, p) | |
64 | + | let e = { | |
65 | + | let f = assetInfo(p) | |
66 | + | if ($isInstanceOf(f, "Asset")) | |
67 | + | then { | |
68 | + | let g = f | |
69 | + | $Tuple2(g.name, g.decimals) | |
70 | + | } | |
71 | + | else throw("Asset bilgisi bulunamadı") | |
72 | + | } | |
73 | + | $Tuple2([StringEntry("queriedAsset", j), StringEntry("assetName", e._1), IntegerEntry("balance", q), IntegerEntry("decimals", e._2)], q) | |
49 | 74 | } | |
50 | 75 | ||
51 | 76 | ||
52 | - | ||
53 | - | @Callable(d) | |
54 | - | func listAllAssets () = { | |
55 | - | let m = wavesBalance(this).regular | |
56 | - | let n = [StringEntry("WAVES_balance", toString(m))] | |
57 | - | $Tuple2(n, unit) | |
58 | - | } | |
59 | - | ||
60 | - | ||
61 | - | @Verifier(o) | |
62 | - | func p () = { | |
63 | - | let q = o | |
64 | - | if ($isInstanceOf(q, "InvokeScriptTransaction")) | |
77 | + | @Verifier(r) | |
78 | + | func s () = { | |
79 | + | let f = r | |
80 | + | if ($isInstanceOf(f, "InvokeScriptTransaction")) | |
65 | 81 | then true | |
66 | - | else sigVerify_8Kb( | |
82 | + | else sigVerify_8Kb(r.bodyBytes, r.proofs[0], r.senderPublicKey) | |
67 | 83 | } | |
68 | 84 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 8 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | func a (b) = { | |
5 | - | let c = value(assetInfo(b)) | |
6 | - | c.name | |
4 | + | ||
5 | + | ||
6 | + | @Callable(a) | |
7 | + | func listAllAssets () = { | |
8 | + | let b = wavesBalance(this).regular | |
9 | + | let c = fromBase58String("DLNEWNp84wJuPMgKk1hQGLHxgormoukJJNjFRoV5n1j6") | |
10 | + | let d = assetBalance(this, c) | |
11 | + | let e = { | |
12 | + | let f = assetInfo(c) | |
13 | + | if ($isInstanceOf(f, "Asset")) | |
14 | + | then { | |
15 | + | let g = f | |
16 | + | $Tuple2(g.name, g.decimals) | |
17 | + | } | |
18 | + | else throw("Asset bilgisi bulunamadı") | |
19 | + | } | |
20 | + | let h = [IntegerEntry("waves_balance", b), StringEntry("asset_id", "DLNEWNp84wJuPMgKk1hQGLHxgormoukJJNjFRoV5n1j6"), StringEntry("asset_name", e._1), IntegerEntry("asset_balance", d), IntegerEntry("asset_decimals", e._2)] | |
21 | + | $Tuple2(h, unit) | |
7 | 22 | } | |
8 | 23 | ||
9 | 24 | ||
10 | - | @Callable(d) | |
11 | - | func transferToken (e,f,g) = { | |
12 | - | let h = addressFromStringValue(e) | |
13 | - | if ((f == "WAVES")) | |
25 | + | ||
26 | + | @Callable(a) | |
27 | + | func transferToken (i,j,k) = { | |
28 | + | let l = addressFromStringValue(i) | |
29 | + | if ((j == "WAVES")) | |
14 | 30 | then { | |
15 | - | let | |
16 | - | if (( | |
31 | + | let m = wavesBalance(this).regular | |
32 | + | if ((m >= k)) | |
17 | 33 | then { | |
18 | - | let | |
19 | - | let | |
20 | - | $Tuple2(( | |
34 | + | let n = ScriptTransfer(l, k, unit) | |
35 | + | let o = [BinaryEntry("lastTransferTxId", a.transactionId), StringEntry("lastRecipient", i), IntegerEntry("lastAmount", k), StringEntry("lastAsset", "WAVES")] | |
36 | + | $Tuple2((o :+ n), unit) | |
21 | 37 | } | |
22 | 38 | else throw("Yetersiz WAVES bakiyesi") | |
23 | 39 | } | |
24 | 40 | else { | |
25 | - | let | |
26 | - | let | |
27 | - | if (( | |
41 | + | let p = fromBase58String(j) | |
42 | + | let m = assetBalance(this, p) | |
43 | + | if ((m >= k)) | |
28 | 44 | then { | |
29 | - | let | |
30 | - | let | |
31 | - | $Tuple2(( | |
45 | + | let n = ScriptTransfer(l, k, p) | |
46 | + | let o = [BinaryEntry("lastTransferTxId", a.transactionId), StringEntry("lastRecipient", i), IntegerEntry("lastAmount", k), StringEntry("lastAsset", j)] | |
47 | + | $Tuple2((o :+ n), unit) | |
32 | 48 | } | |
33 | 49 | else throw("Yetersiz token bakiyesi") | |
34 | 50 | } | |
35 | 51 | } | |
36 | 52 | ||
37 | 53 | ||
38 | 54 | ||
39 | - | @Callable( | |
40 | - | func getBalance ( | |
55 | + | @Callable(a) | |
56 | + | func getBalance (j) = if ((j == "WAVES")) | |
41 | 57 | then { | |
42 | - | let | |
43 | - | $Tuple2([StringEntry("queriedAsset", "WAVES"), IntegerEntry("balance", | |
58 | + | let q = wavesBalance(this).regular | |
59 | + | $Tuple2([StringEntry("queriedAsset", "WAVES"), IntegerEntry("balance", q)], q) | |
44 | 60 | } | |
45 | 61 | else { | |
46 | - | let b = fromBase58String(f) | |
47 | - | let l = assetBalance(this, b) | |
48 | - | $Tuple2([StringEntry("queriedAsset", f), IntegerEntry("balance", l)], l) | |
62 | + | let p = fromBase58String(j) | |
63 | + | let q = assetBalance(this, p) | |
64 | + | let e = { | |
65 | + | let f = assetInfo(p) | |
66 | + | if ($isInstanceOf(f, "Asset")) | |
67 | + | then { | |
68 | + | let g = f | |
69 | + | $Tuple2(g.name, g.decimals) | |
70 | + | } | |
71 | + | else throw("Asset bilgisi bulunamadı") | |
72 | + | } | |
73 | + | $Tuple2([StringEntry("queriedAsset", j), StringEntry("assetName", e._1), IntegerEntry("balance", q), IntegerEntry("decimals", e._2)], q) | |
49 | 74 | } | |
50 | 75 | ||
51 | 76 | ||
52 | - | ||
53 | - | @Callable(d) | |
54 | - | func listAllAssets () = { | |
55 | - | let m = wavesBalance(this).regular | |
56 | - | let n = [StringEntry("WAVES_balance", toString(m))] | |
57 | - | $Tuple2(n, unit) | |
58 | - | } | |
59 | - | ||
60 | - | ||
61 | - | @Verifier(o) | |
62 | - | func p () = { | |
63 | - | let q = o | |
64 | - | if ($isInstanceOf(q, "InvokeScriptTransaction")) | |
77 | + | @Verifier(r) | |
78 | + | func s () = { | |
79 | + | let f = r | |
80 | + | if ($isInstanceOf(f, "InvokeScriptTransaction")) | |
65 | 81 | then true | |
66 | - | else sigVerify_8Kb( | |
82 | + | else sigVerify_8Kb(r.bodyBytes, r.proofs[0], r.senderPublicKey) | |
67 | 83 | } | |
68 | 84 |
github/deemru/w8io/026f985 30.33 ms ◑