tx · 9PwexppAvEuzWqshMVjCXUg6mhJG49fn6UtqMGh2tYJo 3N5TDZHiXyXByfTA47imbhEqAbzAupJR5xY: -0.01000000 Waves 2022.11.22 21:42 [2328694] smart account 3N5TDZHiXyXByfTA47imbhEqAbzAupJR5xY > SELF 0.00000000 Waves
{ "type": 13, "id": "9PwexppAvEuzWqshMVjCXUg6mhJG49fn6UtqMGh2tYJo", "fee": 1000000, "feeAssetId": null, "timestamp": 1669142546629, "version": 2, "chainId": 84, "sender": "3N5TDZHiXyXByfTA47imbhEqAbzAupJR5xY", "senderPublicKey": "9rkQ1ChfNZ585cJFqVhjLk1mTNMXT93CZidHoYERtHML", "proofs": [ "YViiGutBmSqCoh3QR2mqVL8LDTCztzMjD4Av7m448acG4xs3dKCn6gn6D8FwhDRT57gYPFdbjUJ6KBWwh1Yvavb" ], "script": "base64:BgIaCAISBAoCCAgSAwoBCBIDCgEIEgYKBAgIAQEUAANTRVACAl9fAAVFTVBUWQIAAAlQUkVDSVNJT04AgICQu7rWrfANAAhERUNJTUFMUwCAwtcvAAlXRVNUX1BBUlQJAGkCBQlQUkVDSVNJT04ABQELa2V5QXNzZXRDZmcBDGJhc2VBc3NldFN0cgkAuQkCCQDMCAICBiVzJXMlcwkAzAgCAgZjb25maWcJAMwIAgIFYXNzZXQJAMwIAgUMYmFzZUFzc2V0U3RyBQNuaWwFA1NFUAEOa2V5SW5pdGlhbGl6ZWQACQC5CQIJAMwIAgICJXMJAMwIAgILaW5pdGlhbGl6ZWQFA25pbAUDU0VQAQhrZXlBZG1pbgAJALkJAgkAzAgCAgIlcwkAzAgCAgVhZG1pbgUDbmlsBQNTRVABDGtleUVhc3RBc3NldAAJALkJAgkAzAgCAgIlcwkAzAgCAgllYXN0QXNzZXQFA25pbAUDU0VQAQxrZXlXZXN0QXNzZXQACQC5CQIJAMwIAgICJXMJAMwIAgIJd2VzdEFzc2V0BQNuaWwFA1NFUAEPa2V5QXNzZXRTdG9yYWdlAAkAuQkCCQDMCAICA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XF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkK0nU4", "height": 2328694, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6a7JYocrJow4W7uQF54hFEMez5X5kmbhosamSNeCSw5N Next: 4RVNdkzG28UGL3SwiGqBYrZa5S4U29cumRBA6mhp97zh Diff:
Old | New | Differences | |
---|---|---|---|
105 | 105 | ||
106 | 106 | ||
107 | 107 | @Callable(u) | |
108 | - | func setAdmin (M) = [StringEntry(i(), M)] | |
108 | + | func setAdmin (M) = { | |
109 | + | let N = Address(fromBase58String(M)) | |
110 | + | if ((N == N)) | |
111 | + | then [StringEntry(i(), M)] | |
112 | + | else throw("Strict value is not equal to itself.") | |
113 | + | } | |
109 | 114 | ||
110 | 115 | ||
111 | 116 | ||
112 | 117 | @Callable(u) | |
113 | 118 | func adminSetAssetStorage (M) = { | |
114 | - | let | |
119 | + | let O = if (s()) | |
115 | 120 | then A(u) | |
116 | 121 | else false | |
117 | - | if (( | |
118 | - | then if (!( | |
122 | + | if ((O == O)) | |
123 | + | then if (!(O)) | |
119 | 124 | then throw("Not allowed") | |
120 | 125 | else [StringEntry(l(), M)] | |
121 | 126 | else throw("Strict value is not equal to itself.") | |
125 | 130 | ||
126 | 131 | @Callable(u) | |
127 | 132 | func adminSetAsset (p,o,q,r) = { | |
128 | - | let | |
133 | + | let P = if (s()) | |
129 | 134 | then A(u) | |
130 | 135 | else false | |
131 | - | if (( | |
132 | - | then if (!( | |
136 | + | if ((P == P)) | |
137 | + | then if (!(P)) | |
133 | 138 | then throw("Not allowed") | |
134 | 139 | else { | |
135 | - | let | |
136 | - | if (( | |
140 | + | let Q = getStringValue(k()) | |
141 | + | if ((Q == p)) | |
137 | 142 | then throw("West asset is not allowed") | |
138 | 143 | else { | |
139 | - | let | |
140 | - | if (( | |
144 | + | let R = [D(p, o), G(q), G(r)] | |
145 | + | if ((R == R)) | |
141 | 146 | then { | |
142 | - | let | |
143 | - | [StringEntry(f(p), | |
147 | + | let S = n(o, p, q, r) | |
148 | + | [StringEntry(f(p), S)] | |
144 | 149 | } | |
145 | 150 | else throw("Strict value is not equal to itself.") | |
146 | 151 | } | |
149 | 154 | } | |
150 | 155 | ||
151 | 156 | ||
152 | - | @Verifier( | |
153 | - | func | |
157 | + | @Verifier(T) | |
158 | + | func U () = sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey) | |
154 | 159 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | 6 | let b = "" | |
7 | 7 | ||
8 | 8 | let c = 1000000000000000000 | |
9 | 9 | ||
10 | 10 | let d = 100000000 | |
11 | 11 | ||
12 | 12 | let e = (c / 5) | |
13 | 13 | ||
14 | 14 | func f (g) = makeString(["%s%s%s", "config", "asset", g], a) | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func h () = makeString(["%s", "initialized"], a) | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func i () = makeString(["%s", "admin"], a) | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func j () = makeString(["%s", "eastAsset"], a) | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func k () = makeString(["%s", "westAsset"], a) | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func l () = makeString(["%s", "assetStorage"], a) | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func m () = "B_asset_id" | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func n (o,p,q,r) = makeString(["%s%s%d%d", o, p, toString(q), toString(r)], a) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func s () = valueOrElse(getBoolean(this, h()), false) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func t (u) = (this == u.caller) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func v () = { | |
45 | 45 | let w = getString(this, i()) | |
46 | 46 | if ($isInstanceOf(w, "String")) | |
47 | 47 | then { | |
48 | 48 | let x = w | |
49 | 49 | Address(fromBase58String(x)) | |
50 | 50 | } | |
51 | 51 | else if ($isInstanceOf(w, "Unit")) | |
52 | 52 | then unit | |
53 | 53 | else throw("Match error") | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func y (z) = valueOrElse(getInteger(this, z), 0) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func A (u) = { | |
61 | 61 | let B = throw("permission denied") | |
62 | 62 | let w = v() | |
63 | 63 | if ($isInstanceOf(w, "Address")) | |
64 | 64 | then { | |
65 | 65 | let C = w | |
66 | 66 | if ((u.caller == C)) | |
67 | 67 | then true | |
68 | 68 | else B | |
69 | 69 | } | |
70 | 70 | else if ($isInstanceOf(w, "Unit")) | |
71 | 71 | then if ((u.caller == this)) | |
72 | 72 | then true | |
73 | 73 | else B | |
74 | 74 | else throw("Match error") | |
75 | 75 | } | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func D (p,o) = { | |
79 | 79 | let E = Address(fromBase58String(o)) | |
80 | 80 | let F = valueOrErrorMessage(getString(E, m()), "Wrong contract id") | |
81 | 81 | if ((F != p)) | |
82 | 82 | then throw("Wrong asset id") | |
83 | 83 | else nil | |
84 | 84 | } | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func G (H) = if (if ((H > 0)) | |
88 | 88 | then (300 > H) | |
89 | 89 | else false) | |
90 | 90 | then true | |
91 | 91 | else throw("Out of range") | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | @Callable(u) | |
95 | 95 | func initialize (I,J) = if (if (s()) | |
96 | 96 | then t(u) | |
97 | 97 | else false) | |
98 | 98 | then throw("Not allowed") | |
99 | 99 | else { | |
100 | 100 | let K = Issue("East", "", 0, 8, true, unit, 0) | |
101 | 101 | let L = calculateAssetId(K) | |
102 | 102 | [StringEntry(j(), toBase58String(L)), StringEntry(k(), J), BooleanEntry(h(), true)] | |
103 | 103 | } | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | ||
107 | 107 | @Callable(u) | |
108 | - | func setAdmin (M) = [StringEntry(i(), M)] | |
108 | + | func setAdmin (M) = { | |
109 | + | let N = Address(fromBase58String(M)) | |
110 | + | if ((N == N)) | |
111 | + | then [StringEntry(i(), M)] | |
112 | + | else throw("Strict value is not equal to itself.") | |
113 | + | } | |
109 | 114 | ||
110 | 115 | ||
111 | 116 | ||
112 | 117 | @Callable(u) | |
113 | 118 | func adminSetAssetStorage (M) = { | |
114 | - | let | |
119 | + | let O = if (s()) | |
115 | 120 | then A(u) | |
116 | 121 | else false | |
117 | - | if (( | |
118 | - | then if (!( | |
122 | + | if ((O == O)) | |
123 | + | then if (!(O)) | |
119 | 124 | then throw("Not allowed") | |
120 | 125 | else [StringEntry(l(), M)] | |
121 | 126 | else throw("Strict value is not equal to itself.") | |
122 | 127 | } | |
123 | 128 | ||
124 | 129 | ||
125 | 130 | ||
126 | 131 | @Callable(u) | |
127 | 132 | func adminSetAsset (p,o,q,r) = { | |
128 | - | let | |
133 | + | let P = if (s()) | |
129 | 134 | then A(u) | |
130 | 135 | else false | |
131 | - | if (( | |
132 | - | then if (!( | |
136 | + | if ((P == P)) | |
137 | + | then if (!(P)) | |
133 | 138 | then throw("Not allowed") | |
134 | 139 | else { | |
135 | - | let | |
136 | - | if (( | |
140 | + | let Q = getStringValue(k()) | |
141 | + | if ((Q == p)) | |
137 | 142 | then throw("West asset is not allowed") | |
138 | 143 | else { | |
139 | - | let | |
140 | - | if (( | |
144 | + | let R = [D(p, o), G(q), G(r)] | |
145 | + | if ((R == R)) | |
141 | 146 | then { | |
142 | - | let | |
143 | - | [StringEntry(f(p), | |
147 | + | let S = n(o, p, q, r) | |
148 | + | [StringEntry(f(p), S)] | |
144 | 149 | } | |
145 | 150 | else throw("Strict value is not equal to itself.") | |
146 | 151 | } | |
147 | 152 | } | |
148 | 153 | else throw("Strict value is not equal to itself.") | |
149 | 154 | } | |
150 | 155 | ||
151 | 156 | ||
152 | - | @Verifier( | |
153 | - | func | |
157 | + | @Verifier(T) | |
158 | + | func U () = sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey) | |
154 | 159 |
github/deemru/w8io/026f985 32.72 ms ◑