open_creator_protocol 0.4.2

Open Creator Protocol is an open protocol for creators to build utilities and policy engine for their tokens
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
use crate::state::MintState;
use anchor_lang::prelude::*;
use anchor_spl::{
    metadata::MetadataAccount,
    token::{Mint, TokenAccount},
};
use serde::{Deserialize, Serialize};
use solana_program::{
    instruction::Instruction, program_option::COption, serialize_utils::read_u16, sysvar::instructions::load_instruction_at_checked,
};
use std::cmp::max;

#[derive(Default, Serialize)]
pub struct ActionCtx {
    pub action: String,
    pub program_ids: Vec<String>,
    pub mint: String,
    pub mint_state: MintStateCtx,
    pub mint_account: Option<MintAccountCtx>,
    pub metadata: Option<MetadataCtx>,
    pub payer: Option<String>,
    pub from: Option<String>, // owner of the from_account, and many action's initiator
    pub to: Option<String>,   // owner of the to_account
    pub last_memo_signer: Option<String>,
    pub last_memo_data: Option<String>,
}

impl ActionCtx {
    fn parse_memo(&mut self, ix: Instruction) {
        if ix.program_id != spl_memo::id() {
            return;
        }
        if ix.accounts.is_empty() {
            return;
        }
        self.last_memo_signer = match ix.accounts[0].is_signer {
            true => Some(ix.accounts[0].pubkey.to_string()),
            false => None,
        };
        self.last_memo_data = match String::from_utf8(ix.data) {
            Ok(s) => Some(s),
            Err(_) => None,
        };
    }

    pub fn parse_instructions(&mut self, ixs: &AccountInfo<'_>) -> Result<()> {
        let instruction_sysvar = ixs.try_borrow_data()?;
        let mut current: usize = 0;
        let num_instructions = read_u16(&mut current, &instruction_sysvar).expect("Invalid instruction");
        let mut program_ids = Vec::<String>::new();
        for i in 0..num_instructions {
            let ix = load_instruction_at_checked(i.into(), ixs).expect("Failed to get instruction");
            program_ids.push(ix.program_id.to_string());
            self.parse_memo(ix);
        }

        self.program_ids = program_ids;
        Ok(())
    }
}

fn to_option_str(c_option: COption<Pubkey>) -> Option<String> {
    match c_option {
        COption::Some(pubkey) => Some(pubkey.to_string()),
        COption::None => None,
    }
}

#[derive(Default, Serialize, Deserialize)]
pub struct MetadataCtx {
    pub name: String,
    pub symbol: String,
    pub uri: String,
    pub seller_fee_basis_points: u16,
    pub update_authority: String,
}

impl From<Box<Account<'_, MetadataAccount>>> for MetadataCtx {
    fn from(metadata: Box<Account<'_, MetadataAccount>>) -> Self {
        Self {
            name: metadata.name.clone(),
            symbol: metadata.symbol.clone(),
            uri: metadata.uri.clone(),
            seller_fee_basis_points: metadata.seller_fee_basis_points,
            update_authority: metadata.update_authority.to_string(),
        }
    }
}

#[derive(Default, Serialize, Deserialize)]
pub struct TokenAccountCtx {
    pub owner: String,
    pub amount: u64,
    pub delegate: Option<String>,
    pub delegated_amount: u64,
}

impl From<Box<Account<'_, TokenAccount>>> for TokenAccountCtx {
    fn from(account: Box<Account<'_, TokenAccount>>) -> Self {
        Self {
            owner: account.owner.to_string(),
            amount: account.amount,
            delegate: to_option_str(account.delegate),
            delegated_amount: account.delegated_amount,
        }
    }
}

#[derive(Default, Serialize, Deserialize)]
pub struct MintAccountCtx {
    pub mint_authority: Option<String>,
    pub supply: u64,
    pub decimals: u8,
    pub is_initialized: bool,
    pub freeze_authority: Option<String>,
}

impl From<Box<Account<'_, Mint>>> for MintAccountCtx {
    fn from(mint: Box<Account<'_, Mint>>) -> Self {
        MintAccountCtx {
            mint_authority: to_option_str(mint.mint_authority),
            supply: mint.supply,
            decimals: mint.decimals,
            is_initialized: mint.is_initialized,
            freeze_authority: to_option_str(mint.freeze_authority),
        }
    }
}

