tx · 4TgRwQ2rZ6jxcA7u1rDp4SHVvoGxomJ7qENhAs5dt3Wo 3N5TDZHiXyXByfTA47imbhEqAbzAupJR5xY: -0.01000000 Waves 2022.11.23 00:10 [2328853] smart account 3N5TDZHiXyXByfTA47imbhEqAbzAupJR5xY > SELF 0.00000000 Waves
{ "type": 13, "id": "4TgRwQ2rZ6jxcA7u1rDp4SHVvoGxomJ7qENhAs5dt3Wo", "fee": 1000000, "feeAssetId": null, "timestamp": 1669151479999, "version": 2, "chainId": 84, "sender": "3N5TDZHiXyXByfTA47imbhEqAbzAupJR5xY", "senderPublicKey": "9rkQ1ChfNZ585cJFqVhjLk1mTNMXT93CZidHoYERtHML", "proofs": [ "4SW7PqPy5ZsJSEPeAVK94AwmyFxj4Xj1hWv7FbNbV3XBnnq7yqQCkRgQb1m89m4nXZ1JakozmECo8wQat924BELA" ], "script": "base64:BgIXCAISBAoCCAgSAwoBCBIGCgQICAEBEgAYAANTRVACAl9fAAVFTVBUWQIAAAlQUkVDSVNJT04AgICQu7rWrfANAAhERUNJTUFMUwCAwtcvAAlXRVNUX1BBUlQJAGkCBQlQUkVDSVNJT04ABQAQSWR4QXNzZXRDb250cmFjdAABABRJZHhBc3NldEJhY2tpbmdSYXRpbwACAQtrZXlBc3NldENmZwEMYmFzZUFzc2V0U3RyCQC5CQIJAMwIAgIGJXMlcyVzCQDMCAICBmNvbmZpZwkAzAgCAgVhc3NldAkAzAgCBQxiYXNlQXNzZXRTdHIFA25pbAUDU0VQAQ5rZXlJbml0aWFsaXplZAAJALkJAgkAzAgCAgIlcwkAzAgCAgtpbml0aWFsaXplZAUDbmlsBQNTRVABCGtleUFkbWluAAkAuQkCCQDMCAICAiVzCQDMCAICBWFkbWluBQNuaWwFA1NFUAEMa2V5RWFzdEFzc2V0AAkAuQkCCQDMCAICAiVzCQDMCAICCWVhc3RBc3NldAUDbmlsBQNTRVABDGtleVdlc3RBc3NldAAJALkJAgkAzAgCAgIlcwkAzAgCAgl3ZXN0QXN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q2ZnBQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BaQEEbWludAAEB3BheW1lbnQJAJEDAggFAWkIcGF5bWVudHMAAAMJAQIhPQIJAJADAQgFAWkIcGF5bWVudHMAAQkAAgECFVdyb25nIHBheW1lbnRzIGFtb3VudAQHYXNzZXRJZAQHJG1hdGNoMAgFB3BheW1lbnQHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAJpZAUHJG1hdGNoMAkA2AQBBQJpZAMJAAECBQckbWF0Y2gwAgRVbml0BAV3YXZlcwUHJG1hdGNoMAIFV0FWRVMJAAIBAgtNYXRjaCBlcnJvcgQIYXNzZXRDZmcJALUJAgkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCiCAEJAQtrZXlBc3NldENmZwEFB2Fzc2V0SWQCDVVua25vd24gYXNzZXQFA1NFUAQKY29udHJhY3RJZAkAkQMCBQhhc3NldENmZwUQSWR4QXNzZXRDb250cmFjdAQMYmFja2luZ1JhdGlvCQCRAwIFCGFzc2V0Q2ZnBRRJZHhBc3NldEJhY2tpbmdSYXRpbwQBeAkAAgEJAKwCAgUKY29udHJhY3RJZAUMYmFja2luZ1JhdGlvBQNuaWwBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5Xwznug==", "height": 2328853, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: C5oyaBp1iehmgGE7G72THfrhpKjSYgMGcSgxmVkzJSCk Next: Hj4M7iET1tsJWeQy8Le2kunqrVvPf9guYdjaXza1wSCT Diff:
Old | New | Differences | |
---|---|---|---|
85 | 85 | func G (q,r) = { | |
86 | 86 | let H = Address(fromBase58String(r)) | |
87 | 87 | let I = valueOrErrorMessage(getString(H, o()), "Wrong contract id") | |
88 | - | if (if (( | |
88 | + | if (if ((q != "WAVES")) | |
89 | 89 | then (I != q) | |
90 | 90 | else false) | |
91 | 91 | then throw("Wrong asset id") |
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 | let f = 1 | |
15 | 15 | ||
16 | 16 | let g = 2 | |
17 | 17 | ||
18 | 18 | func h (i) = makeString(["%s%s%s", "config", "asset", i], a) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func j () = makeString(["%s", "initialized"], a) | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func k () = makeString(["%s", "admin"], a) | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func l () = makeString(["%s", "eastAsset"], a) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func m () = makeString(["%s", "westAsset"], a) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func n () = makeString(["%s", "assetStorage"], a) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func o () = "B_asset_id" | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func p (q,r,s,t) = makeString(["%s%s%d%d", q, r, toString(s), toString(t)], a) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func u () = valueOrElse(getBoolean(this, j()), false) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func v (w) = (this == w.caller) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func x () = { | |
49 | 49 | let y = getString(this, k()) | |
50 | 50 | if ($isInstanceOf(y, "String")) | |
51 | 51 | then { | |
52 | 52 | let z = y | |
53 | 53 | Address(fromBase58String(z)) | |
54 | 54 | } | |
55 | 55 | else if ($isInstanceOf(y, "Unit")) | |
56 | 56 | then unit | |
57 | 57 | else throw("Match error") | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func A () = getStringValue(this, l()) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func B (C) = valueOrElse(getInteger(this, C), 0) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func D (w) = { | |
68 | 68 | let E = throw("permission denied") | |
69 | 69 | let y = x() | |
70 | 70 | if ($isInstanceOf(y, "Address")) | |
71 | 71 | then { | |
72 | 72 | let F = y | |
73 | 73 | if ((w.caller == F)) | |
74 | 74 | then true | |
75 | 75 | else E | |
76 | 76 | } | |
77 | 77 | else if ($isInstanceOf(y, "Unit")) | |
78 | 78 | then if ((w.caller == this)) | |
79 | 79 | then true | |
80 | 80 | else E | |
81 | 81 | else throw("Match error") | |
82 | 82 | } | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func G (q,r) = { | |
86 | 86 | let H = Address(fromBase58String(r)) | |
87 | 87 | let I = valueOrErrorMessage(getString(H, o()), "Wrong contract id") | |
88 | - | if (if (( | |
88 | + | if (if ((q != "WAVES")) | |
89 | 89 | then (I != q) | |
90 | 90 | else false) | |
91 | 91 | then throw("Wrong asset id") | |
92 | 92 | else nil | |
93 | 93 | } | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func J (K) = { | |
97 | 97 | let y = addressFromString(K) | |
98 | 98 | if ($isInstanceOf(y, "Address")) | |
99 | 99 | then { | |
100 | 100 | let F = y | |
101 | 101 | true | |
102 | 102 | } | |
103 | 103 | else if ($isInstanceOf(y, "Unit")) | |
104 | 104 | then throw("Invalid address") | |
105 | 105 | else throw("Match error") | |
106 | 106 | } | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func L (M) = if (if ((M > 0)) | |
110 | 110 | then (300 > M) | |
111 | 111 | else false) | |
112 | 112 | then true | |
113 | 113 | else throw("Out of range") | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | @Callable(w) | |
117 | 117 | func initialize (N,O) = if (if (u()) | |
118 | 118 | then v(w) | |
119 | 119 | else false) | |
120 | 120 | then throw("Not allowed") | |
121 | 121 | else { | |
122 | 122 | let P = Issue("East", "", 0, 8, true, unit, 0) | |
123 | 123 | let Q = calculateAssetId(P) | |
124 | 124 | [StringEntry(l(), toBase58String(Q)), StringEntry(m(), O), BooleanEntry(j(), true)] | |
125 | 125 | } | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | ||
129 | 129 | @Callable(w) | |
130 | 130 | func setAdmin (K) = { | |
131 | 131 | let R = if (if (u()) | |
132 | 132 | then D(w) | |
133 | 133 | else false) | |
134 | 134 | then J(K) | |
135 | 135 | else false | |
136 | 136 | if ((R == R)) | |
137 | 137 | then if (!(R)) | |
138 | 138 | then throw("Not allowed") | |
139 | 139 | else [StringEntry(k(), K)] | |
140 | 140 | else throw("Strict value is not equal to itself.") | |
141 | 141 | } | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | ||
145 | 145 | @Callable(w) | |
146 | 146 | func adminSetAsset (q,r,s,t) = { | |
147 | 147 | let S = if (u()) | |
148 | 148 | then D(w) | |
149 | 149 | else false | |
150 | 150 | if ((S == S)) | |
151 | 151 | then if (!(S)) | |
152 | 152 | then throw("Not allowed") | |
153 | 153 | else { | |
154 | 154 | let T = getStringValue(m()) | |
155 | 155 | if ((T == q)) | |
156 | 156 | then throw("West asset is not allowed") | |
157 | 157 | else { | |
158 | 158 | let U = [G(q, r), L(s), L(t)] | |
159 | 159 | if ((U == U)) | |
160 | 160 | then { | |
161 | 161 | let V = p(q, r, s, t) | |
162 | 162 | [StringEntry(h(q), V)] | |
163 | 163 | } | |
164 | 164 | else throw("Strict value is not equal to itself.") | |
165 | 165 | } | |
166 | 166 | } | |
167 | 167 | else throw("Strict value is not equal to itself.") | |
168 | 168 | } | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | ||
172 | 172 | @Callable(w) | |
173 | 173 | func mint () = { | |
174 | 174 | let W = w.payments[0] | |
175 | 175 | if ((size(w.payments) != 1)) | |
176 | 176 | then throw("Wrong payments amount") | |
177 | 177 | else { | |
178 | 178 | let I = { | |
179 | 179 | let y = W.assetId | |
180 | 180 | if ($isInstanceOf(y, "ByteVector")) | |
181 | 181 | then { | |
182 | 182 | let X = y | |
183 | 183 | toBase58String(X) | |
184 | 184 | } | |
185 | 185 | else if ($isInstanceOf(y, "Unit")) | |
186 | 186 | then { | |
187 | 187 | let Y = y | |
188 | 188 | "WAVES" | |
189 | 189 | } | |
190 | 190 | else throw("Match error") | |
191 | 191 | } | |
192 | 192 | let V = split(valueOrErrorMessage(getString(h(I)), "Unknown asset"), a) | |
193 | 193 | let H = V[f] | |
194 | 194 | let Z = V[g] | |
195 | 195 | let aa = throw((H + Z)) | |
196 | 196 | nil | |
197 | 197 | } | |
198 | 198 | } | |
199 | 199 | ||
200 | 200 | ||
201 | 201 | @Verifier(ab) | |
202 | 202 | func ac () = sigVerify(ab.bodyBytes, ab.proofs[0], ab.senderPublicKey) | |
203 | 203 |
github/deemru/w8io/026f985 31.54 ms ◑