tx · 7HhGoX2KGrwQJWc9LaBuDMmvHpLNsCrLd6o8dnoh7w5s 3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr: -0.00500000 Waves 2024.10.11 09:44 [3321827] smart account 3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr > SELF 0.00000000 Waves
{ "type": 13, "id": "7HhGoX2KGrwQJWc9LaBuDMmvHpLNsCrLd6o8dnoh7w5s", "fee": 500000, "feeAssetId": null, "timestamp": 1728629047266, "version": 2, "chainId": 84, "sender": "3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr", "senderPublicKey": "jXCTQV8PjX2uC9UHBFveupYy9cjhY7stHbzE9cptymw", "proofs": [ "2yv83nketEUfwKPtCNAxz4fVqTxMUWpWuxAz4kQXsxFnJkjX5cok8fxBp2M5P3S1sEW73L3SjSXgBA8Agmp6zZid" ], "script": "base64:BwIZCAISAwoBCBIECgICGBIECgICGBIECgICGCEACXNlcGFyYXRvcgICX18AC3dhdmVzU3RyaW5nAgVXQVZFUwAQY29udHJhY3RGaWxlbmFtZQIXbWVtZV9pbV9jYWxjdWxhdG9yLnJpZGUABW11bHQ4AIDC1y8BB3dyYXBFcnIBAXMJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMBD3ZhbGlkYXRlQWRkcmVzcwEHYWRkcmVzcwkBCWlzRGVmaW5lZAEJAKYIAQUHYWRkcmVzcwAMU1RBVFVTX0VNUFRZAAAADFNUQVRVU19SRUFEWQABAAlrU2h1dGRvd24CDnNodXRkb3duX19mbGFnAAtrUHJpY2VBc3NldAIMcHJpY2VfX2Fzc2V0AA5rTGlzdGluZ1ZvbHVtZQIPbGlzdGluZ19fdm9sdW1lABFrUG9vbENvbnRyYWN0SGFzaAIUcG9vbF9fY29udHJhY3RfX2hhc2gAE2tMYXN0RW1wdHlQb29sSW5kZXgCF2xhc3RfX2VtcHR5X3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ArA2R5uTSP7nBTy Diff:
Old | New | Differences | |
---|---|---|---|
94 | 94 | func L () = valueOrErrorMessage(getBinary(z, o), e("pool contract script hash is not set")) | |
95 | 95 | ||
96 | 96 | ||
97 | - | @Callable(M) | |
98 | - | func init (N) = { | |
99 | - | let O = J(M.caller) | |
100 | - | if ((O == O)) | |
101 | - | then [StringEntry(w, N)] | |
97 | + | func M (N) = isDefined(getInteger(z, t(N))) | |
98 | + | ||
99 | + | ||
100 | + | @Callable(O) | |
101 | + | func init (P) = { | |
102 | + | let Q = J(O.caller) | |
103 | + | if ((Q == Q)) | |
104 | + | then [StringEntry(w, P)] | |
102 | 105 | else throw("Strict value is not equal to itself.") | |
103 | 106 | } | |
104 | 107 | ||
105 | 108 | ||
106 | 109 | ||
107 | - | @Callable( | |
108 | - | func addEmptyPool ( | |
109 | - | let | |
110 | - | let | |
111 | - | let | |
110 | + | @Callable(O) | |
111 | + | func addEmptyPool (R,S) = { | |
112 | + | let T = addressFromPublicKey(R) | |
113 | + | let U = (B + 1) | |
114 | + | let V = [if (!(A)) | |
112 | 115 | then true | |
113 | - | else g("not allowed (shutdown)"), if (!( | |
116 | + | else g("not allowed (shutdown)"), if (!(M(T))) | |
114 | 117 | then true | |
115 | 118 | else g("pool address is already registered")] | |
116 | - | if (( | |
119 | + | if ((V == V)) | |
117 | 120 | then { | |
118 | - | let | |
119 | - | $Tuple2(nil, | |
121 | + | let W = [invoke(z, "integerEntry", [p, U], nil), invoke(z, "stringEntry", [r(U), toString(T)], nil), invoke(z, "integerEntry", [t(T), U], nil), invoke(z, "integerEntry", [v(U), j], nil)] | |
122 | + | $Tuple2(nil, W) | |
120 | 123 | } | |
121 | 124 | else throw("Strict value is not equal to itself.") | |
122 | 125 | } | |
123 | 126 | ||
124 | 127 | ||
125 | 128 | ||
126 | - | @Callable( | |
127 | - | func createPool ( | |
128 | - | let | |
129 | + | @Callable(O) | |
130 | + | func createPool (R,S) = { | |
131 | + | let V = [if (!(A)) | |
129 | 132 | then true | |
130 | - | else g("not allowed (shutdown)"), K( | |
133 | + | else g("not allowed (shutdown)"), K(O.caller), if (((B - C) > 0)) | |
131 | 134 | then true | |
132 | - | else g("no empty pools available"), if (( | |
135 | + | else g("no empty pools available"), if ((O.payments[0].assetId == unit)) | |
133 | 136 | then true | |
134 | - | else g("payment should be in WAVES"), if (( | |
137 | + | else g("payment should be in WAVES"), if ((O.payments[0].amount > D)) | |
135 | 138 | then true | |
136 | - | else g("payment amount should be greater than listing volume"), if (isDefined( | |
139 | + | else g("payment amount should be greater than listing volume"), if (isDefined(S[0])) | |
137 | 140 | then true | |
138 | - | else g("tokenName is not provided"), if (isDefined( | |
141 | + | else g("tokenName is not provided"), if (isDefined(S[1])) | |
139 | 142 | then true | |
140 | - | else g("tokenDescription is not provided"), if (isDefined( | |
143 | + | else g("tokenDescription is not provided"), if (isDefined(S[2])) | |
141 | 144 | then true | |
142 | 145 | else g("tokenQuantity is not provided")] | |
143 | - | if (( | |
146 | + | if ((V == V)) | |
144 | 147 | then { | |
145 | - | let | |
146 | - | let | |
147 | - | let | |
148 | - | let | |
149 | - | let | |
150 | - | let | |
151 | - | let | |
152 | - | let | |
153 | - | let | |
154 | - | let | |
155 | - | if (( | |
148 | + | let X = (C + 1) | |
149 | + | let Y = getStringValue(z, r(X)) | |
150 | + | let N = addressFromStringValue(Y) | |
151 | + | let Z = addressFromPublicKey(R) | |
152 | + | let aa = take(Y, 8) | |
153 | + | let ab = toString(Z) | |
154 | + | let ac = S[0] | |
155 | + | let ad = S[1] | |
156 | + | let ae = S[2] | |
157 | + | let af = invoke(z, "initPoolInvoke", [Y, [aa, ab, ac, ad, ae]], [AttachedPayment(O.payments[0].assetId, O.payments[0].amount)]) | |
158 | + | if ((af == af)) | |
156 | 159 | then { | |
157 | - | let | |
158 | - | $Tuple2(nil, | |
160 | + | let W = [invoke(z, "integerEntry", [q, X], nil), invoke(z, "integerEntry", [v(X), k], nil)] | |
161 | + | $Tuple2(nil, W) | |
159 | 162 | } | |
160 | 163 | else throw("Strict value is not equal to itself.") | |
164 | + | } | |
165 | + | else throw("Strict value is not equal to itself.") | |
166 | + | } | |
167 | + | ||
168 | + | ||
169 | + | ||
170 | + | @Callable(O) | |
171 | + | func notifyStatusUpdate (R,S) = { | |
172 | + | let N = addressFromPublicKey(R) | |
173 | + | let V = [if (M(N)) | |
174 | + | then true | |
175 | + | else g("pool not found")] | |
176 | + | if ((V == V)) | |
177 | + | then { | |
178 | + | let X = getIntegerValue(z, t(N)) | |
179 | + | let ag = parseIntValue(S[0]) | |
180 | + | let W = [invoke(z, "integerEntry", [v(X), ag], nil)] | |
181 | + | $Tuple2(nil, W) | |
161 | 182 | } | |
162 | 183 | else throw("Strict value is not equal to itself.") | |
163 | 184 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 7 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | 6 | let b = "WAVES" | |
7 | 7 | ||
8 | 8 | let c = "meme_im_calculator.ride" | |
9 | 9 | ||
10 | 10 | let d = 100000000 | |
11 | 11 | ||
12 | 12 | func e (f) = ((c + ": ") + f) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func g (f) = throw(e(f)) | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func h (i) = isDefined(addressFromString(i)) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | let j = 0 | |
22 | 22 | ||
23 | 23 | let k = 1 | |
24 | 24 | ||
25 | 25 | let l = "shutdown__flag" | |
26 | 26 | ||
27 | 27 | let m = "price__asset" | |
28 | 28 | ||
29 | 29 | let n = "listing__volume" | |
30 | 30 | ||
31 | 31 | let o = "pool__contract__hash" | |
32 | 32 | ||
33 | 33 | let p = "last__empty_pool__index" | |
34 | 34 | ||
35 | 35 | let q = "first__empty__pool__index" | |
36 | 36 | ||
37 | 37 | func r (s) = makeString(["pool", toString(s)], a) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func t (i) = makeString(["pool", toString(i)], a) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func u (i) = makeString(["asset", toString(i)], a) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func v (s) = makeString(["pool", "status", toString(s)], a) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | let w = "factory__address" | |
50 | 50 | ||
51 | 51 | let x = { | |
52 | 52 | let y = getString(this, w) | |
53 | 53 | if ($isInstanceOf(y, "String")) | |
54 | 54 | then { | |
55 | 55 | let f = y | |
56 | 56 | addressFromString(f) | |
57 | 57 | } | |
58 | 58 | else if ($isInstanceOf(y, "Unit")) | |
59 | 59 | then unit | |
60 | 60 | else throw("Match error") | |
61 | 61 | } | |
62 | 62 | ||
63 | 63 | let z = valueOrErrorMessage(x, e("invalid factory address")) | |
64 | 64 | ||
65 | 65 | let A = valueOrElse(getBoolean(z, l), false) | |
66 | 66 | ||
67 | 67 | let B = valueOrElse(getInteger(z, p), 0) | |
68 | 68 | ||
69 | 69 | let C = valueOrElse(getInteger(z, q), 0) | |
70 | 70 | ||
71 | 71 | let D = valueOrElse(getInteger(z, n), 0) | |
72 | 72 | ||
73 | 73 | func E (F) = if ((F == b)) | |
74 | 74 | then unit | |
75 | 75 | else fromBase58String(F) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func G (F) = if ((F == unit)) | |
79 | 79 | then b | |
80 | 80 | else toBase58String(value(F)) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func H (I,i) = if ((I == i)) | |
84 | 84 | then true | |
85 | 85 | else g("permission denied") | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func J (I) = H(I, this) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func K (I) = H(I, z) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func L () = valueOrErrorMessage(getBinary(z, o), e("pool contract script hash is not set")) | |
95 | 95 | ||
96 | 96 | ||
97 | - | @Callable(M) | |
98 | - | func init (N) = { | |
99 | - | let O = J(M.caller) | |
100 | - | if ((O == O)) | |
101 | - | then [StringEntry(w, N)] | |
97 | + | func M (N) = isDefined(getInteger(z, t(N))) | |
98 | + | ||
99 | + | ||
100 | + | @Callable(O) | |
101 | + | func init (P) = { | |
102 | + | let Q = J(O.caller) | |
103 | + | if ((Q == Q)) | |
104 | + | then [StringEntry(w, P)] | |
102 | 105 | else throw("Strict value is not equal to itself.") | |
103 | 106 | } | |
104 | 107 | ||
105 | 108 | ||
106 | 109 | ||
107 | - | @Callable( | |
108 | - | func addEmptyPool ( | |
109 | - | let | |
110 | - | let | |
111 | - | let | |
110 | + | @Callable(O) | |
111 | + | func addEmptyPool (R,S) = { | |
112 | + | let T = addressFromPublicKey(R) | |
113 | + | let U = (B + 1) | |
114 | + | let V = [if (!(A)) | |
112 | 115 | then true | |
113 | - | else g("not allowed (shutdown)"), if (!( | |
116 | + | else g("not allowed (shutdown)"), if (!(M(T))) | |
114 | 117 | then true | |
115 | 118 | else g("pool address is already registered")] | |
116 | - | if (( | |
119 | + | if ((V == V)) | |
117 | 120 | then { | |
118 | - | let | |
119 | - | $Tuple2(nil, | |
121 | + | let W = [invoke(z, "integerEntry", [p, U], nil), invoke(z, "stringEntry", [r(U), toString(T)], nil), invoke(z, "integerEntry", [t(T), U], nil), invoke(z, "integerEntry", [v(U), j], nil)] | |
122 | + | $Tuple2(nil, W) | |
120 | 123 | } | |
121 | 124 | else throw("Strict value is not equal to itself.") | |
122 | 125 | } | |
123 | 126 | ||
124 | 127 | ||
125 | 128 | ||
126 | - | @Callable( | |
127 | - | func createPool ( | |
128 | - | let | |
129 | + | @Callable(O) | |
130 | + | func createPool (R,S) = { | |
131 | + | let V = [if (!(A)) | |
129 | 132 | then true | |
130 | - | else g("not allowed (shutdown)"), K( | |
133 | + | else g("not allowed (shutdown)"), K(O.caller), if (((B - C) > 0)) | |
131 | 134 | then true | |
132 | - | else g("no empty pools available"), if (( | |
135 | + | else g("no empty pools available"), if ((O.payments[0].assetId == unit)) | |
133 | 136 | then true | |
134 | - | else g("payment should be in WAVES"), if (( | |
137 | + | else g("payment should be in WAVES"), if ((O.payments[0].amount > D)) | |
135 | 138 | then true | |
136 | - | else g("payment amount should be greater than listing volume"), if (isDefined( | |
139 | + | else g("payment amount should be greater than listing volume"), if (isDefined(S[0])) | |
137 | 140 | then true | |
138 | - | else g("tokenName is not provided"), if (isDefined( | |
141 | + | else g("tokenName is not provided"), if (isDefined(S[1])) | |
139 | 142 | then true | |
140 | - | else g("tokenDescription is not provided"), if (isDefined( | |
143 | + | else g("tokenDescription is not provided"), if (isDefined(S[2])) | |
141 | 144 | then true | |
142 | 145 | else g("tokenQuantity is not provided")] | |
143 | - | if (( | |
146 | + | if ((V == V)) | |
144 | 147 | then { | |
145 | - | let | |
146 | - | let | |
147 | - | let | |
148 | - | let | |
149 | - | let | |
150 | - | let | |
151 | - | let | |
152 | - | let | |
153 | - | let | |
154 | - | let | |
155 | - | if (( | |
148 | + | let X = (C + 1) | |
149 | + | let Y = getStringValue(z, r(X)) | |
150 | + | let N = addressFromStringValue(Y) | |
151 | + | let Z = addressFromPublicKey(R) | |
152 | + | let aa = take(Y, 8) | |
153 | + | let ab = toString(Z) | |
154 | + | let ac = S[0] | |
155 | + | let ad = S[1] | |
156 | + | let ae = S[2] | |
157 | + | let af = invoke(z, "initPoolInvoke", [Y, [aa, ab, ac, ad, ae]], [AttachedPayment(O.payments[0].assetId, O.payments[0].amount)]) | |
158 | + | if ((af == af)) | |
156 | 159 | then { | |
157 | - | let | |
158 | - | $Tuple2(nil, | |
160 | + | let W = [invoke(z, "integerEntry", [q, X], nil), invoke(z, "integerEntry", [v(X), k], nil)] | |
161 | + | $Tuple2(nil, W) | |
159 | 162 | } | |
160 | 163 | else throw("Strict value is not equal to itself.") | |
164 | + | } | |
165 | + | else throw("Strict value is not equal to itself.") | |
166 | + | } | |
167 | + | ||
168 | + | ||
169 | + | ||
170 | + | @Callable(O) | |
171 | + | func notifyStatusUpdate (R,S) = { | |
172 | + | let N = addressFromPublicKey(R) | |
173 | + | let V = [if (M(N)) | |
174 | + | then true | |
175 | + | else g("pool not found")] | |
176 | + | if ((V == V)) | |
177 | + | then { | |
178 | + | let X = getIntegerValue(z, t(N)) | |
179 | + | let ag = parseIntValue(S[0]) | |
180 | + | let W = [invoke(z, "integerEntry", [v(X), ag], nil)] | |
181 | + | $Tuple2(nil, W) | |
161 | 182 | } | |
162 | 183 | else throw("Strict value is not equal to itself.") | |
163 | 184 | } | |
164 | 185 | ||
165 | 186 |
github/deemru/w8io/169f3d6 41.60 ms ◑