Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 3 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ members = [
"insurance",
"family_wallet",
"data_migration",
"reporting",
"orchestrator",
"cli",
"scenarios",

"testutils",

"integration_tests",
]
default-members = [
Expand All @@ -28,26 +22,23 @@ default-members = [
"insurance",
"family_wallet",
"data_migration",
"reporting",
"orchestrator",

]
resolver = "2"

[dependencies]
soroban-sdk = "21.0.0"
soroban-sdk = "22.0.1"
remittance_split = { path = "./remittance_split" }
savings_goals = { path = "./savings_goals" }
bill_payments = { path = "./bill_payments" }
insurance = { path = "./insurance" }
family_wallet = { path = "./family_wallet" }
reporting = { path = "./reporting" }
remitwise-common = { path = "./remitwise-common" }
orchestrator = { path = "./orchestrator" }

[dev-dependencies]
soroban-sdk = { version = "21.0.0", features = ["testutils"] }
[patch.crates-io]
ed25519-dalek = "2.2.0"
soroban-sdk = { version = "22.0.1", features = ["testutils"] }

[profile.release]
opt-level = "z"
Expand Down
6 changes: 3 additions & 3 deletions NEW_CONTRACT_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ use your_contract::{YourContract, YourContractClient};
fn setup() -> (Env, Address, YourContractClient<'static>) {
let env = Env::default();
env.mock_all_auths(); // mock auth for all calls
let contract_id = env.register_contract(None, YourContract);
let contract_id = env.register(YourContract, ());
let client = YourContractClient::new(&env, &contract_id);
let admin = Address::generate(&env);
(env, admin, client)
Expand Down Expand Up @@ -273,13 +273,13 @@ use your_contract::{YourContract, YourContractClient};
fn bench_create_record() {
let env = Env::default();
env.mock_all_auths();
let id = env.register_contract(None, YourContract);
let id = env.register(YourContract, ());
let client = YourContractClient::new(&env, &id);

// ... setup ...
client.create_record(/* args */);

let resources = env.budget().borrow().resource_per_type();
let resources = env.cost_estimate().budget().borrow().resource_per_type();
println!("CPU (instructions): {}", resources.cpu_insns);
println!("Memory (bytes): {}", resources.mem_bytes);

Expand Down
24 changes: 22 additions & 2 deletions VERSION_COMPATIBILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,30 @@ If you encounter compatibility issues:

This document is maintained alongside contract releases.

**Last Updated**: 2024
**Next Review**: Upon next SDK release
**Maintainer**: RemitWise Development Team

## Automated Compatibility Testing

To ensure long-term stability and safe version evolution, the workspace includes an automated compatibility matrix test suite located in `integration_tests/tests/multi_contract_integration.rs`.

### Test Coverage

1. **Contract Upgrade Compatibility**: Validates that contracts can be upgraded (WASM update) while preserving all instance and persistent storage.
2. **Version Matrix Interoperability**: Verifies that all contracts in the warehouse report consistent `CONTRACT_VERSION` levels and can interact correctly across versions.
3. **Data Migration Consistency**: Ensures that the off-chain `data_migration` logic remains synchronized with on-chain snapshot data structures.

### Running Tests

```bash
cargo test -p integration_tests
```

### Compatibility Requirements

- All new contract versions MUST implement `get_version() -> u32`.
- Storage layout changes MUST be accompanied by a migration path or documented as a breaking change.
- `SNAPSHOT_VERSION` MUST be incremented if internal data structures for export/import are modified.

---

**Legend**:
Expand Down
Empty file added ast.txt
Empty file.
4 changes: 2 additions & 2 deletions bill_payments/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ edition = "2021"
crate-type = ["cdylib", "rlib"]

[dependencies]
soroban-sdk = "21.0.0"
soroban-sdk = "22.0.1"
remitwise-common = { path = "../remitwise-common" }

[dev-dependencies]
proptest = "1.10.0"
soroban-sdk = { version = "21.0.0", features = ["testutils"] }
soroban-sdk = { version = "22.0.1", features = ["testutils"] }
testutils = { path = "../testutils" }


21 changes: 19 additions & 2 deletions bill_payments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ pub struct Bill {
- `InvalidAmount = 3`: Amount is zero or negative
- `InvalidFrequency = 4`: Recurring bill has zero frequency
- `Unauthorized = 5`: Caller is not the bill owner
- `InvalidDueDate = 12`: Due date is zero or not strictly in the future
- `InvalidRecurrenceCombination = 15`: Non-recurring bill provided with non-zero frequency
- `FrequencyOverflow = 16`: Recurrence interval overflows due-date arithmetic

### Functions

Expand All @@ -91,7 +94,19 @@ Creates a new bill.

**Returns:** Bill ID on success

**Errors:** InvalidAmount, InvalidFrequency
**Errors:** InvalidAmount, InvalidDueDate, InvalidFrequency, InvalidRecurrenceCombination, FrequencyOverflow

### Fail-Fast Create Validation

The `create_bill` entrypoint validates all bill-creation constraints before any state write, which guarantees fail-fast behavior and deterministic error semantics:

- `InvalidAmount`: `amount <= 0`
- `InvalidDueDate`: `due_date == 0` or `due_date <= ledger_timestamp`
- `InvalidFrequency`: `recurring == true` and `frequency_days == 0`
- `InvalidRecurrenceCombination`: `recurring == false` and `frequency_days != 0`
- `FrequencyOverflow`: `frequency_days * 86400` or `due_date + cadence_seconds` overflows

This prevents malformed records from ever entering contract state.

#### `pay_bill(env, caller, bill_id) -> Result<(), Error>`
Marks a bill as paid.
Expand Down Expand Up @@ -228,4 +243,6 @@ Bills can represent insurance premiums, working alongside the insurance contract
- All functions require proper authorization
- Owners can only manage their own bills
- Input validation prevents invalid states
- Storage TTL is managed to prevent bloat
- Storage TTL is managed to prevent bloat
- Recurrence overflow checks prevent timestamp wrap-around during next-bill scheduling
- Validation is fail-fast and runs before mutating any persistent storage
Loading
Loading