tx · EgWXwdPZ3wgVer7b8GqNk4aCwTFNidQUGMKzvMNHvZH 3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB: -0.01000000 Waves 2023.01.21 12:25 [2414552] smart account 3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB > SELF 0.00000000 Waves
{ "type": 13, "id": "EgWXwdPZ3wgVer7b8GqNk4aCwTFNidQUGMKzvMNHvZH", "fee": 1000000, "feeAssetId": null, "timestamp": 1674293191201, "version": 2, "chainId": 84, "sender": "3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB", "senderPublicKey": "Gd5NihbWQoWuTnSvq25TuV2BYZG4U1e9KDqZn9zBPix7", "proofs": [ "4DhCm5dBrUfuhWYHLXRUmEjNmzdrvd4RmxBwzMb1HYvUNd9rvZdDGnnd5YnoPdmWyZeQC8Qgm4WCXzLgU1QmDD9A" ], "script": "base64:BgITCAISBwoFCAgICAgSBAoCCAgSABIAD3N0b3JhZ2VWZXJpZmllcgkBBXZhbHVlAQkApggBAiMzTjJzNVJ0YUhQQmVuQ3N4MkVDY29GUmJZSHgzbm9aaFhXMQAEYmFuawIjM04xRTZ0WGRkUm9WYVJmUTlkUTN2ZzVMYVcyZnNkOEhLdWIADWFjY2VwdGVkVG9rZW4BIOilarzKd0LycGEyNUpPRYO5uR7lmWcXw3Hq2QuhBK3rAAZ1c2RuSUQCLDNLRlhCR0dMQ2pBNVoyRHVXNERxOWZERHJIakpKUDFaRWthb2FqU3p1S3NDAAdWRVJTSU9OAgUxLjEuOQAUc3RvcmFnZUZlZU11bHRpcGxpZXIAAQEKY2hlY2tFbnRyeQIGcHJlZml4BHV1aWQEByRtYXRjaDAJAJ0IAgUEdGhpcwkArAICBQZwcmVmaXgFBHV1aWQDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAFhBQckbWF0Y2gwBQFhAgROT05FAQ9jaGVja0VudHJ5RW1haWwCBHV1aWQGZG9tYWluBAckbWF0Y2gwCQCdCAIFBHRoaXMJAKwCAgk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9rZUNlcnRpZmljYXRpb24JAAACCAUDaW52BGRBcHAFBHRoaXMHCQAAAggFA2ludgNmZWUAoMIeBwkAAAIIBQNpbnYKZmVlQXNzZXRJZAUEdW5pdAcJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAJANkEAQkBCGFzU3RyaW5nAQkAkQMCCAUDaW52BGFyZ3MAAQkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleSRbFSI=", "height": 2414552, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: D8LCo4WrxBiYapL9LebP1bjp6x8U265R3NjBiHPeu9zw Next: 2o2dtQg6hmzgc1oU1odW2V3t2QnEQ66GRmfwXFc3bozr Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | ||
10 | 10 | let d = "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC" | |
11 | 11 | ||
12 | - | let e = 1 | |
12 | + | let e = "1.1.9" | |
13 | 13 | ||
14 | - | func f (g,h) = { | |
15 | - | let i = getString(this, (g + h)) | |
16 | - | if ($isInstanceOf(i, "String")) | |
14 | + | let f = 1 | |
15 | + | ||
16 | + | func g (h,i) = { | |
17 | + | let j = getString(this, (h + i)) | |
18 | + | if ($isInstanceOf(j, "String")) | |
17 | 19 | then { | |
18 | - | let | |
19 | - | | |
20 | + | let k = j | |
21 | + | k | |
20 | 22 | } | |
21 | 23 | else "NONE" | |
22 | 24 | } | |
23 | 25 | ||
24 | 26 | ||
25 | - | func | |
26 | - | let | |
27 | - | if ($isInstanceOf( | |
27 | + | func l (i,m) = { | |
28 | + | let j = getString(this, ((i + "@") + m)) | |
29 | + | if ($isInstanceOf(j, "String")) | |
28 | 30 | then { | |
29 | - | let | |
30 | - | | |
31 | + | let k = j | |
32 | + | k | |
31 | 33 | } | |
32 | 34 | else "NONE" | |
33 | 35 | } | |
34 | 36 | ||
35 | 37 | ||
36 | - | func | |
37 | - | let | |
38 | - | if ($isInstanceOf( | |
38 | + | func n (i) = { | |
39 | + | let j = getString(this, i) | |
40 | + | if ($isInstanceOf(j, "String")) | |
39 | 41 | then { | |
40 | - | let | |
41 | - | | |
42 | + | let k = j | |
43 | + | k | |
42 | 44 | } | |
43 | 45 | else "NONE" | |
44 | 46 | } | |
45 | 47 | ||
46 | 48 | ||
47 | - | func | |
48 | - | let | |
49 | - | if ($isInstanceOf( | |
49 | + | func o (p) = { | |
50 | + | let j = getInteger(this, ("addr_WHITELISTED_" + p)) | |
51 | + | if ($isInstanceOf(j, "Int")) | |
50 | 52 | then { | |
51 | - | let | |
52 | - | | |
53 | + | let k = j | |
54 | + | k | |
53 | 55 | } | |
54 | 56 | else 0 | |
55 | 57 | } | |
56 | 58 | ||
57 | 59 | ||
58 | - | func | |
59 | - | then (take( | |
60 | + | func q (r) = if (if (if ((size(r) == 35)) | |
61 | + | then (take(r, 2) == "3P") | |
60 | 62 | else false) | |
61 | 63 | then true | |
62 | - | else (take( | |
64 | + | else (take(r, 2) == "3N")) | |
63 | 65 | then true | |
64 | - | else (take( | |
66 | + | else (take(r, 2) == "3M") | |
65 | 67 | ||
66 | 68 | ||
67 | - | func | |
68 | - | then ( | |
69 | - | else ( | |
69 | + | func s (t,r) = if ((size(r) > 0)) | |
70 | + | then (t + 1) | |
71 | + | else (t + 0) | |
70 | 72 | ||
71 | 73 | ||
72 | - | func | |
73 | - | let | |
74 | - | if ($isInstanceOf( | |
74 | + | func u (v) = { | |
75 | + | let j = getString(this, v) | |
76 | + | if ($isInstanceOf(j, "String")) | |
75 | 77 | then { | |
76 | - | let | |
77 | - | if (( | |
78 | + | let k = j | |
79 | + | if ((k == "PENDING")) | |
78 | 80 | then true | |
79 | 81 | else false | |
80 | 82 | } | |
82 | 84 | } | |
83 | 85 | ||
84 | 86 | ||
85 | - | func | |
87 | + | func w (x) = take(drop(x, 1), value(indexOf(drop(x, 1), "\""))) | |
86 | 88 | ||
87 | 89 | ||
88 | - | func x (w,u) = { | |
89 | - | let y = value(indexOf(w, (("\"" + u) + "\":"))) | |
90 | - | let z = drop(w, ((y + size(u)) + 3)) | |
91 | - | let A = v(z) | |
90 | + | func y (x,v) = { | |
91 | + | let z = value(indexOf(x, (("\"" + v) + "\":"))) | |
92 | + | let A = drop(x, ((z + size(v)) + 3)) | |
93 | + | let B = w(A) | |
94 | + | B | |
95 | + | } | |
96 | + | ||
97 | + | ||
98 | + | func C (x,v) = { | |
99 | + | let z = value(indexOf(x, (("\"" + v) + "\":"))) | |
100 | + | let A = take(x, ((z + size(v)) + 3)) | |
92 | 101 | A | |
93 | 102 | } | |
94 | 103 | ||
95 | 104 | ||
96 | - | func | |
97 | - | let | |
98 | - | let | |
99 | - | | |
105 | + | func D (x,v) = { | |
106 | + | let z = value(indexOf(x, (("\"" + v) + "\":"))) | |
107 | + | let A = takeRight(x, (size(x) - ((((z + size(v)) + 3) + 0) + 2))) | |
108 | + | A | |
100 | 109 | } | |
101 | 110 | ||
102 | 111 | ||
103 | - | func C (w,u) = { | |
104 | - | let y = value(indexOf(w, (("\"" + u) + "\":"))) | |
105 | - | let z = takeRight(w, (size(w) - ((((y + size(u)) + 3) + 0) + 2))) | |
106 | - | z | |
107 | - | } | |
108 | - | ||
109 | - | ||
110 | - | func D (E) = { | |
111 | - | let i = E | |
112 | - | if ($isInstanceOf(i, "String")) | |
112 | + | func E (F) = { | |
113 | + | let j = F | |
114 | + | if ($isInstanceOf(j, "String")) | |
113 | 115 | then { | |
114 | - | let | |
115 | - | | |
116 | + | let G = j | |
117 | + | G | |
116 | 118 | } | |
117 | 119 | else throw("Sponsored Public Key String expected") | |
118 | 120 | } | |
119 | 121 | ||
120 | 122 | ||
121 | - | @Callable( | |
122 | - | func fileCertification ( | |
123 | - | let | |
124 | - | let | |
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | then toString(addressFromPublicKey(fromBase58String( | |
129 | - | else toBase58String( | |
130 | - | let | |
131 | - | if (( | |
123 | + | @Callable(H) | |
124 | + | func fileCertification (I,J,i,K,L) = { | |
125 | + | let M = value(H.transactionId) | |
126 | + | let N = g(I, i) | |
127 | + | let O = n(i) | |
128 | + | let P = (this == H.caller) | |
129 | + | let p = if (P) | |
130 | + | then toString(addressFromPublicKey(fromBase58String(L))) | |
131 | + | else toBase58String(H.caller.bytes) | |
132 | + | let Q = o(p) | |
133 | + | if ((N != "NONE")) | |
132 | 134 | then throw("This entry already exist") | |
133 | - | else if (( | |
135 | + | else if ((O != "NONE")) | |
134 | 136 | then throw("This uuid already exist") | |
135 | - | else if ((size( | |
137 | + | else if ((size(i) != 36)) | |
136 | 138 | then throw("Uuid should be 36 characters.") | |
137 | - | else if ((size( | |
139 | + | else if ((size(I) != 64)) | |
138 | 140 | then throw("Hash should be 64 characters.") | |
139 | - | else if ((size( | |
141 | + | else if ((size(J) > 100)) | |
140 | 142 | then throw("Title is too long, 100 characters max.") | |
141 | - | else if (if (if (contains(H, "\"")) | |
142 | - | then true | |
143 | - | else contains(I, "\"")) | |
143 | + | else if (if (if (contains(I, "\"")) | |
144 | 144 | then true | |
145 | 145 | else contains(J, "\"")) | |
146 | + | then true | |
147 | + | else contains(K, "\"")) | |
146 | 148 | then throw("No \" allowed") | |
147 | 149 | else { | |
148 | - | let | |
149 | - | if (( | |
150 | + | let A = (((((((("{\"hash\":\"" + I) + "\",\"timestamp\":") + toString(lastBlock.timestamp)) + ",\"title\":\"") + J) + "\",\"ipfs\":\"") + K) + "\"}") | |
151 | + | if ((Q > 0)) | |
150 | 152 | then { | |
151 | - | let | |
152 | - | then (1 + | |
153 | + | let R = if ((size(K) != 0)) | |
154 | + | then (1 + f) | |
153 | 155 | else 1 | |
154 | - | if ((0 > ( | |
156 | + | if ((0 > (Q - R))) | |
155 | 157 | then throw("Not enough credit") | |
156 | - | else [StringEntry( | |
158 | + | else [StringEntry(i, toBase58String(M)), StringEntry((I + i), toBase58String(M)), StringEntry((J + i), toBase58String(M)), IntegerEntry(("addr_WHITELISTED_" + p), (Q - R)), StringEntry(((("data_fc_" + toBase58String(M)) + "_") + p), A), ScriptTransfer(addressFromStringValue(p), 0, c)] | |
157 | 159 | } | |
158 | - | else if (!( | |
160 | + | else if (!(P)) | |
159 | 161 | then { | |
160 | - | let | |
161 | - | let | |
162 | - | let | |
163 | - | then value( | |
162 | + | let S = value(H.payments[0]) | |
163 | + | let T = value(S.amount) | |
164 | + | let U = if (isDefined(S.assetId)) | |
165 | + | then value(S.assetId) | |
164 | 166 | else throw("Waves is not accepted as payment") | |
165 | - | let | |
166 | - | let | |
167 | - | then ( | |
168 | - | else | |
169 | - | if ((c != | |
167 | + | let V = getIntegerValue(a, ("certification_fee_" + toBase58String(value(U)))) | |
168 | + | let W = if ((size(K) != 0)) | |
169 | + | then (V + (f * V)) | |
170 | + | else V | |
171 | + | if ((c != U)) | |
170 | 172 | then throw("This token is not accepted at the moment") | |
171 | - | else if (if (( | |
172 | - | then (0 >= | |
173 | + | else if (if ((T != W)) | |
174 | + | then (0 >= Q) | |
173 | 175 | else false) | |
174 | 176 | then throw("The price is wrong") | |
175 | - | else [StringEntry( | |
177 | + | else [StringEntry(i, toBase58String(M)), StringEntry((I + i), toBase58String(M)), StringEntry((J + i), toBase58String(M)), StringEntry(((("data_fc_" + toBase58String(M)) + "_") + p), A), ScriptTransfer(addressFromStringValue(b), W, S.assetId)] | |
176 | 178 | } | |
177 | 179 | else throw("You are not allowed to do that") | |
178 | 180 | } | |
180 | 182 | ||
181 | 183 | ||
182 | 184 | ||
183 | - | @Callable( | |
184 | - | func revokeCertification ( | |
185 | - | let | |
186 | - | let | |
187 | - | let | |
188 | - | then toString(addressFromPublicKey(fromBase58String( | |
189 | - | else toBase58String( | |
190 | - | let | |
191 | - | let | |
192 | - | if ($isInstanceOf( | |
185 | + | @Callable(H) | |
186 | + | func revokeCertification (X,L) = { | |
187 | + | let M = value(H.transactionId) | |
188 | + | let P = (this == H.caller) | |
189 | + | let p = if (P) | |
190 | + | then toString(addressFromPublicKey(fromBase58String(L))) | |
191 | + | else toBase58String(H.caller.bytes) | |
192 | + | let N = { | |
193 | + | let j = getString(this, ((("data_fc_" + X) + "_") + p)) | |
194 | + | if ($isInstanceOf(j, "String")) | |
193 | 195 | then { | |
194 | - | let | |
195 | - | | |
196 | + | let k = j | |
197 | + | k | |
196 | 198 | } | |
197 | 199 | else "NONE" | |
198 | 200 | } | |
199 | - | let | |
200 | - | let | |
201 | - | if ($isInstanceOf( | |
201 | + | let Y = { | |
202 | + | let j = getString(this, ("STATUS_FC_" + X)) | |
203 | + | if ($isInstanceOf(j, "String")) | |
202 | 204 | then { | |
203 | - | let | |
204 | - | | |
205 | + | let k = j | |
206 | + | k | |
205 | 207 | } | |
206 | 208 | else "NONE" | |
207 | 209 | } | |
208 | - | let | |
209 | - | let | |
210 | - | if (( | |
210 | + | let Q = o(p) | |
211 | + | let Z = (((dropRight(N, 1) + ",\"status\":\"REVOKED_") + toBase58String(M)) + "\"}") | |
212 | + | if ((Y != "NONE")) | |
211 | 213 | then throw("This certification have already been revoked.") | |
212 | - | else if (( | |
214 | + | else if ((N == "NONE")) | |
213 | 215 | then throw("You cannot change the status of this certification.") | |
214 | - | else if (( | |
215 | - | then [IntegerEntry(("addr_WHITELISTED_" + | |
216 | - | else if (!( | |
216 | + | else if ((Q > 0)) | |
217 | + | then [IntegerEntry(("addr_WHITELISTED_" + p), (Q - 1)), StringEntry(("STATUS_FC_" + X), ("REVOKED_" + toBase58String(M))), StringEntry(((("data_fc_" + X) + "_") + p), Z), ScriptTransfer(addressFromStringValue(p), 0, c)] | |
218 | + | else if (!(P)) | |
217 | 219 | then { | |
218 | - | let | |
219 | - | let | |
220 | - | let | |
221 | - | then value( | |
220 | + | let S = value(H.payments[0]) | |
221 | + | let T = value(S.amount) | |
222 | + | let U = if (isDefined(S.assetId)) | |
223 | + | then value(S.assetId) | |
222 | 224 | else throw("Waves is not accepted as payment") | |
223 | - | let | |
224 | - | if ((c != | |
225 | + | let V = getIntegerValue(a, ("certification_fee_" + toBase58String(value(U)))) | |
226 | + | if ((c != U)) | |
225 | 227 | then throw("This token is not accepted at the moment") | |
226 | - | else if (if (( | |
227 | - | then (0 >= | |
228 | + | else if (if ((T != V)) | |
229 | + | then (0 >= Q) | |
228 | 230 | else false) | |
229 | 231 | then throw("The price is wrong") | |
230 | - | else [StringEntry(("STATUS_FC_" + | |
232 | + | else [StringEntry(("STATUS_FC_" + X), ("REVOKED_" + toBase58String(M))), StringEntry(((("data_fc_" + X) + "_") + p), Z), ScriptTransfer(addressFromStringValue(b), T, S.assetId)] | |
231 | 233 | } | |
232 | 234 | else throw("You are not allowed to do that") | |
233 | 235 | } | |
234 | 236 | ||
235 | 237 | ||
236 | 238 | ||
237 | - | @Callable(G) | |
238 | - | func emailCertification (l,I,h,K) = { | |
239 | - | let L = value(G.transactionId) | |
240 | - | let M = k(l, h) | |
241 | - | let N = m(h) | |
242 | - | let O = (this == G.caller) | |
243 | - | let o = if (O) | |
244 | - | then toString(addressFromPublicKey(fromBase58String(K))) | |
245 | - | else toBase58String(G.caller.bytes) | |
246 | - | let P = n(o) | |
247 | - | if ((M != "NONE")) | |
248 | - | then throw("This entry already exist") | |
249 | - | else if ((N != "NONE")) | |
250 | - | then throw("This uuid already exist") | |
251 | - | else if ((size(h) > 36)) | |
252 | - | then throw("Uuid is too long, 36 characters max.") | |
253 | - | else if ((size(l) > 150)) | |
254 | - | then throw("Domain is too long, 150 characters max.") | |
255 | - | else if ((size(I) > 100)) | |
256 | - | then throw("Title is too long, 100 characters max.") | |
257 | - | else if (if (if (contains(h, "\"")) | |
258 | - | then true | |
259 | - | else contains(I, "\"")) | |
260 | - | then true | |
261 | - | else contains(l, "\"")) | |
262 | - | then throw("No \" allowed") | |
263 | - | else { | |
264 | - | let z = (((((((("{\"messageid\":\"" + h) + "@") + l) + "\",\"timestamp\":") + toString(lastBlock.timestamp)) + ",\"reference\":\"") + I) + "\"}") | |
265 | - | if ((P > 0)) | |
266 | - | then [StringEntry(h, toBase58String(L)), StringEntry(((h + "@") + l), toBase58String(L)), StringEntry((I + h), toBase58String(L)), IntegerEntry(("addr_WHITELISTED_" + o), (P - 1)), StringEntry(((("data_ec_" + toBase58String(L)) + "_") + o), z), ScriptTransfer(addressFromStringValue(o), 0, c)] | |
267 | - | else if (!(O)) | |
268 | - | then { | |
269 | - | let R = value(G.payments[0]) | |
270 | - | let S = value(R.amount) | |
271 | - | let T = if (isDefined(R.assetId)) | |
272 | - | then value(R.assetId) | |
273 | - | else throw("Waves is not accepted as payment") | |
274 | - | let U = getIntegerValue(a, ("certification_fee_" + toBase58String(value(T)))) | |
275 | - | if ((c != T)) | |
276 | - | then throw("This token is not accepted at the moment") | |
277 | - | else if (if ((S != U)) | |
278 | - | then (0 >= P) | |
279 | - | else false) | |
280 | - | then throw("The price is wrong") | |
281 | - | else [StringEntry(h, toBase58String(L)), StringEntry(((h + "@") + l), toBase58String(L)), StringEntry((I + h), toBase58String(L)), StringEntry(((("data_ec_" + toBase58String(L)) + "_") + o), z), ScriptTransfer(addressFromStringValue(b), S, R.assetId)] | |
282 | - | } | |
283 | - | else throw("You are not allowed to do that") | |
284 | - | } | |
239 | + | @Callable(H) | |
240 | + | func usdnSignCredits () = { | |
241 | + | let S = value(H.payments[0]) | |
242 | + | let p = toBase58String(H.caller.bytes) | |
243 | + | let aa = value(S.assetId) | |
244 | + | let T = value(S.amount) | |
245 | + | let ab = ((T * 2) / 1000000) | |
246 | + | let Q = o(p) | |
247 | + | if ((toBase58String(aa) != d)) | |
248 | + | then throw("Only USDN can be exchanged") | |
249 | + | else if (if (((T % 1000000) != 0)) | |
250 | + | then ((T % 1000000) != 500000) | |
251 | + | else false) | |
252 | + | then throw(((("You can only exchange multiple of 0.5, you sent:" + dropRight(toString(T), 6)) + ".") + takeRight(toString(T), 6))) | |
253 | + | else [IntegerEntry(("addr_WHITELISTED_" + p), (Q + ab)), ScriptTransfer(addressFromStringValue(b), T, aa)] | |
285 | 254 | } | |
286 | 255 | ||
287 | 256 | ||
288 | - | ||
289 | - | @Callable(G) | |
290 | - | func createAgreement (H,I,Z,aa,K,h) = { | |
291 | - | let L = value(G.transactionId) | |
292 | - | let M = f(H, h) | |
293 | - | let N = m(h) | |
294 | - | let O = (this == G.caller) | |
295 | - | let o = if (O) | |
296 | - | then toString(addressFromPublicKey(fromBase58String(K))) | |
297 | - | else toBase58String(G.caller.bytes) | |
298 | - | let P = n(o) | |
299 | - | let ab = ((((B(Z, "creator") + "\"") + o) + "\"") + C(Z, "creator")) | |
300 | - | let ac = split(aa, ",") | |
301 | - | let ad = size(ac) | |
302 | - | let ae = StringEntry((I + h), toBase58String(L)) | |
303 | - | let af = StringEntry((H + h), toBase58String(L)) | |
304 | - | let ag = StringEntry(((("data_MA_" + toBase58String(L)) + "_") + o), ab) | |
305 | - | let ah = StringEntry(((o + "_MA_") + toBase58String(L)), ("SIGNED_" + toBase58String(L))) | |
306 | - | let ai = IntegerEntry(("addr_WHITELISTED_" + o), (P - (ad + 1))) | |
307 | - | if ((M != "NONE")) | |
308 | - | then throw("This entry already exist") | |
309 | - | else if ((N != "NONE")) | |
310 | - | then throw("This uuid already exist") | |
311 | - | else if ((size(h) > 36)) | |
312 | - | then throw("Uuid is too long, 36 characters max.") | |
313 | - | else if ((size(H) > 64)) | |
314 | - | then throw("Message-id is too long, 64 characters max.") | |
315 | - | else if ((size(I) > 100)) | |
316 | - | then throw("Title is too long, 100 characters max.") | |
317 | - | else if ((P > 0)) | |
318 | - | then if (((ad + 1) > P)) | |
319 | - | then throw("You don't have enough certification credit") | |
320 | - | else if ((ad == 6)) | |
321 | - | then [ae, af, ag, ah, ai, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[2] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[3] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[4] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[5] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(o), 0, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c), ScriptTransfer(addressFromStringValue(ac[2]), 0, c), ScriptTransfer(addressFromStringValue(ac[3]), 0, c), ScriptTransfer(addressFromStringValue(ac[4]), 0, c), ScriptTransfer(addressFromStringValue(ac[5]), 0, c)] | |
322 | - | else if ((ad == 5)) | |
323 | - | then [ae, af, ag, ah, ai, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[2] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[3] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[4] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(o), 0, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c), ScriptTransfer(addressFromStringValue(ac[2]), 0, c), ScriptTransfer(addressFromStringValue(ac[3]), 0, c), ScriptTransfer(addressFromStringValue(ac[4]), 0, c)] | |
324 | - | else if ((ad == 4)) | |
325 | - | then [ae, af, ag, ah, ai, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[2] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[3] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(o), 0, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c), ScriptTransfer(addressFromStringValue(ac[2]), 0, c), ScriptTransfer(addressFromStringValue(ac[3]), 0, c)] | |
326 | - | else if ((ad == 3)) | |
327 | - | then [ae, af, ag, ah, ai, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[2] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(o), 0, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c), ScriptTransfer(addressFromStringValue(ac[2]), 0, c)] | |
328 | - | else if ((ad == 2)) | |
329 | - | then [ae, af, ag, ah, ai, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(o), 0, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c)] | |
330 | - | else if ((ad == 1)) | |
331 | - | then [ae, af, ag, ah, ai, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(o), 0, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c)] | |
332 | - | else throw("Wrong number of participants") | |
333 | - | else if (!(O)) | |
334 | - | then { | |
335 | - | let R = value(G.payments[0]) | |
336 | - | let S = if (isDefined(R.amount)) | |
337 | - | then value(R.amount) | |
338 | - | else 0 | |
339 | - | let T = if (isDefined(R.assetId)) | |
340 | - | then value(R.assetId) | |
341 | - | else c | |
342 | - | let U = getIntegerValue(a, ("certification_fee_" + toBase58String(value(T)))) | |
343 | - | if (((U * (ad + 1)) > S)) | |
344 | - | then throw(("The price is wrong, it should be " + toString((U * (ad + 1))))) | |
345 | - | else if ((ad == 6)) | |
346 | - | then [ae, af, ag, ah, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[2] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[3] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[4] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[5] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(b), S, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c), ScriptTransfer(addressFromStringValue(ac[2]), 0, c), ScriptTransfer(addressFromStringValue(ac[3]), 0, c), ScriptTransfer(addressFromStringValue(ac[4]), 0, c), ScriptTransfer(addressFromStringValue(ac[5]), 0, c)] | |
347 | - | else if ((ad == 5)) | |
348 | - | then [ae, af, ag, ah, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[2] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[3] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[4] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(b), S, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c), ScriptTransfer(addressFromStringValue(ac[2]), 0, c), ScriptTransfer(addressFromStringValue(ac[3]), 0, c), ScriptTransfer(addressFromStringValue(ac[4]), 0, c)] | |
349 | - | else if ((ad == 4)) | |
350 | - | then [ae, af, ag, ah, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[2] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[3] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(b), S, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c), ScriptTransfer(addressFromStringValue(ac[2]), 0, c), ScriptTransfer(addressFromStringValue(ac[3]), 0, c)] | |
351 | - | else if ((ad == 3)) | |
352 | - | then [ae, af, ag, ah, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[2] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(b), S, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c), ScriptTransfer(addressFromStringValue(ac[2]), 0, c)] | |
353 | - | else if ((ad == 2)) | |
354 | - | then [ae, af, ag, ah, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(b), S, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c)] | |
355 | - | else if ((ad == 1)) | |
356 | - | then [ae, af, ag, ah, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(b), S, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c)] | |
357 | - | else throw(("Needs 1 to 6 recipient addresses, currently sent: " + toString(ad))) | |
358 | - | } | |
359 | - | else throw("You are not allowed to do that") | |
360 | - | } | |
361 | - | ||
362 | - | ||
363 | - | ||
364 | - | @Callable(G) | |
365 | - | func signAgreement (H,aj,K) = { | |
366 | - | let R = value(G.payments[0]) | |
367 | - | let S = value(R.amount) | |
368 | - | let L = value(G.transactionId) | |
369 | - | let O = (this == G.caller) | |
370 | - | let ak = if (O) | |
371 | - | then toString(addressFromPublicKey(fromBase58String(K))) | |
372 | - | else toBase58String(G.caller.bytes) | |
373 | - | let al = t(((ak + "_MA_") + aj)) | |
374 | - | if (!(al)) | |
375 | - | then throw("Sorry there is no pending signature") | |
376 | - | else [StringEntry(((ak + "_MA_") + aj), ("SIGNED_" + toBase58String(L))), ScriptTransfer(addressFromStringValue(ak), 0, c)] | |
377 | - | } | |
378 | - | ||
379 | - | ||
380 | - | ||
381 | - | @Callable(G) | |
382 | - | func usdnSignCredits () = { | |
383 | - | let R = value(G.payments[0]) | |
384 | - | let o = toBase58String(G.caller.bytes) | |
385 | - | let am = value(R.assetId) | |
386 | - | let S = value(R.amount) | |
387 | - | let an = ((S * 2) / 1000000) | |
388 | - | let P = n(o) | |
389 | - | if ((toBase58String(am) != d)) | |
390 | - | then throw("Only USDN can be exchanged") | |
391 | - | else if (if (((S % 1000000) != 0)) | |
392 | - | then ((S % 1000000) != 500000) | |
393 | - | else false) | |
394 | - | then throw(((("You can only exchange multiple of 0.5, you sent:" + dropRight(toString(S), 6)) + ".") + takeRight(toString(S), 6))) | |
395 | - | else [IntegerEntry(("addr_WHITELISTED_" + o), (P + an)), ScriptTransfer(addressFromStringValue(b), S, am)] | |
396 | - | } | |
397 | - | ||
398 | - | ||
399 | - | @Verifier(ao) | |
400 | - | func ap () = { | |
401 | - | let i = ao | |
402 | - | if ($isInstanceOf(i, "InvokeScriptTransaction")) | |
257 | + | @Verifier(ac) | |
258 | + | func ad () = { | |
259 | + | let j = ac | |
260 | + | if ($isInstanceOf(j, "InvokeScriptTransaction")) | |
403 | 261 | then { | |
404 | - | let aq = i | |
405 | - | if (if ((aq.function == "fileCertification")) | |
406 | - | then true | |
407 | - | else (aq.function == "createAgreement")) | |
408 | - | then sigVerify(ao.bodyBytes, ao.proofs[0], fromBase58String(D(aq.args[4]))) | |
409 | - | else if ((aq.function == "emailCertification")) | |
410 | - | then sigVerify(ao.bodyBytes, ao.proofs[0], fromBase58String(D(aq.args[3]))) | |
411 | - | else if ((aq.function == "signAgreement")) | |
412 | - | then sigVerify(ao.bodyBytes, ao.proofs[0], fromBase58String(D(aq.args[2]))) | |
413 | - | else if ((aq.function == "revokeCertification")) | |
414 | - | then sigVerify(ao.bodyBytes, ao.proofs[0], fromBase58String(D(aq.args[1]))) | |
415 | - | else sigVerify(ao.bodyBytes, ao.proofs[0], ao.senderPublicKey) | |
262 | + | let ae = j | |
263 | + | if (if (if (if ((ae.function == "fileCertification")) | |
264 | + | then (ae.dApp == this) | |
265 | + | else false) | |
266 | + | then (ae.fee == 500000) | |
267 | + | else false) | |
268 | + | then (ae.feeAssetId == unit) | |
269 | + | else false) | |
270 | + | then sigVerify(ac.bodyBytes, ac.proofs[0], fromBase58String(E(ae.args[4]))) | |
271 | + | else if (if (if (if ((ae.function == "revokeCertification")) | |
272 | + | then (ae.dApp == this) | |
273 | + | else false) | |
274 | + | then (ae.fee == 500000) | |
275 | + | else false) | |
276 | + | then (ae.feeAssetId == unit) | |
277 | + | else false) | |
278 | + | then sigVerify(ac.bodyBytes, ac.proofs[0], fromBase58String(E(ae.args[1]))) | |
279 | + | else sigVerify(ac.bodyBytes, ac.proofs[0], ac.senderPublicKey) | |
416 | 280 | } | |
417 | - | else sigVerify( | |
281 | + | else sigVerify(ac.bodyBytes, ac.proofs[0], ac.senderPublicKey) | |
418 | 282 | } | |
419 | 283 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = value(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1")) | |
5 | 5 | ||
6 | 6 | let b = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
7 | 7 | ||
8 | 8 | let c = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a' | |
9 | 9 | ||
10 | 10 | let d = "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC" | |
11 | 11 | ||
12 | - | let e = 1 | |
12 | + | let e = "1.1.9" | |
13 | 13 | ||
14 | - | func f (g,h) = { | |
15 | - | let i = getString(this, (g + h)) | |
16 | - | if ($isInstanceOf(i, "String")) | |
14 | + | let f = 1 | |
15 | + | ||
16 | + | func g (h,i) = { | |
17 | + | let j = getString(this, (h + i)) | |
18 | + | if ($isInstanceOf(j, "String")) | |
17 | 19 | then { | |
18 | - | let | |
19 | - | | |
20 | + | let k = j | |
21 | + | k | |
20 | 22 | } | |
21 | 23 | else "NONE" | |
22 | 24 | } | |
23 | 25 | ||
24 | 26 | ||
25 | - | func | |
26 | - | let | |
27 | - | if ($isInstanceOf( | |
27 | + | func l (i,m) = { | |
28 | + | let j = getString(this, ((i + "@") + m)) | |
29 | + | if ($isInstanceOf(j, "String")) | |
28 | 30 | then { | |
29 | - | let | |
30 | - | | |
31 | + | let k = j | |
32 | + | k | |
31 | 33 | } | |
32 | 34 | else "NONE" | |
33 | 35 | } | |
34 | 36 | ||
35 | 37 | ||
36 | - | func | |
37 | - | let | |
38 | - | if ($isInstanceOf( | |
38 | + | func n (i) = { | |
39 | + | let j = getString(this, i) | |
40 | + | if ($isInstanceOf(j, "String")) | |
39 | 41 | then { | |
40 | - | let | |
41 | - | | |
42 | + | let k = j | |
43 | + | k | |
42 | 44 | } | |
43 | 45 | else "NONE" | |
44 | 46 | } | |
45 | 47 | ||
46 | 48 | ||
47 | - | func | |
48 | - | let | |
49 | - | if ($isInstanceOf( | |
49 | + | func o (p) = { | |
50 | + | let j = getInteger(this, ("addr_WHITELISTED_" + p)) | |
51 | + | if ($isInstanceOf(j, "Int")) | |
50 | 52 | then { | |
51 | - | let | |
52 | - | | |
53 | + | let k = j | |
54 | + | k | |
53 | 55 | } | |
54 | 56 | else 0 | |
55 | 57 | } | |
56 | 58 | ||
57 | 59 | ||
58 | - | func | |
59 | - | then (take( | |
60 | + | func q (r) = if (if (if ((size(r) == 35)) | |
61 | + | then (take(r, 2) == "3P") | |
60 | 62 | else false) | |
61 | 63 | then true | |
62 | - | else (take( | |
64 | + | else (take(r, 2) == "3N")) | |
63 | 65 | then true | |
64 | - | else (take( | |
66 | + | else (take(r, 2) == "3M") | |
65 | 67 | ||
66 | 68 | ||
67 | - | func | |
68 | - | then ( | |
69 | - | else ( | |
69 | + | func s (t,r) = if ((size(r) > 0)) | |
70 | + | then (t + 1) | |
71 | + | else (t + 0) | |
70 | 72 | ||
71 | 73 | ||
72 | - | func | |
73 | - | let | |
74 | - | if ($isInstanceOf( | |
74 | + | func u (v) = { | |
75 | + | let j = getString(this, v) | |
76 | + | if ($isInstanceOf(j, "String")) | |
75 | 77 | then { | |
76 | - | let | |
77 | - | if (( | |
78 | + | let k = j | |
79 | + | if ((k == "PENDING")) | |
78 | 80 | then true | |
79 | 81 | else false | |
80 | 82 | } | |
81 | 83 | else false | |
82 | 84 | } | |
83 | 85 | ||
84 | 86 | ||
85 | - | func | |
87 | + | func w (x) = take(drop(x, 1), value(indexOf(drop(x, 1), "\""))) | |
86 | 88 | ||
87 | 89 | ||
88 | - | func x (w,u) = { | |
89 | - | let y = value(indexOf(w, (("\"" + u) + "\":"))) | |
90 | - | let z = drop(w, ((y + size(u)) + 3)) | |
91 | - | let A = v(z) | |
90 | + | func y (x,v) = { | |
91 | + | let z = value(indexOf(x, (("\"" + v) + "\":"))) | |
92 | + | let A = drop(x, ((z + size(v)) + 3)) | |
93 | + | let B = w(A) | |
94 | + | B | |
95 | + | } | |
96 | + | ||
97 | + | ||
98 | + | func C (x,v) = { | |
99 | + | let z = value(indexOf(x, (("\"" + v) + "\":"))) | |
100 | + | let A = take(x, ((z + size(v)) + 3)) | |
92 | 101 | A | |
93 | 102 | } | |
94 | 103 | ||
95 | 104 | ||
96 | - | func | |
97 | - | let | |
98 | - | let | |
99 | - | | |
105 | + | func D (x,v) = { | |
106 | + | let z = value(indexOf(x, (("\"" + v) + "\":"))) | |
107 | + | let A = takeRight(x, (size(x) - ((((z + size(v)) + 3) + 0) + 2))) | |
108 | + | A | |
100 | 109 | } | |
101 | 110 | ||
102 | 111 | ||
103 | - | func C (w,u) = { | |
104 | - | let y = value(indexOf(w, (("\"" + u) + "\":"))) | |
105 | - | let z = takeRight(w, (size(w) - ((((y + size(u)) + 3) + 0) + 2))) | |
106 | - | z | |
107 | - | } | |
108 | - | ||
109 | - | ||
110 | - | func D (E) = { | |
111 | - | let i = E | |
112 | - | if ($isInstanceOf(i, "String")) | |
112 | + | func E (F) = { | |
113 | + | let j = F | |
114 | + | if ($isInstanceOf(j, "String")) | |
113 | 115 | then { | |
114 | - | let | |
115 | - | | |
116 | + | let G = j | |
117 | + | G | |
116 | 118 | } | |
117 | 119 | else throw("Sponsored Public Key String expected") | |
118 | 120 | } | |
119 | 121 | ||
120 | 122 | ||
121 | - | @Callable( | |
122 | - | func fileCertification ( | |
123 | - | let | |
124 | - | let | |
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | then toString(addressFromPublicKey(fromBase58String( | |
129 | - | else toBase58String( | |
130 | - | let | |
131 | - | if (( | |
123 | + | @Callable(H) | |
124 | + | func fileCertification (I,J,i,K,L) = { | |
125 | + | let M = value(H.transactionId) | |
126 | + | let N = g(I, i) | |
127 | + | let O = n(i) | |
128 | + | let P = (this == H.caller) | |
129 | + | let p = if (P) | |
130 | + | then toString(addressFromPublicKey(fromBase58String(L))) | |
131 | + | else toBase58String(H.caller.bytes) | |
132 | + | let Q = o(p) | |
133 | + | if ((N != "NONE")) | |
132 | 134 | then throw("This entry already exist") | |
133 | - | else if (( | |
135 | + | else if ((O != "NONE")) | |
134 | 136 | then throw("This uuid already exist") | |
135 | - | else if ((size( | |
137 | + | else if ((size(i) != 36)) | |
136 | 138 | then throw("Uuid should be 36 characters.") | |
137 | - | else if ((size( | |
139 | + | else if ((size(I) != 64)) | |
138 | 140 | then throw("Hash should be 64 characters.") | |
139 | - | else if ((size( | |
141 | + | else if ((size(J) > 100)) | |
140 | 142 | then throw("Title is too long, 100 characters max.") | |
141 | - | else if (if (if (contains(H, "\"")) | |
142 | - | then true | |
143 | - | else contains(I, "\"")) | |
143 | + | else if (if (if (contains(I, "\"")) | |
144 | 144 | then true | |
145 | 145 | else contains(J, "\"")) | |
146 | + | then true | |
147 | + | else contains(K, "\"")) | |
146 | 148 | then throw("No \" allowed") | |
147 | 149 | else { | |
148 | - | let | |
149 | - | if (( | |
150 | + | let A = (((((((("{\"hash\":\"" + I) + "\",\"timestamp\":") + toString(lastBlock.timestamp)) + ",\"title\":\"") + J) + "\",\"ipfs\":\"") + K) + "\"}") | |
151 | + | if ((Q > 0)) | |
150 | 152 | then { | |
151 | - | let | |
152 | - | then (1 + | |
153 | + | let R = if ((size(K) != 0)) | |
154 | + | then (1 + f) | |
153 | 155 | else 1 | |
154 | - | if ((0 > ( | |
156 | + | if ((0 > (Q - R))) | |
155 | 157 | then throw("Not enough credit") | |
156 | - | else [StringEntry( | |
158 | + | else [StringEntry(i, toBase58String(M)), StringEntry((I + i), toBase58String(M)), StringEntry((J + i), toBase58String(M)), IntegerEntry(("addr_WHITELISTED_" + p), (Q - R)), StringEntry(((("data_fc_" + toBase58String(M)) + "_") + p), A), ScriptTransfer(addressFromStringValue(p), 0, c)] | |
157 | 159 | } | |
158 | - | else if (!( | |
160 | + | else if (!(P)) | |
159 | 161 | then { | |
160 | - | let | |
161 | - | let | |
162 | - | let | |
163 | - | then value( | |
162 | + | let S = value(H.payments[0]) | |
163 | + | let T = value(S.amount) | |
164 | + | let U = if (isDefined(S.assetId)) | |
165 | + | then value(S.assetId) | |
164 | 166 | else throw("Waves is not accepted as payment") | |
165 | - | let | |
166 | - | let | |
167 | - | then ( | |
168 | - | else | |
169 | - | if ((c != | |
167 | + | let V = getIntegerValue(a, ("certification_fee_" + toBase58String(value(U)))) | |
168 | + | let W = if ((size(K) != 0)) | |
169 | + | then (V + (f * V)) | |
170 | + | else V | |
171 | + | if ((c != U)) | |
170 | 172 | then throw("This token is not accepted at the moment") | |
171 | - | else if (if (( | |
172 | - | then (0 >= | |
173 | + | else if (if ((T != W)) | |
174 | + | then (0 >= Q) | |
173 | 175 | else false) | |
174 | 176 | then throw("The price is wrong") | |
175 | - | else [StringEntry( | |
177 | + | else [StringEntry(i, toBase58String(M)), StringEntry((I + i), toBase58String(M)), StringEntry((J + i), toBase58String(M)), StringEntry(((("data_fc_" + toBase58String(M)) + "_") + p), A), ScriptTransfer(addressFromStringValue(b), W, S.assetId)] | |
176 | 178 | } | |
177 | 179 | else throw("You are not allowed to do that") | |
178 | 180 | } | |
179 | 181 | } | |
180 | 182 | ||
181 | 183 | ||
182 | 184 | ||
183 | - | @Callable( | |
184 | - | func revokeCertification ( | |
185 | - | let | |
186 | - | let | |
187 | - | let | |
188 | - | then toString(addressFromPublicKey(fromBase58String( | |
189 | - | else toBase58String( | |
190 | - | let | |
191 | - | let | |
192 | - | if ($isInstanceOf( | |
185 | + | @Callable(H) | |
186 | + | func revokeCertification (X,L) = { | |
187 | + | let M = value(H.transactionId) | |
188 | + | let P = (this == H.caller) | |
189 | + | let p = if (P) | |
190 | + | then toString(addressFromPublicKey(fromBase58String(L))) | |
191 | + | else toBase58String(H.caller.bytes) | |
192 | + | let N = { | |
193 | + | let j = getString(this, ((("data_fc_" + X) + "_") + p)) | |
194 | + | if ($isInstanceOf(j, "String")) | |
193 | 195 | then { | |
194 | - | let | |
195 | - | | |
196 | + | let k = j | |
197 | + | k | |
196 | 198 | } | |
197 | 199 | else "NONE" | |
198 | 200 | } | |
199 | - | let | |
200 | - | let | |
201 | - | if ($isInstanceOf( | |
201 | + | let Y = { | |
202 | + | let j = getString(this, ("STATUS_FC_" + X)) | |
203 | + | if ($isInstanceOf(j, "String")) | |
202 | 204 | then { | |
203 | - | let | |
204 | - | | |
205 | + | let k = j | |
206 | + | k | |
205 | 207 | } | |
206 | 208 | else "NONE" | |
207 | 209 | } | |
208 | - | let | |
209 | - | let | |
210 | - | if (( | |
210 | + | let Q = o(p) | |
211 | + | let Z = (((dropRight(N, 1) + ",\"status\":\"REVOKED_") + toBase58String(M)) + "\"}") | |
212 | + | if ((Y != "NONE")) | |
211 | 213 | then throw("This certification have already been revoked.") | |
212 | - | else if (( | |
214 | + | else if ((N == "NONE")) | |
213 | 215 | then throw("You cannot change the status of this certification.") | |
214 | - | else if (( | |
215 | - | then [IntegerEntry(("addr_WHITELISTED_" + | |
216 | - | else if (!( | |
216 | + | else if ((Q > 0)) | |
217 | + | then [IntegerEntry(("addr_WHITELISTED_" + p), (Q - 1)), StringEntry(("STATUS_FC_" + X), ("REVOKED_" + toBase58String(M))), StringEntry(((("data_fc_" + X) + "_") + p), Z), ScriptTransfer(addressFromStringValue(p), 0, c)] | |
218 | + | else if (!(P)) | |
217 | 219 | then { | |
218 | - | let | |
219 | - | let | |
220 | - | let | |
221 | - | then value( | |
220 | + | let S = value(H.payments[0]) | |
221 | + | let T = value(S.amount) | |
222 | + | let U = if (isDefined(S.assetId)) | |
223 | + | then value(S.assetId) | |
222 | 224 | else throw("Waves is not accepted as payment") | |
223 | - | let | |
224 | - | if ((c != | |
225 | + | let V = getIntegerValue(a, ("certification_fee_" + toBase58String(value(U)))) | |
226 | + | if ((c != U)) | |
225 | 227 | then throw("This token is not accepted at the moment") | |
226 | - | else if (if (( | |
227 | - | then (0 >= | |
228 | + | else if (if ((T != V)) | |
229 | + | then (0 >= Q) | |
228 | 230 | else false) | |
229 | 231 | then throw("The price is wrong") | |
230 | - | else [StringEntry(("STATUS_FC_" + | |
232 | + | else [StringEntry(("STATUS_FC_" + X), ("REVOKED_" + toBase58String(M))), StringEntry(((("data_fc_" + X) + "_") + p), Z), ScriptTransfer(addressFromStringValue(b), T, S.assetId)] | |
231 | 233 | } | |
232 | 234 | else throw("You are not allowed to do that") | |
233 | 235 | } | |
234 | 236 | ||
235 | 237 | ||
236 | 238 | ||
237 | - | @Callable(G) | |
238 | - | func emailCertification (l,I,h,K) = { | |
239 | - | let L = value(G.transactionId) | |
240 | - | let M = k(l, h) | |
241 | - | let N = m(h) | |
242 | - | let O = (this == G.caller) | |
243 | - | let o = if (O) | |
244 | - | then toString(addressFromPublicKey(fromBase58String(K))) | |
245 | - | else toBase58String(G.caller.bytes) | |
246 | - | let P = n(o) | |
247 | - | if ((M != "NONE")) | |
248 | - | then throw("This entry already exist") | |
249 | - | else if ((N != "NONE")) | |
250 | - | then throw("This uuid already exist") | |
251 | - | else if ((size(h) > 36)) | |
252 | - | then throw("Uuid is too long, 36 characters max.") | |
253 | - | else if ((size(l) > 150)) | |
254 | - | then throw("Domain is too long, 150 characters max.") | |
255 | - | else if ((size(I) > 100)) | |
256 | - | then throw("Title is too long, 100 characters max.") | |
257 | - | else if (if (if (contains(h, "\"")) | |
258 | - | then true | |
259 | - | else contains(I, "\"")) | |
260 | - | then true | |
261 | - | else contains(l, "\"")) | |
262 | - | then throw("No \" allowed") | |
263 | - | else { | |
264 | - | let z = (((((((("{\"messageid\":\"" + h) + "@") + l) + "\",\"timestamp\":") + toString(lastBlock.timestamp)) + ",\"reference\":\"") + I) + "\"}") | |
265 | - | if ((P > 0)) | |
266 | - | then [StringEntry(h, toBase58String(L)), StringEntry(((h + "@") + l), toBase58String(L)), StringEntry((I + h), toBase58String(L)), IntegerEntry(("addr_WHITELISTED_" + o), (P - 1)), StringEntry(((("data_ec_" + toBase58String(L)) + "_") + o), z), ScriptTransfer(addressFromStringValue(o), 0, c)] | |
267 | - | else if (!(O)) | |
268 | - | then { | |
269 | - | let R = value(G.payments[0]) | |
270 | - | let S = value(R.amount) | |
271 | - | let T = if (isDefined(R.assetId)) | |
272 | - | then value(R.assetId) | |
273 | - | else throw("Waves is not accepted as payment") | |
274 | - | let U = getIntegerValue(a, ("certification_fee_" + toBase58String(value(T)))) | |
275 | - | if ((c != T)) | |
276 | - | then throw("This token is not accepted at the moment") | |
277 | - | else if (if ((S != U)) | |
278 | - | then (0 >= P) | |
279 | - | else false) | |
280 | - | then throw("The price is wrong") | |
281 | - | else [StringEntry(h, toBase58String(L)), StringEntry(((h + "@") + l), toBase58String(L)), StringEntry((I + h), toBase58String(L)), StringEntry(((("data_ec_" + toBase58String(L)) + "_") + o), z), ScriptTransfer(addressFromStringValue(b), S, R.assetId)] | |
282 | - | } | |
283 | - | else throw("You are not allowed to do that") | |
284 | - | } | |
239 | + | @Callable(H) | |
240 | + | func usdnSignCredits () = { | |
241 | + | let S = value(H.payments[0]) | |
242 | + | let p = toBase58String(H.caller.bytes) | |
243 | + | let aa = value(S.assetId) | |
244 | + | let T = value(S.amount) | |
245 | + | let ab = ((T * 2) / 1000000) | |
246 | + | let Q = o(p) | |
247 | + | if ((toBase58String(aa) != d)) | |
248 | + | then throw("Only USDN can be exchanged") | |
249 | + | else if (if (((T % 1000000) != 0)) | |
250 | + | then ((T % 1000000) != 500000) | |
251 | + | else false) | |
252 | + | then throw(((("You can only exchange multiple of 0.5, you sent:" + dropRight(toString(T), 6)) + ".") + takeRight(toString(T), 6))) | |
253 | + | else [IntegerEntry(("addr_WHITELISTED_" + p), (Q + ab)), ScriptTransfer(addressFromStringValue(b), T, aa)] | |
285 | 254 | } | |
286 | 255 | ||
287 | 256 | ||
288 | - | ||
289 | - | @Callable(G) | |
290 | - | func createAgreement (H,I,Z,aa,K,h) = { | |
291 | - | let L = value(G.transactionId) | |
292 | - | let M = f(H, h) | |
293 | - | let N = m(h) | |
294 | - | let O = (this == G.caller) | |
295 | - | let o = if (O) | |
296 | - | then toString(addressFromPublicKey(fromBase58String(K))) | |
297 | - | else toBase58String(G.caller.bytes) | |
298 | - | let P = n(o) | |
299 | - | let ab = ((((B(Z, "creator") + "\"") + o) + "\"") + C(Z, "creator")) | |
300 | - | let ac = split(aa, ",") | |
301 | - | let ad = size(ac) | |
302 | - | let ae = StringEntry((I + h), toBase58String(L)) | |
303 | - | let af = StringEntry((H + h), toBase58String(L)) | |
304 | - | let ag = StringEntry(((("data_MA_" + toBase58String(L)) + "_") + o), ab) | |
305 | - | let ah = StringEntry(((o + "_MA_") + toBase58String(L)), ("SIGNED_" + toBase58String(L))) | |
306 | - | let ai = IntegerEntry(("addr_WHITELISTED_" + o), (P - (ad + 1))) | |
307 | - | if ((M != "NONE")) | |
308 | - | then throw("This entry already exist") | |
309 | - | else if ((N != "NONE")) | |
310 | - | then throw("This uuid already exist") | |
311 | - | else if ((size(h) > 36)) | |
312 | - | then throw("Uuid is too long, 36 characters max.") | |
313 | - | else if ((size(H) > 64)) | |
314 | - | then throw("Message-id is too long, 64 characters max.") | |
315 | - | else if ((size(I) > 100)) | |
316 | - | then throw("Title is too long, 100 characters max.") | |
317 | - | else if ((P > 0)) | |
318 | - | then if (((ad + 1) > P)) | |
319 | - | then throw("You don't have enough certification credit") | |
320 | - | else if ((ad == 6)) | |
321 | - | then [ae, af, ag, ah, ai, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[2] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[3] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[4] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[5] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(o), 0, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c), ScriptTransfer(addressFromStringValue(ac[2]), 0, c), ScriptTransfer(addressFromStringValue(ac[3]), 0, c), ScriptTransfer(addressFromStringValue(ac[4]), 0, c), ScriptTransfer(addressFromStringValue(ac[5]), 0, c)] | |
322 | - | else if ((ad == 5)) | |
323 | - | then [ae, af, ag, ah, ai, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[2] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[3] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[4] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(o), 0, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c), ScriptTransfer(addressFromStringValue(ac[2]), 0, c), ScriptTransfer(addressFromStringValue(ac[3]), 0, c), ScriptTransfer(addressFromStringValue(ac[4]), 0, c)] | |
324 | - | else if ((ad == 4)) | |
325 | - | then [ae, af, ag, ah, ai, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[2] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[3] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(o), 0, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c), ScriptTransfer(addressFromStringValue(ac[2]), 0, c), ScriptTransfer(addressFromStringValue(ac[3]), 0, c)] | |
326 | - | else if ((ad == 3)) | |
327 | - | then [ae, af, ag, ah, ai, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[2] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(o), 0, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c), ScriptTransfer(addressFromStringValue(ac[2]), 0, c)] | |
328 | - | else if ((ad == 2)) | |
329 | - | then [ae, af, ag, ah, ai, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(o), 0, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c)] | |
330 | - | else if ((ad == 1)) | |
331 | - | then [ae, af, ag, ah, ai, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(o), 0, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c)] | |
332 | - | else throw("Wrong number of participants") | |
333 | - | else if (!(O)) | |
334 | - | then { | |
335 | - | let R = value(G.payments[0]) | |
336 | - | let S = if (isDefined(R.amount)) | |
337 | - | then value(R.amount) | |
338 | - | else 0 | |
339 | - | let T = if (isDefined(R.assetId)) | |
340 | - | then value(R.assetId) | |
341 | - | else c | |
342 | - | let U = getIntegerValue(a, ("certification_fee_" + toBase58String(value(T)))) | |
343 | - | if (((U * (ad + 1)) > S)) | |
344 | - | then throw(("The price is wrong, it should be " + toString((U * (ad + 1))))) | |
345 | - | else if ((ad == 6)) | |
346 | - | then [ae, af, ag, ah, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[2] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[3] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[4] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[5] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(b), S, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c), ScriptTransfer(addressFromStringValue(ac[2]), 0, c), ScriptTransfer(addressFromStringValue(ac[3]), 0, c), ScriptTransfer(addressFromStringValue(ac[4]), 0, c), ScriptTransfer(addressFromStringValue(ac[5]), 0, c)] | |
347 | - | else if ((ad == 5)) | |
348 | - | then [ae, af, ag, ah, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[2] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[3] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[4] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(b), S, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c), ScriptTransfer(addressFromStringValue(ac[2]), 0, c), ScriptTransfer(addressFromStringValue(ac[3]), 0, c), ScriptTransfer(addressFromStringValue(ac[4]), 0, c)] | |
349 | - | else if ((ad == 4)) | |
350 | - | then [ae, af, ag, ah, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[2] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[3] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(b), S, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c), ScriptTransfer(addressFromStringValue(ac[2]), 0, c), ScriptTransfer(addressFromStringValue(ac[3]), 0, c)] | |
351 | - | else if ((ad == 3)) | |
352 | - | then [ae, af, ag, ah, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[2] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(b), S, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c), ScriptTransfer(addressFromStringValue(ac[2]), 0, c)] | |
353 | - | else if ((ad == 2)) | |
354 | - | then [ae, af, ag, ah, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), StringEntry(((ac[1] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(b), S, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c), ScriptTransfer(addressFromStringValue(ac[1]), 0, c)] | |
355 | - | else if ((ad == 1)) | |
356 | - | then [ae, af, ag, ah, StringEntry(((ac[0] + "_MA_") + toBase58String(L)), "PENDING"), ScriptTransfer(addressFromStringValue(b), S, c), ScriptTransfer(addressFromStringValue(ac[0]), 0, c)] | |
357 | - | else throw(("Needs 1 to 6 recipient addresses, currently sent: " + toString(ad))) | |
358 | - | } | |
359 | - | else throw("You are not allowed to do that") | |
360 | - | } | |
361 | - | ||
362 | - | ||
363 | - | ||
364 | - | @Callable(G) | |
365 | - | func signAgreement (H,aj,K) = { | |
366 | - | let R = value(G.payments[0]) | |
367 | - | let S = value(R.amount) | |
368 | - | let L = value(G.transactionId) | |
369 | - | let O = (this == G.caller) | |
370 | - | let ak = if (O) | |
371 | - | then toString(addressFromPublicKey(fromBase58String(K))) | |
372 | - | else toBase58String(G.caller.bytes) | |
373 | - | let al = t(((ak + "_MA_") + aj)) | |
374 | - | if (!(al)) | |
375 | - | then throw("Sorry there is no pending signature") | |
376 | - | else [StringEntry(((ak + "_MA_") + aj), ("SIGNED_" + toBase58String(L))), ScriptTransfer(addressFromStringValue(ak), 0, c)] | |
377 | - | } | |
378 | - | ||
379 | - | ||
380 | - | ||
381 | - | @Callable(G) | |
382 | - | func usdnSignCredits () = { | |
383 | - | let R = value(G.payments[0]) | |
384 | - | let o = toBase58String(G.caller.bytes) | |
385 | - | let am = value(R.assetId) | |
386 | - | let S = value(R.amount) | |
387 | - | let an = ((S * 2) / 1000000) | |
388 | - | let P = n(o) | |
389 | - | if ((toBase58String(am) != d)) | |
390 | - | then throw("Only USDN can be exchanged") | |
391 | - | else if (if (((S % 1000000) != 0)) | |
392 | - | then ((S % 1000000) != 500000) | |
393 | - | else false) | |
394 | - | then throw(((("You can only exchange multiple of 0.5, you sent:" + dropRight(toString(S), 6)) + ".") + takeRight(toString(S), 6))) | |
395 | - | else [IntegerEntry(("addr_WHITELISTED_" + o), (P + an)), ScriptTransfer(addressFromStringValue(b), S, am)] | |
396 | - | } | |
397 | - | ||
398 | - | ||
399 | - | @Verifier(ao) | |
400 | - | func ap () = { | |
401 | - | let i = ao | |
402 | - | if ($isInstanceOf(i, "InvokeScriptTransaction")) | |
257 | + | @Verifier(ac) | |
258 | + | func ad () = { | |
259 | + | let j = ac | |
260 | + | if ($isInstanceOf(j, "InvokeScriptTransaction")) | |
403 | 261 | then { | |
404 | - | let aq = i | |
405 | - | if (if ((aq.function == "fileCertification")) | |
406 | - | then true | |
407 | - | else (aq.function == "createAgreement")) | |
408 | - | then sigVerify(ao.bodyBytes, ao.proofs[0], fromBase58String(D(aq.args[4]))) | |
409 | - | else if ((aq.function == "emailCertification")) | |
410 | - | then sigVerify(ao.bodyBytes, ao.proofs[0], fromBase58String(D(aq.args[3]))) | |
411 | - | else if ((aq.function == "signAgreement")) | |
412 | - | then sigVerify(ao.bodyBytes, ao.proofs[0], fromBase58String(D(aq.args[2]))) | |
413 | - | else if ((aq.function == "revokeCertification")) | |
414 | - | then sigVerify(ao.bodyBytes, ao.proofs[0], fromBase58String(D(aq.args[1]))) | |
415 | - | else sigVerify(ao.bodyBytes, ao.proofs[0], ao.senderPublicKey) | |
262 | + | let ae = j | |
263 | + | if (if (if (if ((ae.function == "fileCertification")) | |
264 | + | then (ae.dApp == this) | |
265 | + | else false) | |
266 | + | then (ae.fee == 500000) | |
267 | + | else false) | |
268 | + | then (ae.feeAssetId == unit) | |
269 | + | else false) | |
270 | + | then sigVerify(ac.bodyBytes, ac.proofs[0], fromBase58String(E(ae.args[4]))) | |
271 | + | else if (if (if (if ((ae.function == "revokeCertification")) | |
272 | + | then (ae.dApp == this) | |
273 | + | else false) | |
274 | + | then (ae.fee == 500000) | |
275 | + | else false) | |
276 | + | then (ae.feeAssetId == unit) | |
277 | + | else false) | |
278 | + | then sigVerify(ac.bodyBytes, ac.proofs[0], fromBase58String(E(ae.args[1]))) | |
279 | + | else sigVerify(ac.bodyBytes, ac.proofs[0], ac.senderPublicKey) | |
416 | 280 | } | |
417 | - | else sigVerify( | |
281 | + | else sigVerify(ac.bodyBytes, ac.proofs[0], ac.senderPublicKey) | |
418 | 282 | } | |
419 | 283 |
github/deemru/w8io/026f985 125.29 ms ◑