Skip to content

Commit 4dadfe5

Browse files
feat: add update global configuration function and documentation
1 parent f0ea9a5 commit 4dadfe5

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ p2p/
6464
│ ├── instructions/ # Instruction logic
6565
│ │ ├── mod.rs
6666
│ │ ├── initialize.rs # Global configuration initialization
67+
│ │ ├── update_global_config.rs # Update global configuration
6768
│ │ ├── create_escrow.rs # Escrow creation
6869
│ │ ├── mark_escrow_as_paid.rs # Mark fiat payment
6970
│ │ ├── release_tokens_in_escrow.rs # Release tokens
@@ -343,6 +344,29 @@ pub fn withdraw_spl(
343344

344345
---
345346

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+
346370
## 📊 States and Accounts
347371

348372
### EscrowState
@@ -450,6 +474,7 @@ The project includes a complete TypeScript test suite that covers all program fl
450474
6. **`create_dispute`**: Dispute and re-dispute creation
451475
7. **`resolve_dispute`**: Dispute resolution by authority
452476
8. **`withdraw_spl`**: Accumulated fees withdrawal
477+
9. **`update_global_config`**: Update global configuration parameters
453478

454479
### Test Structure
455480

@@ -664,7 +689,8 @@ The authority is the account that can:
664689

665690
- Resolve disputes
666691
- Withdraw accumulated fees
667-
- Configure global parameters
692+
- Update global configuration parameters (fees, deadlines, dispute deposit)
693+
- Transfer authority to a new account
668694

669695
Make sure to use a secure wallet (e.g., Ledger) for mainnet.
670696

0 commit comments

Comments
 (0)