tx · DsZWMNEt42YSdLa6Ezz1ei6ZyqHmDcHybWR6pxE8j6cT 3Mza5Ao6wJgpw1JG3jxRY1xigD44zgfhdK6: -0.04000000 Waves 2021.11.04 16:22 [1776309] smart account 3Mza5Ao6wJgpw1JG3jxRY1xigD44zgfhdK6 > SELF 0.00000000 Waves
{ "type": 13, "id": "DsZWMNEt42YSdLa6Ezz1ei6ZyqHmDcHybWR6pxE8j6cT", "fee": 4000000, "feeAssetId": null, "timestamp": 1636032122205, "version": 2, "chainId": 84, "sender": "3Mza5Ao6wJgpw1JG3jxRY1xigD44zgfhdK6", "senderPublicKey": "Gud7Z17wiZEMZiHRbn48k2D9H13jmLEDZZ8b7NCfjRJL", "proofs": [ "2BfUXuaeHDHPdnD7YLbRBGn45QcsB92zsbmuHRBBoyZg9NGBdD8TPmT5nP74Xq6t4QC13bAVfVFhmZ3dPDAciRwv" ], "script": "base64:AAIFAAAAAAAAAA8IAhIAEgMKAQESBAoCAQgAAAAAAAAAAwAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAADcG10AwkAAAAAAAACCQABkAAAAAEIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAACQAAAgAAAAECAAAAHEF0dGFjaGVkIHBheW1lbnQgaXMgcmVxdWlyZWQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAFXdvcmtzIHdpdGggd2F2ZXMgb25seQQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAAJbmV3QW1v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AB3NtYXJ0UEsEAAAABnNlY29uZAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAACHNlY29uZFBLBAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAXQFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9EYXRhVHJhbnNhY3Rpb24EAAAAAXQFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAAXQFAAAAByRtYXRjaDADBQAAAAVzbWFydAYFAAAABnNlY29uZAeBLsDb", "height": 1776309, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JBqHQLCwbB3aZ4hAR18k1BjBKy3GSepNRfpXiTGV81p9 Next: GBhXADtPKoS4CpCVewbi4PsMLYemj3cpy2LzXXcDf5xH Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(a) | |
7 | - | func call () = { | |
8 | - | let b = Issue("Asset", "", 1, 0, true, unit, 0) | |
9 | - | let c = calculateAssetId(b) | |
10 | - | [BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), b, Reissue(c, 1, false), Burn(c, 1), ScriptTransfer(a.caller, 1, c)] | |
11 | - | } | |
12 | - | ||
13 | - | ||
14 | - | ||
15 | - | @Callable(a) | |
16 | 7 | func deposit () = { | |
17 | - | let | |
8 | + | let b = if ((size(a.payments) == 1)) | |
18 | 9 | then a.payments[0] | |
19 | 10 | else throw("Attached payment is required") | |
20 | - | if (isDefined( | |
11 | + | if (isDefined(b.assetId)) | |
21 | 12 | then throw("works with waves only") | |
22 | 13 | else { | |
23 | - | let | |
24 | - | let | |
25 | - | let | |
26 | - | if ($isInstanceOf( | |
14 | + | let c = toBase58String(a.caller.bytes) | |
15 | + | let d = { | |
16 | + | let e = getInteger(this, c) | |
17 | + | if ($isInstanceOf(e, "Int")) | |
27 | 18 | then { | |
28 | - | let | |
29 | - | | |
19 | + | let f = e | |
20 | + | f | |
30 | 21 | } | |
31 | 22 | else 0 | |
32 | 23 | } | |
33 | - | let | |
34 | - | $Tuple2([IntegerEntry( | |
24 | + | let g = (d + b.amount) | |
25 | + | $Tuple2([IntegerEntry(c, g)], unit) | |
35 | 26 | } | |
36 | 27 | } | |
37 | 28 | ||
38 | 29 | ||
39 | 30 | ||
40 | 31 | @Callable(a) | |
41 | - | func withdraw ( | |
42 | - | let | |
43 | - | let | |
44 | - | let | |
45 | - | if ($isInstanceOf( | |
32 | + | func withdraw (h) = { | |
33 | + | let c = toBase58String(a.caller.bytes) | |
34 | + | let d = { | |
35 | + | let e = getInteger(this, c) | |
36 | + | if ($isInstanceOf(e, "Int")) | |
46 | 37 | then { | |
47 | - | let | |
48 | - | | |
38 | + | let f = e | |
39 | + | f | |
49 | 40 | } | |
50 | 41 | else 0 | |
51 | 42 | } | |
52 | - | let | |
53 | - | if ((0 > | |
43 | + | let g = (d - h) | |
44 | + | if ((0 > h)) | |
54 | 45 | then throw("Can't withdraw negative amount") | |
55 | - | else if ((0 > | |
46 | + | else if ((0 > g)) | |
56 | 47 | then throw("Not enough balance") | |
57 | - | else $Tuple2([IntegerEntry( | |
48 | + | else $Tuple2([IntegerEntry(c, g), ScriptTransfer(a.caller, h, unit)], unit) | |
58 | 49 | } | |
59 | 50 | ||
60 | 51 | ||
61 | 52 | ||
62 | 53 | @Callable(a) | |
63 | - | func transfer ( | |
64 | - | let | |
65 | - | let | |
66 | - | let | |
67 | - | if ($isInstanceOf( | |
54 | + | func transfer (h,i) = { | |
55 | + | let c = toBase58String(a.caller.bytes) | |
56 | + | let d = { | |
57 | + | let e = getInteger(this, c) | |
58 | + | if ($isInstanceOf(e, "Int")) | |
68 | 59 | then { | |
69 | - | let | |
70 | - | | |
60 | + | let f = e | |
61 | + | f | |
71 | 62 | } | |
72 | 63 | else 0 | |
73 | 64 | } | |
74 | - | let | |
75 | - | if ((0 > | |
76 | - | then throw("Can't | |
77 | - | else if ((0 > | |
65 | + | let g = (d - h) | |
66 | + | if ((0 > h)) | |
67 | + | then throw("Can't transfer negative amount") | |
68 | + | else if ((0 > g)) | |
78 | 69 | then throw("Not enough balance") | |
79 | 70 | else { | |
80 | - | let | |
81 | - | let | |
82 | - | let | |
83 | - | if ($isInstanceOf( | |
71 | + | let j = toBase58String(Address(fromBase58String(i)).bytes) | |
72 | + | let k = { | |
73 | + | let e = getInteger(this, j) | |
74 | + | if ($isInstanceOf(e, "Int")) | |
84 | 75 | then { | |
85 | - | let | |
86 | - | | |
76 | + | let f = e | |
77 | + | f | |
87 | 78 | } | |
88 | 79 | else 0 | |
89 | 80 | } | |
90 | - | $Tuple2([IntegerEntry( | |
81 | + | $Tuple2([IntegerEntry(c, g), IntegerEntry(j, (k + h))], unit) | |
91 | 82 | } | |
92 | 83 | } | |
93 | 84 | ||
94 | 85 | ||
95 | - | @Verifier( | |
96 | - | func | |
97 | - | let | |
98 | - | let | |
99 | - | let | |
100 | - | let | |
101 | - | let | |
102 | - | if ($isInstanceOf( | |
86 | + | @Verifier(l) | |
87 | + | func m () = { | |
88 | + | let n = base58'Gud7Z17wiZEMZiHRbn48k2D9H13jmLEDZZ8b7NCfjRJL' | |
89 | + | let o = base58'CwvKLDcXt3Wd2MEyEemVKawiD7gaCV68wh2GcnJRHFqB' | |
90 | + | let p = sigVerify(l.bodyBytes, l.proofs[0], n) | |
91 | + | let q = sigVerify(l.bodyBytes, l.proofs[0], o) | |
92 | + | let e = l | |
93 | + | if ($isInstanceOf(e, "SetScriptTransaction")) | |
103 | 94 | then { | |
104 | - | let | |
95 | + | let r = e | |
105 | 96 | true | |
106 | 97 | } | |
107 | - | else if ($isInstanceOf( | |
98 | + | else if ($isInstanceOf(e, "DataTransaction")) | |
108 | 99 | then { | |
109 | - | let | |
100 | + | let r = e | |
110 | 101 | true | |
111 | 102 | } | |
112 | - | else if ($isInstanceOf( | |
103 | + | else if ($isInstanceOf(e, "InvokeScriptTransaction")) | |
113 | 104 | then { | |
114 | - | let | |
105 | + | let r = e | |
115 | 106 | true | |
116 | 107 | } | |
117 | - | else if ($isInstanceOf( | |
108 | + | else if ($isInstanceOf(e, "TransferTransaction")) | |
118 | 109 | then { | |
119 | - | let | |
120 | - | if ( | |
110 | + | let r = e | |
111 | + | if (p) | |
121 | 112 | then true | |
122 | - | else | |
113 | + | else q | |
123 | 114 | } | |
124 | 115 | else false | |
125 | 116 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(a) | |
7 | - | func call () = { | |
8 | - | let b = Issue("Asset", "", 1, 0, true, unit, 0) | |
9 | - | let c = calculateAssetId(b) | |
10 | - | [BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), b, Reissue(c, 1, false), Burn(c, 1), ScriptTransfer(a.caller, 1, c)] | |
11 | - | } | |
12 | - | ||
13 | - | ||
14 | - | ||
15 | - | @Callable(a) | |
16 | 7 | func deposit () = { | |
17 | - | let | |
8 | + | let b = if ((size(a.payments) == 1)) | |
18 | 9 | then a.payments[0] | |
19 | 10 | else throw("Attached payment is required") | |
20 | - | if (isDefined( | |
11 | + | if (isDefined(b.assetId)) | |
21 | 12 | then throw("works with waves only") | |
22 | 13 | else { | |
23 | - | let | |
24 | - | let | |
25 | - | let | |
26 | - | if ($isInstanceOf( | |
14 | + | let c = toBase58String(a.caller.bytes) | |
15 | + | let d = { | |
16 | + | let e = getInteger(this, c) | |
17 | + | if ($isInstanceOf(e, "Int")) | |
27 | 18 | then { | |
28 | - | let | |
29 | - | | |
19 | + | let f = e | |
20 | + | f | |
30 | 21 | } | |
31 | 22 | else 0 | |
32 | 23 | } | |
33 | - | let | |
34 | - | $Tuple2([IntegerEntry( | |
24 | + | let g = (d + b.amount) | |
25 | + | $Tuple2([IntegerEntry(c, g)], unit) | |
35 | 26 | } | |
36 | 27 | } | |
37 | 28 | ||
38 | 29 | ||
39 | 30 | ||
40 | 31 | @Callable(a) | |
41 | - | func withdraw ( | |
42 | - | let | |
43 | - | let | |
44 | - | let | |
45 | - | if ($isInstanceOf( | |
32 | + | func withdraw (h) = { | |
33 | + | let c = toBase58String(a.caller.bytes) | |
34 | + | let d = { | |
35 | + | let e = getInteger(this, c) | |
36 | + | if ($isInstanceOf(e, "Int")) | |
46 | 37 | then { | |
47 | - | let | |
48 | - | | |
38 | + | let f = e | |
39 | + | f | |
49 | 40 | } | |
50 | 41 | else 0 | |
51 | 42 | } | |
52 | - | let | |
53 | - | if ((0 > | |
43 | + | let g = (d - h) | |
44 | + | if ((0 > h)) | |
54 | 45 | then throw("Can't withdraw negative amount") | |
55 | - | else if ((0 > | |
46 | + | else if ((0 > g)) | |
56 | 47 | then throw("Not enough balance") | |
57 | - | else $Tuple2([IntegerEntry( | |
48 | + | else $Tuple2([IntegerEntry(c, g), ScriptTransfer(a.caller, h, unit)], unit) | |
58 | 49 | } | |
59 | 50 | ||
60 | 51 | ||
61 | 52 | ||
62 | 53 | @Callable(a) | |
63 | - | func transfer ( | |
64 | - | let | |
65 | - | let | |
66 | - | let | |
67 | - | if ($isInstanceOf( | |
54 | + | func transfer (h,i) = { | |
55 | + | let c = toBase58String(a.caller.bytes) | |
56 | + | let d = { | |
57 | + | let e = getInteger(this, c) | |
58 | + | if ($isInstanceOf(e, "Int")) | |
68 | 59 | then { | |
69 | - | let | |
70 | - | | |
60 | + | let f = e | |
61 | + | f | |
71 | 62 | } | |
72 | 63 | else 0 | |
73 | 64 | } | |
74 | - | let | |
75 | - | if ((0 > | |
76 | - | then throw("Can't | |
77 | - | else if ((0 > | |
65 | + | let g = (d - h) | |
66 | + | if ((0 > h)) | |
67 | + | then throw("Can't transfer negative amount") | |
68 | + | else if ((0 > g)) | |
78 | 69 | then throw("Not enough balance") | |
79 | 70 | else { | |
80 | - | let | |
81 | - | let | |
82 | - | let | |
83 | - | if ($isInstanceOf( | |
71 | + | let j = toBase58String(Address(fromBase58String(i)).bytes) | |
72 | + | let k = { | |
73 | + | let e = getInteger(this, j) | |
74 | + | if ($isInstanceOf(e, "Int")) | |
84 | 75 | then { | |
85 | - | let | |
86 | - | | |
76 | + | let f = e | |
77 | + | f | |
87 | 78 | } | |
88 | 79 | else 0 | |
89 | 80 | } | |
90 | - | $Tuple2([IntegerEntry( | |
81 | + | $Tuple2([IntegerEntry(c, g), IntegerEntry(j, (k + h))], unit) | |
91 | 82 | } | |
92 | 83 | } | |
93 | 84 | ||
94 | 85 | ||
95 | - | @Verifier( | |
96 | - | func | |
97 | - | let | |
98 | - | let | |
99 | - | let | |
100 | - | let | |
101 | - | let | |
102 | - | if ($isInstanceOf( | |
86 | + | @Verifier(l) | |
87 | + | func m () = { | |
88 | + | let n = base58'Gud7Z17wiZEMZiHRbn48k2D9H13jmLEDZZ8b7NCfjRJL' | |
89 | + | let o = base58'CwvKLDcXt3Wd2MEyEemVKawiD7gaCV68wh2GcnJRHFqB' | |
90 | + | let p = sigVerify(l.bodyBytes, l.proofs[0], n) | |
91 | + | let q = sigVerify(l.bodyBytes, l.proofs[0], o) | |
92 | + | let e = l | |
93 | + | if ($isInstanceOf(e, "SetScriptTransaction")) | |
103 | 94 | then { | |
104 | - | let | |
95 | + | let r = e | |
105 | 96 | true | |
106 | 97 | } | |
107 | - | else if ($isInstanceOf( | |
98 | + | else if ($isInstanceOf(e, "DataTransaction")) | |
108 | 99 | then { | |
109 | - | let | |
100 | + | let r = e | |
110 | 101 | true | |
111 | 102 | } | |
112 | - | else if ($isInstanceOf( | |
103 | + | else if ($isInstanceOf(e, "InvokeScriptTransaction")) | |
113 | 104 | then { | |
114 | - | let | |
105 | + | let r = e | |
115 | 106 | true | |
116 | 107 | } | |
117 | - | else if ($isInstanceOf( | |
108 | + | else if ($isInstanceOf(e, "TransferTransaction")) | |
118 | 109 | then { | |
119 | - | let | |
120 | - | if ( | |
110 | + | let r = e | |
111 | + | if (p) | |
121 | 112 | then true | |
122 | - | else | |
113 | + | else q | |
123 | 114 | } | |
124 | 115 | else false | |
125 | 116 | } | |
126 | 117 |
github/deemru/w8io/169f3d6 48.43 ms ◑