Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,20 @@ pub fn init(env: Env, admin: Address, usdc_token: Address)
| `global_pool` | `GlobalPool` | Total balance and last updated timestamp |
| `ContractVersion` | `BytesN<32>` | WASM hash set by `upgrade` function |

#### Per-developer minimum claim balance

Settlement admins can configure a per-developer minimum accrued balance that must be met before `withdraw_developer_balance` settles a claim:

```rust
pub fn set_minimum_balance(env: Env, caller: Address, developer: Address, min_balance: i128)
pub fn get_minimum_balance(env: Env, developer: Address) -> i128
```

- `caller` must be the current settlement admin.
- `min_balance` is denominated in token micro-units and must be non-negative.
- `0` means no minimum requirement, matching previous behavior.
- If a developer's accrued balance is below their configured minimum, withdrawal returns `SettlementError::MinimumBalanceRequired` before token transfer or balance mutation.

#### Upgradeability

The settlement contract supports in-place upgrades via an admin-gated `upgrade` function.
Expand Down
6 changes: 5 additions & 1 deletion contracts/settlement/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ use soroban_sdk::contracterror;
/// | 20 | MigrationNotFound | No migration is pending for the source |
/// | 21 | TimelockNotExpired | Migration delay has not elapsed |
/// | 22 | MigrationBalanceChanged | Approved amount is no longer available |
/// | 23 | OverDraft | Withdrawal amount exceeds the developer's balance |
/// | 23 | MinimumBalanceRequired | Developer balance is below configured claim minimum |
/// | 24 | InvalidClaimWindow | Claim window end is before start |
/// | 25 | ClaimWindowClosed | Claim attempted outside developer's claim window |
#[contracterror]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u32)]
Expand Down Expand Up @@ -58,4 +60,6 @@ pub enum SettlementError {
TimelockNotExpired = 21,
MigrationBalanceChanged = 22,
MinimumBalanceRequired = 23,
InvalidClaimWindow = 24,
ClaimWindowClosed = 25,
}
Loading
Loading