#[derive(Default, Serialize, Deserialize)]
pub struct DatetimeCtx {
    pub utc_timestamp: i64,
    pub utc_hour: u8,
}

impl From<i64> for DatetimeCtx {
    fn from(secs: i64) -> Self {
        Self {
            utc_timestamp: secs,
            utc_hour: (secs / 3600 % 24) as u8,
        }
    }
}

#[derive(Default, Serialize, Deserialize)]
pub struct MintStateCtx {
    pub version: u8,
    pub policy: String,
    pub locked_by: Option<String>,
    pub last_approved_at: i64,
    pub last_transferred_at: i64,
    pub transferred_count: u32,

    // derived from existing fields
    pub derived_cooldown: i64,
    pub derived_datetime: DatetimeCtx,
}

impl From<MintState> for MintStateCtx {
    fn from(mint_state: MintState) -> Self {
        let now = match Clock::get() {
            Ok(clock) => clock.unix_timestamp,
            Err(_) => 0, // use 0 as the default when Clock is not available, usually in test
        };

        MintStateCtx {
            version: mint_state.version,
            policy: mint_state.policy.to_string(),
            locked_by: mint_state.locked_by.map(|x| x.to_string()),
            last_approved_at: mint_state.last_approved_at,
            last_transferred_at: mint_state.last_transferred_at,
            transferred_count: mint_state.transferred_count,

            derived_cooldown: (now - mint_state.last_approved_at).clamp(0, max(0, now - mint_state.last_transferred_at)),
            derived_datetime: now.into(),
        }
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    use crate::state::Policy;

    fn policy_fixture() -> Policy {
        Policy {
            version: 0,
            bump: [0; 1],
            uuid: Pubkey::new_unique(),
            authority: Pubkey::new_unique(),
            dynamic_royalty: None,
            json_rule: Some(r#"{"conditions":{"and":[{"field":"action","operator":"string_not_equals","value":""}]},"events":[]}"#.to_string()),
        }
    }

    fn action_ctx_fixture() -> ActionCtx {
        ActionCtx {
            action: "transfer".to_string(),
            program_ids: vec![],
            last_memo_data: None,
            last_memo_signer: None,
            mint: Pubkey::new_unique().to_string(),
            mint_state: MintState::default().into(),
            mint_account: None,
            metadata: None,
            payer: Some(Pubkey::new_unique().to_string()),
            from: Some(Pubkey::new_unique().to_string()),
            to: Some(Pubkey::new_unique().to_string()),
        }
    }

    fn metadata_ctx_fixture() -> MetadataCtx {
        MetadataCtx {
            name: "Test".to_string(),
            uri: "https://test.com".to_string(),
            symbol: "TEST".to_string(),
            seller_fee_basis_points: 500,
            update_authority: Pubkey::new_unique().to_string(),
        }
    }

    #[test]
    fn test_policy_validation() {
        let mut policy = policy_fixture();

        policy.json_rule = Some(
            r#"
          {"conditions":{"not":{"field":"program_ids","operator":"string_does_not_contain_any","value":[PLACEHOLDER]}},"events":[]}
        "#
            .replace(
                "PLACEHOLDER",
                &(0..10)
                    .map(|_| format!("\"{}\"", Pubkey::new_unique()))
                    .collect::<Vec<String>>()
                    .join(","),
            ),
        );
        assert!(policy.valid().is_ok());

        let mut policy = policy_fixture();
        policy.json_rule = Some(
            r#"
          {"conditions":{"not":{"field":"program_ids","operator":"string_does_not_contain_any","value":[PLACEHOLDER]}},"events":[]}
        "#
            .replace(
                "PLACEHOLDER",
                &(0..18)
                    .map(|_| format!("\"{}\"", Pubkey::new_unique()))
                    .collect::<Vec<String>>()
                    .join(","),
            ),
        );
        assert!(policy.valid().is_ok());

        let mut policy = policy_fixture();
        policy.json_rule = Some(
            r#"
          {"conditions":{"not":{"field":"program_ids","operator":"string_does_not_contain_any","value":[PLACEHOLDER]}},"events":[]}
        "#
            .replace(
                "PLACEHOLDER",
                &(0..100)
                    .map(|_| format!("\"{}\"", Pubkey::new_unique()))
                    .collect::<Vec<String>>()
                    .join(","),
            ),
        );
        assert!(policy.valid().is_err());
    }

    #[test]
    fn test_policy_pass_all() {
        let policy = policy_fixture();
        let action_ctx = action_ctx_fixture();

        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_ok());
    }

    #[test]
    fn test_policy_program_ids_single_allowlist() {
        let program_id = Pubkey::new_unique().to_string();
        let mut policy = policy_fixture();
        policy.json_rule = Some(
            r#"
          {"conditions":{"and":[{"field":"program_ids","operator":"string_contains","value":"PLACEHOLDER"}]},"events":[]}
        "#
            .replace("PLACEHOLDER", &program_id),
        );

        let mut action_ctx = action_ctx_fixture();
        action_ctx.program_ids = vec![program_id];
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_ok());

        let mut action_ctx = action_ctx_fixture();
        action_ctx.program_ids = vec![Pubkey::new_unique().to_string()];
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_err());
    }

    #[test]
    fn test_policy_program_ids_denylist() {
        let program_id = Pubkey::new_unique().to_string();
        let mut policy = policy_fixture();
        policy.json_rule = Some(
            r#"
          {"conditions":{"and":[{"field":"program_ids","operator":"string_does_not_contain_any","value":["PLACEHOLDER"]}]},"events":[]}
        "#
            .replace("PLACEHOLDER", &program_id),
        );
        let mut action_ctx = action_ctx_fixture();
        action_ctx.program_ids = vec![program_id];
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_err());

        let mut action_ctx = action_ctx_fixture();
        action_ctx.program_ids = vec![Pubkey::new_unique().to_string()];
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_ok());

        let program_id = Pubkey::new_unique().to_string();
        let mut policy = policy_fixture();
        policy.json_rule =
            Some(r#" {"conditions":{"and":[{"field":"program_ids","operator":"string_does_not_contain_any","value":[]}]},"events":[]} "#.to_owned());
        let mut action_ctx = action_ctx_fixture();
        action_ctx.program_ids = vec![program_id];
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_ok());

        let program_id = Pubkey::new_unique().to_string();
        let mut policy = policy_fixture();
        policy.json_rule = Some(
            r#" {"conditions":{"and":[{"field":"program_ids","operator":"string_does_not_contain_any","value":[""]}]},"events":[]} "#.to_owned(),
        );
        let mut action_ctx = action_ctx_fixture();
        action_ctx.program_ids = vec![program_id];
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_ok());
    }

    #[test]
    fn test_policy_program_ids_multiple_allowlist() {
        let allowed_program_ids = [Pubkey::new_unique().to_string(), Pubkey::new_unique().to_string()];
        let mut policy = policy_fixture();
        policy.json_rule = Some(
            r#"
          {"conditions":{"field":"program_ids","operator":"string_is_subset","value":[PLACEHOLDER]},"events":[]}
        "#
            .replace("PLACEHOLDER", &allowed_program_ids.clone().map(|x| format!("\"{}\"", x)).join(",")),
        );
        assert!(policy.valid().is_ok());

        // ok with just allowed_program_ids[0]
        let mut action_ctx = action_ctx_fixture();
        action_ctx.program_ids = vec![allowed_program_ids[0].clone()];
        assert!(policy.matches(&action_ctx).is_ok());

        // ok with just allowed_program_ids[1]
        let mut action_ctx = action_ctx_fixture();
        action_ctx.program_ids = vec![allowed_program_ids[1].clone()];
        assert!(policy.matches(&action_ctx).is_ok());

        // not ok with some other program_id
        let mut action_ctx = action_ctx_fixture();
        action_ctx.program_ids = vec![Pubkey::new_unique().to_string()];
        assert!(policy.matches(&action_ctx).is_err());

        // not ok with some other program_id and allowed_program_ids[0]
        let mut action_ctx = action_ctx_fixture();
        action_ctx.program_ids = vec![Pubkey::new_unique().to_string(), allowed_program_ids.clone()[0].clone()];
        assert!(policy.matches(&action_ctx).is_err());
    }

    #[test]
    fn test_policy_with_metadata_policy() {
        let mut action_ctx = action_ctx_fixture();
        let mut metadata = metadata_ctx_fixture();
        metadata.name = "abc FROZEN".to_owned();
        action_ctx.metadata = Some(metadata);
        let mut policy = policy_fixture();
        policy.json_rule =
            Some(r#"{"conditions":{"field":"metadata/name","operator":"string_has_substring","value":"FROZEN"},"events":[]}"#.to_owned());
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_ok());

        let mut action_ctx = action_ctx_fixture();
        let mut metadata = metadata_ctx_fixture();
        metadata.name = "abc".to_owned();
        action_ctx.metadata = Some(metadata);
        let mut policy = policy_fixture();
        policy.json_rule =
            Some(r#"{"events":[],"conditions":{"or":[{"field":"action","operator":"string_not_equals","value":"transfer"},{"and":[{"not":{"field":"metadata/name","operator":"string_has_substring","value":"FROZEN"}},{"or":[{"field":"to","operator":"string_not_equals","value":"DWuopEsTrg5qWMSMVT1hoiVTRQG9PkGJZSbXiKAxHYbn"},{"field":"metadata/name","operator":"string_has_substring","value":"WINNER"}]}]}]}}"#.to_owned());
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_ok());

        let mut action_ctx = action_ctx_fixture();
        let mut metadata = metadata_ctx_fixture();
        metadata.name = "abc FROZEN".to_owned();
        action_ctx.metadata = Some(metadata);
        let mut policy = policy_fixture();
        policy.json_rule =
            Some(r#"{"events":[],"conditions":{"or":[{"field":"action","operator":"string_not_equals","value":"transfer"},{"and":[{"not":{"field":"metadata/name","operator":"string_has_substring","value":"FROZEN"}},{"or":[{"field":"to","operator":"string_not_equals","value":"DWuopEsTrg5qWMSMVT1hoiVTRQG9PkGJZSbXiKAxHYbn"},{"field":"metadata/name","operator":"string_has_substring","value":"WINNER"}]}]}]}}"#.to_owned());
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_err());

        let mut action_ctx = action_ctx_fixture();
        let mut metadata = metadata_ctx_fixture();
        metadata.name = "abc".to_owned();
        action_ctx.metadata = Some(metadata);
        action_ctx.to = Some("DWuopEsTrg5qWMSMVT1hoiVTRQG9PkGJZSbXiKAxHYbn".to_owned());
        let mut policy = policy_fixture();
        policy.json_rule =
            Some(r#"{"events":[],"conditions":{"or":[{"field":"action","operator":"string_not_equals","value":"transfer"},{"and":[{"not":{"field":"metadata/name","operator":"string_has_substring","value":"FROZEN"}},{"or":[{"field":"to","operator":"string_not_equals","value":"DWuopEsTrg5qWMSMVT1hoiVTRQG9PkGJZSbXiKAxHYbn"},{"field":"metadata/name","operator":"string_has_substring","value":"WINNER"}]}]}]}}"#.to_owned());
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_err());

        let mut action_ctx = action_ctx_fixture();
        let mut metadata = metadata_ctx_fixture();
        metadata.name = "abc WINNER".to_owned();
        action_ctx.metadata = Some(metadata);
        action_ctx.to = Some("DWuopEsTrg5qWMSMVT1hoiVTRQG9PkGJZSbXiKAxHYbn".to_owned());
        let mut policy = policy_fixture();
        policy.json_rule =
            Some(r#"{"events":[],"conditions":{"or":[{"field":"action","operator":"string_not_equals","value":"transfer"},{"and":[{"not":{"field":"metadata/name","operator":"string_has_substring","value":"FROZEN"}},{"or":[{"field":"to","operator":"string_not_equals","value":"DWuopEsTrg5qWMSMVT1hoiVTRQG9PkGJZSbXiKAxHYbn"},{"field":"metadata/name","operator":"string_has_substring","value":"WINNER"}]}]}]}}"#.to_owned());
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_ok());

        let mut action_ctx = action_ctx_fixture();
        let mut metadata = metadata_ctx_fixture();
        metadata.name = "abc".to_owned();
        action_ctx.action = "approve".to_owned();
        action_ctx.metadata = Some(metadata);
        action_ctx.to = Some("DWuopEsTrg5qWMSMVT1hoiVTRQG9PkGJZSbXiKAxHYbn".to_owned());
        let mut policy = policy_fixture();
        policy.json_rule =
            Some(r#"{"events":[],"conditions":{"or":[{"field":"action","operator":"string_not_equals","value":"transfer"},{"and":[{"not":{"field":"metadata/name","operator":"string_has_substring","value":"FROZEN"}},{"or":[{"field":"to","operator":"string_not_equals","value":"DWuopEsTrg5qWMSMVT1hoiVTRQG9PkGJZSbXiKAxHYbn"},{"field":"metadata/name","operator":"string_has_substring","value":"WINNER"}]}]}]}}"#.to_owned());
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_ok());
    }

    #[test]
    fn test_policy_with_metadata_name_substring() {
        let mut action_ctx = action_ctx_fixture();
        let mut metadata = metadata_ctx_fixture();
        metadata.name = "NFT #1 (frozen)".to_string();
        action_ctx.metadata = Some(metadata);

        let mut policy = policy_fixture();
        policy.json_rule = Some(
            r#"
          {"conditions":{"field":"metadata/name","operator":"string_has_substring","value":"(frozen)"},"events":[]}
        "#
            .into(),
        );
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_ok());

        let mut policy = policy_fixture();
        policy.json_rule = Some(
            r#"
          {"conditions":{"field":"metadata/name","operator":"string_has_substring","value":""},"events":[]}
        "#
            .into(),
        );
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_ok());

        let mut policy = policy_fixture();
        policy.json_rule = Some(
            r#"
          {"conditions":{"field":"metadata/name","operator":"string_has_substring","value":"SFT"},"events":[]}
        "#
            .into(),
        );
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_err());
    }

    #[test]
    fn test_policy_with_derived_datetime() {
        let mut action_ctx = action_ctx_fixture();
        action_ctx.mint_state.derived_datetime = 100.into();
        let mut policy = policy_fixture();
        policy.json_rule = Some(
            r#"
          {"conditions":{"field":"mint_state/derived_datetime/utc_timestamp","operator":"int_greater_than","value":90},"events":[]}
        "#
            .to_string(),
        );
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_ok());

        let mut action_ctx = action_ctx_fixture();
        action_ctx.mint_state.derived_datetime = 100.into();
        action_ctx.action = "transfer".to_string();
        let mut policy = policy_fixture();
        policy.json_rule = Some(r#"
          {"conditions":{"and": [{"field":"mint_state/derived_datetime/utc_timestamp","operator":"int_greater_than","value":90}, {"field":"action","operator":"string_equals","value":"transfer"}]},"events":[]}
        "#.to_string());
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_ok());

        let mut action_ctx = action_ctx_fixture();
        action_ctx.mint_state.derived_datetime = 100.into();
        action_ctx.action = "transfer".to_string();
        let mut policy = policy_fixture();
        policy.json_rule = Some(r#"
          {"conditions":{"and": [{"field":"mint_state/derived_datetime/utc_timestamp","operator":"int_greater_than","value":110}, {"field":"action","operator":"string_equals","value":"transfer"}]},"events":[]}
        "#.to_string());
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_err());

        let mut action_ctx = action_ctx_fixture();
        action_ctx.mint_state.derived_datetime = 100.into();
        let mut policy = policy_fixture();
        policy.json_rule = Some(
            r#"
          {"conditions":{"and": [{"field":"mint_state/derived_datetime/utc_hour","operator":"int_in","value":[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]}]},"events":[]}
        "#
            .to_string(),
        );
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_ok());

        let mut action_ctx = action_ctx_fixture();
        action_ctx.mint_state.derived_datetime = (100 + 3600 * 12).into();
        let mut policy = policy_fixture();
        policy.json_rule = Some(
            r#"
          {"conditions":{"and": [{"field":"mint_state/derived_datetime/utc_hour","operator":"int_in","value":[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]}]},"events":[]}
        "#
            .to_string(),
        );
        assert!(policy.valid().is_ok());
        assert!(policy.matches(&action_ctx).is_err());
    }
}