tx · 6VnwRiznJbm2wm3FFpwUmQi9fN8Bo25so8dhNKFFaoJo
3N8kB3UEjWWvTRBtGpGUErAevaK2q6u2eCM: -0.01000000 Waves
2023.11.02 10:00 [2825387] smart account 3N8kB3UEjWWvTRBtGpGUErAevaK2q6u2eCM > SELF 0.00000000 Waves
{
"type": 13,
"id": "6VnwRiznJbm2wm3FFpwUmQi9fN8Bo25so8dhNKFFaoJo",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1698908417993,
"version": 2,
"chainId": 84,
"sender": "3N8kB3UEjWWvTRBtGpGUErAevaK2q6u2eCM",
"senderPublicKey": "6ybktvseycJDGHTjJm3tz9iT2SKaTNtLLCZsJZRemtoM",
"proofs": [
"3AU4JNQBEBce5ZTUVvAjHcp32ESxqZpDCQBFs335yvesJmjWA6fwVT1iPyNbmzHigZaJEjsBJC663HoRhVDHt2z8"
],
"script": "base64:BgIOCAISABIDCgEBEgMKAQINAApvcGVyYXRvclBrASBYykJ087k1O5DHz1iBa4azTNxFvIHPRd6zv7WPhbjSXAAPb3BlcmF0b3JBZGRyZXNzCQCnCAEFCm9wZXJhdG9yUGsAC2Rlbm9taW5hdG9yAIDC1y8ACnRyYW5zZmVyVmsBxAZJiseGR4OvD50UwPpiv9Wu+vak/IMcJagw7zD0vEVpAAGtWTGorU9F+BnDS31sM2zEUQk0eEStz1cdOSRTU6IRhhaLPZV2pbqNB7BLzpneWyHFboV1/UxTQwM+3U2iKRJ/ZgQgG8j6CxwB+qa28nFluRUD8uuvuv4fJVShka3VAHjpm/26Z5kHCZNaIMdos8+A5U5ZABVgswLCkTMTMh0XYLwrMj8KwJ4K/etp/npFeaEUBa4kJsy07ozLXY/EVANG/3whY/QUaFj+bqxD/2vnwYierhtJVhYqUa5xtdtrJpgXfkWnejpVpFdVbMnoV6ysfx1L4PF5p2xycA3ghAQHgnlhzBm8Bf9+MTkkQc0Lhas1+JR7597oUBDi20eVGApL49s3Vu60fV0OR9CQEoLk6bRYjcPjl5pFs3pNr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X6CNQ9ENdDo61WLcryyndAC
Diff:
Old | New | | Differences |
---|
24 | 24 | | |
---|
25 | 25 | | let m = "PoolIndex" |
---|
26 | 26 | | |
---|
27 | | - | func n (o,p,q) = drop(take(o, q), p) |
---|
| 27 | + | let n = "AllMessagesHash" |
---|
| 28 | + | |
---|
| 29 | + | func o (p,q,r) = drop(take(p, r), q) |
---|
28 | 30 | | |
---|
29 | 31 | | |
---|
30 | | - | func r (l,s) = { |
---|
31 | | - | let t = k(l.bytes) |
---|
32 | | - | let u = { |
---|
33 | | - | let v = getInteger(t) |
---|
34 | | - | if ($isInstanceOf(v, "Int")) |
---|
| 32 | + | func s (l,t) = { |
---|
| 33 | + | let u = k(l.bytes) |
---|
| 34 | + | let v = { |
---|
| 35 | + | let w = getInteger(u) |
---|
| 36 | + | if ($isInstanceOf(w, "Int")) |
---|
35 | 37 | | then { |
---|
36 | | - | let w = v |
---|
37 | | - | w |
---|
| 38 | + | let x = w |
---|
| 39 | + | x |
---|
38 | 40 | | } |
---|
39 | 41 | | else 0 |
---|
40 | 42 | | } |
---|
41 | | - | let x = (u - s) |
---|
42 | | - | if ((0 > s)) |
---|
| 43 | + | let y = (v - t) |
---|
| 44 | + | if ((0 > t)) |
---|
43 | 45 | | then throw("Can't spend negative amount") |
---|
44 | | - | else if ((0 > x)) |
---|
| 46 | + | else if ((0 > y)) |
---|
45 | 47 | | then throw("Not enough balance") |
---|
46 | | - | else [IntegerEntry(t, x)] |
---|
| 48 | + | else [IntegerEntry(u, y)] |
---|
47 | 49 | | } |
---|
48 | 50 | | |
---|
49 | 51 | | |
---|
50 | | - | @Callable(y) |
---|
| 52 | + | @Callable(z) |
---|
51 | 53 | | func deposit () = { |
---|
52 | | - | let z = value(y.payments[0]) |
---|
53 | | - | if (isDefined(z.assetId)) |
---|
| 54 | + | let A = value(z.payments[0]) |
---|
| 55 | + | if (isDefined(A.assetId)) |
---|
54 | 56 | | then throw("Only WAVES is allowed at the moment") |
---|
55 | 57 | | else { |
---|
56 | | - | let t = k(y.caller.bytes) |
---|
57 | | - | let u = { |
---|
58 | | - | let v = getInteger(this, t) |
---|
59 | | - | if ($isInstanceOf(v, "Int")) |
---|
| 58 | + | let u = k(z.caller.bytes) |
---|
| 59 | + | let v = { |
---|
| 60 | + | let w = getInteger(this, u) |
---|
| 61 | + | if ($isInstanceOf(w, "Int")) |
---|
60 | 62 | | then { |
---|
61 | | - | let w = v |
---|
62 | | - | w |
---|
| 63 | + | let x = w |
---|
| 64 | + | x |
---|
63 | 65 | | } |
---|
64 | 66 | | else 0 |
---|
65 | 67 | | } |
---|
66 | | - | let x = (u + z.amount) |
---|
67 | | - | [IntegerEntry(t, x)] |
---|
| 68 | + | let y = (v + A.amount) |
---|
| 69 | + | [IntegerEntry(u, y)] |
---|
68 | 70 | | } |
---|
69 | 71 | | } |
---|
70 | 72 | | |
---|
71 | 73 | | |
---|
72 | 74 | | |
---|
73 | | - | @Callable(y) |
---|
74 | | - | func withdraw (s) = { |
---|
75 | | - | let t = k(y.caller.bytes) |
---|
76 | | - | let u = { |
---|
77 | | - | let v = getInteger(this, t) |
---|
78 | | - | if ($isInstanceOf(v, "Int")) |
---|
| 75 | + | @Callable(z) |
---|
| 76 | + | func withdraw (t) = { |
---|
| 77 | + | let u = k(z.caller.bytes) |
---|
| 78 | + | let v = { |
---|
| 79 | + | let w = getInteger(this, u) |
---|
| 80 | + | if ($isInstanceOf(w, "Int")) |
---|
79 | 81 | | then { |
---|
80 | | - | let w = v |
---|
81 | | - | w |
---|
| 82 | + | let x = w |
---|
| 83 | + | x |
---|
82 | 84 | | } |
---|
83 | 85 | | else 0 |
---|
84 | 86 | | } |
---|
85 | | - | let x = (u - s) |
---|
86 | | - | if ((0 > s)) |
---|
| 87 | + | let y = (v - t) |
---|
| 88 | + | if ((0 > t)) |
---|
87 | 89 | | then throw("Can't withdraw negative amount") |
---|
88 | | - | else if ((0 > x)) |
---|
| 90 | + | else if ((0 > y)) |
---|
89 | 91 | | then throw("Not enough balance") |
---|
90 | | - | else [IntegerEntry(t, x), ScriptTransfer(y.caller, s, unit)] |
---|
| 92 | + | else [IntegerEntry(u, y), ScriptTransfer(z.caller, t, unit)] |
---|
91 | 93 | | } |
---|
92 | 94 | | |
---|
93 | 95 | | |
---|
94 | 96 | | |
---|
95 | | - | @Callable(y) |
---|
96 | | - | func transact (A) = { |
---|
97 | | - | let j = n(A, 0, 32) |
---|
98 | | - | let B = n(A, 32, 64) |
---|
99 | | - | let C = n(A, 64, 96) |
---|
100 | | - | let D = n(A, 96, 128) |
---|
101 | | - | let E = toInt(n(D, 0, 8)) |
---|
102 | | - | let F = toInt(n(D, 8, 22)) |
---|
103 | | - | let G = toInt(n(D, 22, 28)) |
---|
104 | | - | let H = n(D, 28, 31) |
---|
105 | | - | let I = n(A, 128, 384) |
---|
106 | | - | let J = n(A, 384, 640) |
---|
107 | | - | let K = n(A, 640, 672) |
---|
108 | | - | let L = toInt(n(A, 672, 674)) |
---|
109 | | - | let M = if ((L == 0)) |
---|
| 97 | + | @Callable(z) |
---|
| 98 | + | func transact (B) = { |
---|
| 99 | + | let j = o(B, 0, 32) |
---|
| 100 | + | let C = o(B, 32, 64) |
---|
| 101 | + | let D = o(B, 64, 96) |
---|
| 102 | + | let E = o(B, 96, 128) |
---|
| 103 | + | let F = toInt(o(E, 0, 8)) |
---|
| 104 | + | let G = toInt(o(E, 8, 22)) |
---|
| 105 | + | let H = toInt(o(E, 22, 28)) |
---|
| 106 | + | let I = o(E, 28, 31) |
---|
| 107 | + | let J = o(B, 128, 384) |
---|
| 108 | + | let K = o(B, 384, 640) |
---|
| 109 | + | let L = o(B, 640, 672) |
---|
| 110 | + | let M = toInt(o(B, 672, 674)) |
---|
| 111 | + | let N = if ((M == 0)) |
---|
110 | 112 | | then { |
---|
111 | | - | let N = (32 + 64) |
---|
112 | | - | let O = dropRight(takeRight(A, N), 64) |
---|
113 | | - | let P = takeRight(A, 64) |
---|
114 | | - | $Tuple3(n(A, 674, (size(A) - N)), O, P) |
---|
| 113 | + | let O = (32 + 64) |
---|
| 114 | + | let P = dropRight(takeRight(B, O), 64) |
---|
| 115 | + | let Q = takeRight(B, 64) |
---|
| 116 | + | $Tuple3(o(B, 674, (size(B) - O)), P, Q) |
---|
115 | 117 | | } |
---|
116 | | - | else $Tuple3(n(A, 674, size(A)), unit, unit) |
---|
117 | | - | let Q = M._1 |
---|
118 | | - | let O = M._2 |
---|
119 | | - | let P = M._3 |
---|
120 | | - | let R = toInt(n(Q, 0, 8)) |
---|
121 | | - | let S = keccak256(Q) |
---|
122 | | - | let T = valueOrElse(getBinary(g(G)), f) |
---|
123 | | - | if ((T == T)) |
---|
| 118 | + | else $Tuple3(o(B, 674, size(B)), unit, unit) |
---|
| 119 | + | let R = N._1 |
---|
| 120 | + | let P = N._2 |
---|
| 121 | + | let Q = N._3 |
---|
| 122 | + | let S = toInt(o(R, 0, 8)) |
---|
| 123 | + | let T = valueOrElse(getBinary(n), toBytes(toBigInt(0))) |
---|
| 124 | + | let U = keccak256(R) |
---|
| 125 | + | let V = (T + U) |
---|
| 126 | + | let W = keccak256(V) |
---|
| 127 | + | let X = valueOrElse(getBinary(g(H)), f) |
---|
| 128 | + | if ((X == X)) |
---|
124 | 129 | | then { |
---|
125 | | - | let U = valueOrElse(getInteger(m), 0) |
---|
126 | | - | let V = valueOrElse(getBinary(g(U)), f) |
---|
127 | | - | let W = { |
---|
128 | | - | let v = getBinary(i(j)) |
---|
129 | | - | if ($isInstanceOf(v, "Unit")) |
---|
| 130 | + | let Y = valueOrElse(getInteger(m), 0) |
---|
| 131 | + | let Z = valueOrElse(getBinary(g(Y)), f) |
---|
| 132 | + | let aa = { |
---|
| 133 | + | let w = getBinary(i(j)) |
---|
| 134 | + | if ($isInstanceOf(w, "Unit")) |
---|
130 | 135 | | then { |
---|
131 | | - | let w = v |
---|
| 136 | + | let x = w |
---|
132 | 137 | | false |
---|
133 | 138 | | } |
---|
134 | 139 | | else true |
---|
135 | 140 | | } |
---|
136 | | - | let X = ((((S + j) + B) + D) + S) |
---|
137 | | - | let Y = ((V + K) + B) |
---|
138 | | - | let Z = [BinaryEntry(g(G), K), BinaryEntry(i(j), keccak256((B + D))), IntegerEntry(m, (U + 128))] |
---|
139 | | - | let aa = { |
---|
140 | | - | let v = L |
---|
141 | | - | if ((0 == v)) |
---|
| 141 | + | let ab = ((((U + j) + C) + E) + U) |
---|
| 142 | + | let ac = ((Z + L) + C) |
---|
| 143 | + | let ad = [BinaryEntry(g(H), L), BinaryEntry(i(j), keccak256((C + E))), IntegerEntry(m, (Y + 128)), BinaryEntry(n, W)] |
---|
| 144 | + | let ae = { |
---|
| 145 | + | let w = M |
---|
| 146 | + | if ((0 == w)) |
---|
142 | 147 | | then { |
---|
143 | | - | let ab = value(O) |
---|
144 | | - | let ac = addressFromPublicKey(ab) |
---|
145 | | - | if ((0 > E)) |
---|
| 148 | + | let af = value(P) |
---|
| 149 | + | let ag = addressFromPublicKey(af) |
---|
| 150 | + | if ((0 > F)) |
---|
146 | 151 | | then throw("Can't deposit negative amount") |
---|
147 | | - | else if (!(sigVerify_8Kb((j + ab), value(P), ab))) |
---|
| 152 | + | else if (!(sigVerify_8Kb((j + af), value(Q), af))) |
---|
148 | 153 | | then throw("Invalid deposit signature") |
---|
149 | | - | else r(ac, (E * c)) |
---|
| 154 | + | else s(ag, (F * c)) |
---|
150 | 155 | | } |
---|
151 | | - | else if ((1 == v)) |
---|
152 | | - | then if ((E != 0)) |
---|
| 156 | + | else if ((1 == w)) |
---|
| 157 | + | then if ((F != 0)) |
---|
153 | 158 | | then throw("Native amount must be zero for transfers") |
---|
154 | 159 | | else nil |
---|
155 | | - | else if ((2 == v)) |
---|
| 160 | + | else if ((2 == w)) |
---|
156 | 161 | | then { |
---|
157 | | - | let ad = (toInt(n(Q, 8, 16)) * c) |
---|
158 | | - | if ((ad > 0)) |
---|
| 162 | + | let ah = (toInt(o(R, 8, 16)) * c) |
---|
| 163 | + | if ((ah > 0)) |
---|
159 | 164 | | then throw("Withdraw amount must be positive") |
---|
160 | | - | else [ScriptTransfer(y.caller, -(ad), unit)] |
---|
| 165 | + | else [ScriptTransfer(z.caller, -(ah), unit)] |
---|
161 | 166 | | } |
---|
162 | 167 | | else throw("Unknown tx type") |
---|
163 | 168 | | } |
---|
164 | | - | let ae = if ((R > 0)) |
---|
| 169 | + | let ai = if ((S > 0)) |
---|
165 | 170 | | then { |
---|
166 | | - | let af = (R * c) |
---|
167 | | - | [ScriptTransfer(b, R, unit)] |
---|
| 171 | + | let aj = (S * c) |
---|
| 172 | + | [ScriptTransfer(b, S, unit)] |
---|
168 | 173 | | } |
---|
169 | 174 | | else nil |
---|
170 | | - | if ((G > U)) |
---|
| 175 | + | if ((H > Y)) |
---|
171 | 176 | | then throw("Transaction index is too big") |
---|
172 | | - | else if (!(bn256Groth16Verify_5inputs(d, I, X))) |
---|
| 177 | + | else if (!(bn256Groth16Verify_5inputs(d, J, ab))) |
---|
173 | 178 | | then throw("Tx proof is invalid") |
---|
174 | | - | else if (!(bn256Groth16Verify_3inputs(e, J, Y))) |
---|
| 179 | + | else if (!(bn256Groth16Verify_3inputs(e, K, ac))) |
---|
175 | 180 | | then throw("Tree proof is invalid") |
---|
176 | | - | else if (W) |
---|
| 181 | + | else if (aa) |
---|
177 | 182 | | then throw("Double spend") |
---|
178 | | - | else ((aa ++ Z) ++ ae) |
---|
| 183 | + | else ((ae ++ ad) ++ ai) |
---|
179 | 184 | | } |
---|
180 | 185 | | else throw("Strict value is not equal to itself.") |
---|
181 | 186 | | } |
---|
182 | 187 | | |
---|
183 | 188 | | |
---|
184 | | - | @Verifier(A) |
---|
185 | | - | func ag () = { |
---|
186 | | - | let v = A |
---|
187 | | - | if ($isInstanceOf(v, "SetScriptTransaction")) |
---|
| 189 | + | @Verifier(B) |
---|
| 190 | + | func ak () = { |
---|
| 191 | + | let w = B |
---|
| 192 | + | if ($isInstanceOf(w, "SetScriptTransaction")) |
---|
188 | 193 | | then { |
---|
189 | | - | let ah = v |
---|
190 | | - | sigVerify(A.bodyBytes, A.proofs[0], a) |
---|
| 194 | + | let al = w |
---|
| 195 | + | sigVerify(B.bodyBytes, B.proofs[0], a) |
---|
191 | 196 | | } |
---|
192 | 197 | | else false |
---|
193 | 198 | | } |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = base58'6ybktvseycJDGHTjJm3tz9iT2SKaTNtLLCZsJZRemtoM' |
---|
5 | 5 | | |
---|
6 | 6 | | let b = addressFromPublicKey(a) |
---|
7 | 7 | | |
---|
8 | 8 | | let c = 100000000 |
---|
9 | 9 | | |
---|
10 | 10 | | let d = base64'SYrHhkeDrw+dFMD6Yr/Vrvr2pPyDHCWoMO8w9LxFaQABrVkxqK1PRfgZw0t9bDNsxFEJNHhErc9XHTkkU1OiEYYWiz2VdqW6jQewS86Z3lshxW6Fdf1MU0MDPt1NoikSf2YEIBvI+gscAfqmtvJxZbkVA/Lrr7r+HyVUoZGt1QB46Zv9umeZBwmTWiDHaLPPgOVOWQAVYLMCwpEzEzIdF2C8KzI/CsCeCv3raf56RXmhFAWuJCbMtO6My12PxFQDRv98IWP0FGhY/m6sQ/9r58GInq4bSVYWKlGucbXbayaYF35Fp3o6VaRXVWzJ6FesrH8dS+DxeadscnAN4IQEB4J5YcwZvAX/fjE5JEHNC4WrNfiUe+fe6FAQ4ttHlRgKS+PbN1butH1dDkfQkBKC5Om0WI3D45eaRbN6Taxt7ha5xCUwGVh0LQ+Wf/j9bY+un1Cwur9wx+HmB6PPGC2pEFLSQhkZjtvNJTs6e1c0i3FAOhFDSNqEjcqORSer2aUGdJMXhB6YEv/XcumUDyQbem+f0wX2qOgtwVFLtGOq7S65sHzNcHpdJP/htHnhqkQErwmjDG/JTs9oc1mu5jOsGAYAAAAovMt7vHGhKq+EA+6JlSFfVMj7aU/V67EpB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5IPLt6g/0ImUPee8frB6VtMYYkmQ7ZCWTwKEPGDIgQAAACMoBtyPY40yogNVj5bF/LbEe5QGKZjwyfMj58AY5ocK00CEsC3Nm1wSKR6xi8NSbjhPZRw0/zChVK9K8ceAO4ijNFpOFuOpTO6aEq0o7spO/E0JTwTStxF0jdD9NCydSTLZi4DdtHHkcph4Sao8AwV4qd50wavb0/hxCXkVWTvErgnIWCgjrfgzQBDfa99z0alUbwyBBd8odwfJU7bERsH/SfhNempxiwEU1uq6TPQ2NxgN3fgXo5i9dHrSaI2ZQd7R9hyJVeMlBaz6uP4gS1XYlt5LkT+TFGT/vidKlcMHQx945x1Iivq728eKgJ4aBI5Ja1nxj7QC7d98xukukQl' |
---|
13 | 13 | | |
---|
14 | 14 | | let f = toBytes(parseBigIntValue("11469701942666298368112882412133877458305516134926649826543144744382391691533")) |
---|
15 | 15 | | |
---|
16 | 16 | | func g (h) = ("R:" + toString(h)) |
---|
17 | 17 | | |
---|
18 | 18 | | |
---|
19 | 19 | | func i (j) = ("N:" + toBase58String(j)) |
---|
20 | 20 | | |
---|
21 | 21 | | |
---|
22 | 22 | | func k (l) = ("D:" + toBase58String(l)) |
---|
23 | 23 | | |
---|
24 | 24 | | |
---|
25 | 25 | | let m = "PoolIndex" |
---|
26 | 26 | | |
---|
27 | | - | func n (o,p,q) = drop(take(o, q), p) |
---|
| 27 | + | let n = "AllMessagesHash" |
---|
| 28 | + | |
---|
| 29 | + | func o (p,q,r) = drop(take(p, r), q) |
---|
28 | 30 | | |
---|
29 | 31 | | |
---|
30 | | - | func r (l,s) = { |
---|
31 | | - | let t = k(l.bytes) |
---|
32 | | - | let u = { |
---|
33 | | - | let v = getInteger(t) |
---|
34 | | - | if ($isInstanceOf(v, "Int")) |
---|
| 32 | + | func s (l,t) = { |
---|
| 33 | + | let u = k(l.bytes) |
---|
| 34 | + | let v = { |
---|
| 35 | + | let w = getInteger(u) |
---|
| 36 | + | if ($isInstanceOf(w, "Int")) |
---|
35 | 37 | | then { |
---|
36 | | - | let w = v |
---|
37 | | - | w |
---|
| 38 | + | let x = w |
---|
| 39 | + | x |
---|
38 | 40 | | } |
---|
39 | 41 | | else 0 |
---|
40 | 42 | | } |
---|
41 | | - | let x = (u - s) |
---|
42 | | - | if ((0 > s)) |
---|
| 43 | + | let y = (v - t) |
---|
| 44 | + | if ((0 > t)) |
---|
43 | 45 | | then throw("Can't spend negative amount") |
---|
44 | | - | else if ((0 > x)) |
---|
| 46 | + | else if ((0 > y)) |
---|
45 | 47 | | then throw("Not enough balance") |
---|
46 | | - | else [IntegerEntry(t, x)] |
---|
| 48 | + | else [IntegerEntry(u, y)] |
---|
47 | 49 | | } |
---|
48 | 50 | | |
---|
49 | 51 | | |
---|
50 | | - | @Callable(y) |
---|
| 52 | + | @Callable(z) |
---|
51 | 53 | | func deposit () = { |
---|
52 | | - | let z = value(y.payments[0]) |
---|
53 | | - | if (isDefined(z.assetId)) |
---|
| 54 | + | let A = value(z.payments[0]) |
---|
| 55 | + | if (isDefined(A.assetId)) |
---|
54 | 56 | | then throw("Only WAVES is allowed at the moment") |
---|
55 | 57 | | else { |
---|
56 | | - | let t = k(y.caller.bytes) |
---|
57 | | - | let u = { |
---|
58 | | - | let v = getInteger(this, t) |
---|
59 | | - | if ($isInstanceOf(v, "Int")) |
---|
| 58 | + | let u = k(z.caller.bytes) |
---|
| 59 | + | let v = { |
---|
| 60 | + | let w = getInteger(this, u) |
---|
| 61 | + | if ($isInstanceOf(w, "Int")) |
---|
60 | 62 | | then { |
---|
61 | | - | let w = v |
---|
62 | | - | w |
---|
| 63 | + | let x = w |
---|
| 64 | + | x |
---|
63 | 65 | | } |
---|
64 | 66 | | else 0 |
---|
65 | 67 | | } |
---|
66 | | - | let x = (u + z.amount) |
---|
67 | | - | [IntegerEntry(t, x)] |
---|
| 68 | + | let y = (v + A.amount) |
---|
| 69 | + | [IntegerEntry(u, y)] |
---|
68 | 70 | | } |
---|
69 | 71 | | } |
---|
70 | 72 | | |
---|
71 | 73 | | |
---|
72 | 74 | | |
---|
73 | | - | @Callable(y) |
---|
74 | | - | func withdraw (s) = { |
---|
75 | | - | let t = k(y.caller.bytes) |
---|
76 | | - | let u = { |
---|
77 | | - | let v = getInteger(this, t) |
---|
78 | | - | if ($isInstanceOf(v, "Int")) |
---|
| 75 | + | @Callable(z) |
---|
| 76 | + | func withdraw (t) = { |
---|
| 77 | + | let u = k(z.caller.bytes) |
---|
| 78 | + | let v = { |
---|
| 79 | + | let w = getInteger(this, u) |
---|
| 80 | + | if ($isInstanceOf(w, "Int")) |
---|
79 | 81 | | then { |
---|
80 | | - | let w = v |
---|
81 | | - | w |
---|
| 82 | + | let x = w |
---|
| 83 | + | x |
---|
82 | 84 | | } |
---|
83 | 85 | | else 0 |
---|
84 | 86 | | } |
---|
85 | | - | let x = (u - s) |
---|
86 | | - | if ((0 > s)) |
---|
| 87 | + | let y = (v - t) |
---|
| 88 | + | if ((0 > t)) |
---|
87 | 89 | | then throw("Can't withdraw negative amount") |
---|
88 | | - | else if ((0 > x)) |
---|
| 90 | + | else if ((0 > y)) |
---|
89 | 91 | | then throw("Not enough balance") |
---|
90 | | - | else [IntegerEntry(t, x), ScriptTransfer(y.caller, s, unit)] |
---|
| 92 | + | else [IntegerEntry(u, y), ScriptTransfer(z.caller, t, unit)] |
---|
91 | 93 | | } |
---|
92 | 94 | | |
---|
93 | 95 | | |
---|
94 | 96 | | |
---|
95 | | - | @Callable(y) |
---|
96 | | - | func transact (A) = { |
---|
97 | | - | let j = n(A, 0, 32) |
---|
98 | | - | let B = n(A, 32, 64) |
---|
99 | | - | let C = n(A, 64, 96) |
---|
100 | | - | let D = n(A, 96, 128) |
---|
101 | | - | let E = toInt(n(D, 0, 8)) |
---|
102 | | - | let F = toInt(n(D, 8, 22)) |
---|
103 | | - | let G = toInt(n(D, 22, 28)) |
---|
104 | | - | let H = n(D, 28, 31) |
---|
105 | | - | let I = n(A, 128, 384) |
---|
106 | | - | let J = n(A, 384, 640) |
---|
107 | | - | let K = n(A, 640, 672) |
---|
108 | | - | let L = toInt(n(A, 672, 674)) |
---|
109 | | - | let M = if ((L == 0)) |
---|
| 97 | + | @Callable(z) |
---|
| 98 | + | func transact (B) = { |
---|
| 99 | + | let j = o(B, 0, 32) |
---|
| 100 | + | let C = o(B, 32, 64) |
---|
| 101 | + | let D = o(B, 64, 96) |
---|
| 102 | + | let E = o(B, 96, 128) |
---|
| 103 | + | let F = toInt(o(E, 0, 8)) |
---|
| 104 | + | let G = toInt(o(E, 8, 22)) |
---|
| 105 | + | let H = toInt(o(E, 22, 28)) |
---|
| 106 | + | let I = o(E, 28, 31) |
---|
| 107 | + | let J = o(B, 128, 384) |
---|
| 108 | + | let K = o(B, 384, 640) |
---|
| 109 | + | let L = o(B, 640, 672) |
---|
| 110 | + | let M = toInt(o(B, 672, 674)) |
---|
| 111 | + | let N = if ((M == 0)) |
---|
110 | 112 | | then { |
---|
111 | | - | let N = (32 + 64) |
---|
112 | | - | let O = dropRight(takeRight(A, N), 64) |
---|
113 | | - | let P = takeRight(A, 64) |
---|
114 | | - | $Tuple3(n(A, 674, (size(A) - N)), O, P) |
---|
| 113 | + | let O = (32 + 64) |
---|
| 114 | + | let P = dropRight(takeRight(B, O), 64) |
---|
| 115 | + | let Q = takeRight(B, 64) |
---|
| 116 | + | $Tuple3(o(B, 674, (size(B) - O)), P, Q) |
---|
115 | 117 | | } |
---|
116 | | - | else $Tuple3(n(A, 674, size(A)), unit, unit) |
---|
117 | | - | let Q = M._1 |
---|
118 | | - | let O = M._2 |
---|
119 | | - | let P = M._3 |
---|
120 | | - | let R = toInt(n(Q, 0, 8)) |
---|
121 | | - | let S = keccak256(Q) |
---|
122 | | - | let T = valueOrElse(getBinary(g(G)), f) |
---|
123 | | - | if ((T == T)) |
---|
| 118 | + | else $Tuple3(o(B, 674, size(B)), unit, unit) |
---|
| 119 | + | let R = N._1 |
---|
| 120 | + | let P = N._2 |
---|
| 121 | + | let Q = N._3 |
---|
| 122 | + | let S = toInt(o(R, 0, 8)) |
---|
| 123 | + | let T = valueOrElse(getBinary(n), toBytes(toBigInt(0))) |
---|
| 124 | + | let U = keccak256(R) |
---|
| 125 | + | let V = (T + U) |
---|
| 126 | + | let W = keccak256(V) |
---|
| 127 | + | let X = valueOrElse(getBinary(g(H)), f) |
---|
| 128 | + | if ((X == X)) |
---|
124 | 129 | | then { |
---|
125 | | - | let U = valueOrElse(getInteger(m), 0) |
---|
126 | | - | let V = valueOrElse(getBinary(g(U)), f) |
---|
127 | | - | let W = { |
---|
128 | | - | let v = getBinary(i(j)) |
---|
129 | | - | if ($isInstanceOf(v, "Unit")) |
---|
| 130 | + | let Y = valueOrElse(getInteger(m), 0) |
---|
| 131 | + | let Z = valueOrElse(getBinary(g(Y)), f) |
---|
| 132 | + | let aa = { |
---|
| 133 | + | let w = getBinary(i(j)) |
---|
| 134 | + | if ($isInstanceOf(w, "Unit")) |
---|
130 | 135 | | then { |
---|
131 | | - | let w = v |
---|
| 136 | + | let x = w |
---|
132 | 137 | | false |
---|
133 | 138 | | } |
---|
134 | 139 | | else true |
---|
135 | 140 | | } |
---|
136 | | - | let X = ((((S + j) + B) + D) + S) |
---|
137 | | - | let Y = ((V + K) + B) |
---|
138 | | - | let Z = [BinaryEntry(g(G), K), BinaryEntry(i(j), keccak256((B + D))), IntegerEntry(m, (U + 128))] |
---|
139 | | - | let aa = { |
---|
140 | | - | let v = L |
---|
141 | | - | if ((0 == v)) |
---|
| 141 | + | let ab = ((((U + j) + C) + E) + U) |
---|
| 142 | + | let ac = ((Z + L) + C) |
---|
| 143 | + | let ad = [BinaryEntry(g(H), L), BinaryEntry(i(j), keccak256((C + E))), IntegerEntry(m, (Y + 128)), BinaryEntry(n, W)] |
---|
| 144 | + | let ae = { |
---|
| 145 | + | let w = M |
---|
| 146 | + | if ((0 == w)) |
---|
142 | 147 | | then { |
---|
143 | | - | let ab = value(O) |
---|
144 | | - | let ac = addressFromPublicKey(ab) |
---|
145 | | - | if ((0 > E)) |
---|
| 148 | + | let af = value(P) |
---|
| 149 | + | let ag = addressFromPublicKey(af) |
---|
| 150 | + | if ((0 > F)) |
---|
146 | 151 | | then throw("Can't deposit negative amount") |
---|
147 | | - | else if (!(sigVerify_8Kb((j + ab), value(P), ab))) |
---|
| 152 | + | else if (!(sigVerify_8Kb((j + af), value(Q), af))) |
---|
148 | 153 | | then throw("Invalid deposit signature") |
---|
149 | | - | else r(ac, (E * c)) |
---|
| 154 | + | else s(ag, (F * c)) |
---|
150 | 155 | | } |
---|
151 | | - | else if ((1 == v)) |
---|
152 | | - | then if ((E != 0)) |
---|
| 156 | + | else if ((1 == w)) |
---|
| 157 | + | then if ((F != 0)) |
---|
153 | 158 | | then throw("Native amount must be zero for transfers") |
---|
154 | 159 | | else nil |
---|
155 | | - | else if ((2 == v)) |
---|
| 160 | + | else if ((2 == w)) |
---|
156 | 161 | | then { |
---|
157 | | - | let ad = (toInt(n(Q, 8, 16)) * c) |
---|
158 | | - | if ((ad > 0)) |
---|
| 162 | + | let ah = (toInt(o(R, 8, 16)) * c) |
---|
| 163 | + | if ((ah > 0)) |
---|
159 | 164 | | then throw("Withdraw amount must be positive") |
---|
160 | | - | else [ScriptTransfer(y.caller, -(ad), unit)] |
---|
| 165 | + | else [ScriptTransfer(z.caller, -(ah), unit)] |
---|
161 | 166 | | } |
---|
162 | 167 | | else throw("Unknown tx type") |
---|
163 | 168 | | } |
---|
164 | | - | let ae = if ((R > 0)) |
---|
| 169 | + | let ai = if ((S > 0)) |
---|
165 | 170 | | then { |
---|
166 | | - | let af = (R * c) |
---|
167 | | - | [ScriptTransfer(b, R, unit)] |
---|
| 171 | + | let aj = (S * c) |
---|
| 172 | + | [ScriptTransfer(b, S, unit)] |
---|
168 | 173 | | } |
---|
169 | 174 | | else nil |
---|
170 | | - | if ((G > U)) |
---|
| 175 | + | if ((H > Y)) |
---|
171 | 176 | | then throw("Transaction index is too big") |
---|
172 | | - | else if (!(bn256Groth16Verify_5inputs(d, I, X))) |
---|
| 177 | + | else if (!(bn256Groth16Verify_5inputs(d, J, ab))) |
---|
173 | 178 | | then throw("Tx proof is invalid") |
---|
174 | | - | else if (!(bn256Groth16Verify_3inputs(e, J, Y))) |
---|
| 179 | + | else if (!(bn256Groth16Verify_3inputs(e, K, ac))) |
---|
175 | 180 | | then throw("Tree proof is invalid") |
---|
176 | | - | else if (W) |
---|
| 181 | + | else if (aa) |
---|
177 | 182 | | then throw("Double spend") |
---|
178 | | - | else ((aa ++ Z) ++ ae) |
---|
| 183 | + | else ((ae ++ ad) ++ ai) |
---|
179 | 184 | | } |
---|
180 | 185 | | else throw("Strict value is not equal to itself.") |
---|
181 | 186 | | } |
---|
182 | 187 | | |
---|
183 | 188 | | |
---|
184 | | - | @Verifier(A) |
---|
185 | | - | func ag () = { |
---|
186 | | - | let v = A |
---|
187 | | - | if ($isInstanceOf(v, "SetScriptTransaction")) |
---|
| 189 | + | @Verifier(B) |
---|
| 190 | + | func ak () = { |
---|
| 191 | + | let w = B |
---|
| 192 | + | if ($isInstanceOf(w, "SetScriptTransaction")) |
---|
188 | 193 | | then { |
---|
189 | | - | let ah = v |
---|
190 | | - | sigVerify(A.bodyBytes, A.proofs[0], a) |
---|
| 194 | + | let al = w |
---|
| 195 | + | sigVerify(B.bodyBytes, B.proofs[0], a) |
---|
191 | 196 | | } |
---|
192 | 197 | | else false |
---|
193 | 198 | | } |
---|
194 | 199 | | |
---|