|
64 | 64 | │ ├── instructions/ # Instruction logic |
65 | 65 | │ │ ├── mod.rs |
66 | 66 | │ │ ├── initialize.rs # Global configuration initialization |
| 67 | +│ │ ├── update_global_config.rs # Update global configuration |
67 | 68 | │ │ ├── create_escrow.rs # Escrow creation |
68 | 69 | │ │ ├── mark_escrow_as_paid.rs # Mark fiat payment |
69 | 70 | │ │ ├── release_tokens_in_escrow.rs # Release tokens |
@@ -343,6 +344,29 @@ pub fn withdraw_spl( |
343 | 344 |
|
344 | 345 | --- |
345 | 346 |
|
| 347 | +### 9. `update_global_config` |
| 348 | + |
| 349 | +Updates the program's global configuration parameters (authority only). |
| 350 | + |
| 351 | +```rust |
| 352 | +pub fn update_global_config( |
| 353 | + ctx: Context<UpdateGlobalConfig>, |
| 354 | + authority: Option<Pubkey>, |
| 355 | + fee_bps: Option<u16>, |
| 356 | + fiat_deadline_secs: Option<i64>, |
| 357 | + dispute_deadline_secs: Option<i64>, |
| 358 | + dispute_fee_escrow: Option<u64>, |
| 359 | +) -> Result<()> |
| 360 | +``` |
| 361 | + |
| 362 | +**Requirements:** |
| 363 | + |
| 364 | +- Only the current authority can call this function |
| 365 | +- All parameters are optional - provide only what needs to be changed |
| 366 | +- Changes affect all future escrows, not existing ones |
| 367 | + |
| 368 | +--- |
| 369 | + |
346 | 370 | ## 📊 States and Accounts |
347 | 371 |
|
348 | 372 | ### EscrowState |
@@ -450,6 +474,7 @@ The project includes a complete TypeScript test suite that covers all program fl |
450 | 474 | 6. **`create_dispute`**: Dispute and re-dispute creation |
451 | 475 | 7. **`resolve_dispute`**: Dispute resolution by authority |
452 | 476 | 8. **`withdraw_spl`**: Accumulated fees withdrawal |
| 477 | +9. **`update_global_config`**: Update global configuration parameters |
453 | 478 |
|
454 | 479 | ### Test Structure |
455 | 480 |
|
@@ -664,7 +689,8 @@ The authority is the account that can: |
664 | 689 |
|
665 | 690 | - Resolve disputes |
666 | 691 | - Withdraw accumulated fees |
667 | | -- Configure global parameters |
| 692 | +- Update global configuration parameters (fees, deadlines, dispute deposit) |
| 693 | +- Transfer authority to a new account |
668 | 694 |
|
669 | 695 | Make sure to use a secure wallet (e.g., Ledger) for mainnet. |
670 | 696 |
|
|
0 commit comments