tx · C5oyaBp1iehmgGE7G72THfrhpKjSYgMGcSgxmVkzJSCk 3N5TDZHiXyXByfTA47imbhEqAbzAupJR5xY: -0.01000000 Waves 2022.11.23 00:10 [2328853] smart account 3N5TDZHiXyXByfTA47imbhEqAbzAupJR5xY > SELF 0.00000000 Waves
{ "type": 13, "id": "C5oyaBp1iehmgGE7G72THfrhpKjSYgMGcSgxmVkzJSCk", "fee": 1000000, "feeAssetId": null, "timestamp": 1669151452644, "version": 2, "chainId": 84, "sender": "3N5TDZHiXyXByfTA47imbhEqAbzAupJR5xY", "senderPublicKey": "9rkQ1ChfNZ585cJFqVhjLk1mTNMXT93CZidHoYERtHML", "proofs": [ "5WuzC6Qy5qGExrVHeQpMDEbtijxVa21rV9erp5MTXJm7Bdhg4HnGMCE2JAVEBc9ddyiHoQZxQsLduV32ULFt1rut" ], "script": "base64:BgIXCAISBAoCCAgSAwoBCBIGCgQICAEBEgAYAANTRVACAl9fAAVFTVBUWQIAAAlQUkVDSVNJT04AgICQu7rWrfANAAhERUNJTUFMUwCAwtcvAAlXRVNUX1BBUlQJAGkCBQlQUkVDSVNJT04ABQAQSWR4QXNzZXRDb250cmFjdAABABRJZHhBc3NldEJhY2tpbmdSYXRpbwACAQtrZXlBc3NldENmZwEMYmFzZUFzc2V0U3RyCQC5CQIJAMwIAgIGJXMlcyVzCQDMCAICBmNvbmZpZwkAzAgCAgVhc3NldAkAzAgCBQxiYXNlQXNzZXRTdHIFA25pbAUDU0VQAQ5rZXlJbml0aWFsaXplZAAJALkJAgkAzAgCAgIlcwkAzAgCAgtpbml0aWFsaXplZAUDbmlsBQNTRVABCGtleUFkbWluAAkAuQkCCQDMCAICAiVzCQDMCAICBWFkbWluBQNuaWwFA1NFUAEMa2V5RWFzdEFzc2V0AAkAuQkCCQDMCAICAiVzCQDMCAICCWVhc3RBc3NldAUDbmlsBQNTRVABDGtleVdlc3RBc3NldAAJALkJAgkAzAgCAgIlcwkAzAgCAgl3ZXN0QXNzZXQFA25pbA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A25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFpAQRtaW50AAQHcGF5bWVudAkAkQMCCAUBaQhwYXltZW50cwAAAwkBAiE9AgkAkAMBCAUBaQhwYXltZW50cwABCQACAQIVV3JvbmcgcGF5bWVudHMgYW1vdW50BAdhc3NldElkBAckbWF0Y2gwCAUHcGF5bWVudAdhc3NldElkAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAmlkBQckbWF0Y2gwCQDYBAEFAmlkAwkAAQIFByRtYXRjaDACBFVuaXQEBXdhdmVzBQckbWF0Y2gwAgVXQVZFUwkAAgECC01hdGNoIGVycm9yBAhhc3NldENmZwkAtQkCCQETdmFsdWVPckVycm9yTWVzc2FnZQIJAKIIAQkBC2tleUFzc2V0Q2ZnAQUHYXNzZXRJZAINVW5rbm93biBhc3NldAUDU0VQBApjb250cmFjdElkCQCRAwIFCGFzc2V0Q2ZnBRBJZHhBc3NldENvbnRyYWN0BAxiYWNraW5nUmF0aW8JAJEDAgUIYXNzZXRDZmcFFElkeEFzc2V0QmFja2luZ1JhdGlvBAF4CQACAQkArAICBQpjb250cmFjdElkBQxiYWNraW5nUmF0aW8FA25pbAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkOcuac", "height": 2328853, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BHv9ZgHxzBHTkXFoZnTLUvbeBZPRYcVjfMRvBfdJAAjD Next: 4TgRwQ2rZ6jxcA7u1rDp4SHVvoGxomJ7qENhAs5dt3Wo 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 ((I != q)) | |
88 | + | if (if ((I != "WAVES")) | |
89 | + | then (I != q) | |
90 | + | else false) | |
89 | 91 | then throw("Wrong asset id") | |
90 | 92 | else nil | |
91 | 93 | } |
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 ((I != q)) | |
88 | + | if (if ((I != "WAVES")) | |
89 | + | then (I != q) | |
90 | + | else false) | |
89 | 91 | then throw("Wrong asset id") | |
90 | 92 | else nil | |
91 | 93 | } | |
92 | 94 | ||
93 | 95 | ||
94 | 96 | func J (K) = { | |
95 | 97 | let y = addressFromString(K) | |
96 | 98 | if ($isInstanceOf(y, "Address")) | |
97 | 99 | then { | |
98 | 100 | let F = y | |
99 | 101 | true | |
100 | 102 | } | |
101 | 103 | else if ($isInstanceOf(y, "Unit")) | |
102 | 104 | then throw("Invalid address") | |
103 | 105 | else throw("Match error") | |
104 | 106 | } | |
105 | 107 | ||
106 | 108 | ||
107 | 109 | func L (M) = if (if ((M > 0)) | |
108 | 110 | then (300 > M) | |
109 | 111 | else false) | |
110 | 112 | then true | |
111 | 113 | else throw("Out of range") | |
112 | 114 | ||
113 | 115 | ||
114 | 116 | @Callable(w) | |
115 | 117 | func initialize (N,O) = if (if (u()) | |
116 | 118 | then v(w) | |
117 | 119 | else false) | |
118 | 120 | then throw("Not allowed") | |
119 | 121 | else { | |
120 | 122 | let P = Issue("East", "", 0, 8, true, unit, 0) | |
121 | 123 | let Q = calculateAssetId(P) | |
122 | 124 | [StringEntry(l(), toBase58String(Q)), StringEntry(m(), O), BooleanEntry(j(), true)] | |
123 | 125 | } | |
124 | 126 | ||
125 | 127 | ||
126 | 128 | ||
127 | 129 | @Callable(w) | |
128 | 130 | func setAdmin (K) = { | |
129 | 131 | let R = if (if (u()) | |
130 | 132 | then D(w) | |
131 | 133 | else false) | |
132 | 134 | then J(K) | |
133 | 135 | else false | |
134 | 136 | if ((R == R)) | |
135 | 137 | then if (!(R)) | |
136 | 138 | then throw("Not allowed") | |
137 | 139 | else [StringEntry(k(), K)] | |
138 | 140 | else throw("Strict value is not equal to itself.") | |
139 | 141 | } | |
140 | 142 | ||
141 | 143 | ||
142 | 144 | ||
143 | 145 | @Callable(w) | |
144 | 146 | func adminSetAsset (q,r,s,t) = { | |
145 | 147 | let S = if (u()) | |
146 | 148 | then D(w) | |
147 | 149 | else false | |
148 | 150 | if ((S == S)) | |
149 | 151 | then if (!(S)) | |
150 | 152 | then throw("Not allowed") | |
151 | 153 | else { | |
152 | 154 | let T = getStringValue(m()) | |
153 | 155 | if ((T == q)) | |
154 | 156 | then throw("West asset is not allowed") | |
155 | 157 | else { | |
156 | 158 | let U = [G(q, r), L(s), L(t)] | |
157 | 159 | if ((U == U)) | |
158 | 160 | then { | |
159 | 161 | let V = p(q, r, s, t) | |
160 | 162 | [StringEntry(h(q), V)] | |
161 | 163 | } | |
162 | 164 | else throw("Strict value is not equal to itself.") | |
163 | 165 | } | |
164 | 166 | } | |
165 | 167 | else throw("Strict value is not equal to itself.") | |
166 | 168 | } | |
167 | 169 | ||
168 | 170 | ||
169 | 171 | ||
170 | 172 | @Callable(w) | |
171 | 173 | func mint () = { | |
172 | 174 | let W = w.payments[0] | |
173 | 175 | if ((size(w.payments) != 1)) | |
174 | 176 | then throw("Wrong payments amount") | |
175 | 177 | else { | |
176 | 178 | let I = { | |
177 | 179 | let y = W.assetId | |
178 | 180 | if ($isInstanceOf(y, "ByteVector")) | |
179 | 181 | then { | |
180 | 182 | let X = y | |
181 | 183 | toBase58String(X) | |
182 | 184 | } | |
183 | 185 | else if ($isInstanceOf(y, "Unit")) | |
184 | 186 | then { | |
185 | 187 | let Y = y | |
186 | 188 | "WAVES" | |
187 | 189 | } | |
188 | 190 | else throw("Match error") | |
189 | 191 | } | |
190 | 192 | let V = split(valueOrErrorMessage(getString(h(I)), "Unknown asset"), a) | |
191 | 193 | let H = V[f] | |
192 | 194 | let Z = V[g] | |
193 | 195 | let aa = throw((H + Z)) | |
194 | 196 | nil | |
195 | 197 | } | |
196 | 198 | } | |
197 | 199 | ||
198 | 200 | ||
199 | 201 | @Verifier(ab) | |
200 | 202 | func ac () = sigVerify(ab.bodyBytes, ab.proofs[0], ab.senderPublicKey) | |
201 | 203 |
github/deemru/w8io/169f3d6 24.68 ms ◑