Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
51626eb
feat(sep40): add the SEP-40 types and trait
hpmaxi Nov 5, 2026
bb0dd35
feat(bindings): add the vault view the feed reads
hpmaxi Nov 5, 2026
d302210
feat(feed): convert a WAD NAV to 14 decimals
hpmaxi Nov 5, 2026
82b986a
feat(feed): follow a vault from the constructor
hpmaxi Nov 6, 2026
5cd7a57
feat(feed): quote the share through SEP-40
hpmaxi Nov 6, 2026
be6934c
fix(feed): share one oracle read between quotes and docs
hpmaxi Nov 6, 2026
a9925f4
test(feed): read a kit vault and its oracle
hpmaxi Nov 10, 2026
e06962d
feat(feed): upgrade only through the timelock
hpmaxi Nov 10, 2026
8b006ce
fix(feed): cover pause eta, hand-over apply, name the wind-down guard
hpmaxi Nov 10, 2026
cbaa6fd
test(feed): upgrade the built feed Wasm
hpmaxi Nov 10, 2026
914bc00
feat(harness): deploy the SEP-40 feed
hpmaxi Nov 10, 2026
8a87b56
docs: record the SEP-40 feed decisions
hpmaxi Nov 10, 2026
c297f21
docs: describe the SEP-40 feed
hpmaxi Nov 10, 2026
30aef73
chore: add the SEP-40 feed to the testnet set
hpmaxi Nov 10, 2026
2ae9150
docs: fix sep40-feed documentation accuracy
hpmaxi Nov 10, 2026
a366dbf
fix(harness): verify the feed's vault and record its own commit
hpmaxi Nov 10, 2026
19bd2e2
docs(harness): rebuild a later feed at its own commit
hpmaxi Nov 10, 2026
72f7593
feat(examples): add a SEP-40 consumer contract
hpmaxi Nov 10, 2026
c8afda9
test(harness): read the feed from a consumer
hpmaxi Nov 11, 2026
ab178a4
fix(harness): scope force and check event payload
hpmaxi Nov 11, 2026
e24abeb
style(harness): shorten the send comment
hpmaxi Nov 11, 2026
e7d2c22
docs: record the SEP-40 consumer on testnet
hpmaxi Nov 11, 2026
707f2c6
docs: say the consumer run can attest a NAV
hpmaxi Nov 11, 2026
2416c10
test(examples): check temporary storage is empty
hpmaxi Nov 11, 2026
21aa722
fix(examples): refuse a non-contract feed
hpmaxi Nov 11, 2026
976c9dd
docs: correct the recorded SEP-40 no-price run
hpmaxi Nov 11, 2026
2850566
refactor(harness): drop unused recordedEvent
hpmaxi Nov 11, 2026
350d1b0
refactor(harness): merge wasmOf and exampleWasmOf
hpmaxi Nov 11, 2026
cc698e3
test(harness): verify the sent consumer event too
hpmaxi Nov 11, 2026
b482ccb
docs: note the example in the doc-size test
hpmaxi Nov 11, 2026
d63f656
docs(harness): say test:sep40 attests a stale NAV
hpmaxi Nov 11, 2026
0a3cd79
fix(harness): attest on a fresh network
hpmaxi Nov 11, 2026
32c6c7b
docs: map the threat model to STRIDE
hpmaxi Nov 11, 2026
fc675a9
docs: record a SEP-40 price read on testnet
hpmaxi Nov 11, 2026
8d27725
docs: add the STRIDE threat model in Stellar's template
hpmaxi Nov 12, 2026
24eeeeb
docs: add the security scan and its remediation plan
hpmaxi Nov 12, 2026
9d9c6d0
refactor(feed): fix price scales at compile time
hpmaxi Nov 13, 2026
cafcefd
docs: keep the SEP-40 decisions in the design doc
hpmaxi Nov 13, 2026
e05e4ef
docs(feed): explain the zero resolution and base
hpmaxi Nov 13, 2026
ee96ae3
docs: link the feed design, not a decision record
hpmaxi Nov 13, 2026
0c8e49f
test(harness): read contract events of a sent tx
hpmaxi Nov 13, 2026
6079c4b
docs(examples): leave the price age to callers
hpmaxi Nov 13, 2026
39be5b2
Merge commit 'e05e4efaad7c04af293d7cf1cba4c74ddefc99b0' into feat/237…
hpmaxi Nov 13, 2026
99700e9
Merge pull request #439 from BootNodeDev/feat/236-sep40-feed
hpmaxi Nov 13, 2026
cd9bf78
Merge pull request #440 from BootNodeDev/feat/237-sep40-consumer
hpmaxi Nov 13, 2026
0e62656
Merge pull request #449 from BootNodeDev/docs/443-audit-bank-evidence
hpmaxi Nov 13, 2026
6726208
Merge branch 'tranche-3' into docs/438-stride-threat-model
hpmaxi Nov 13, 2026
b55b79f
Merge pull request #442 from BootNodeDev/docs/438-stride-threat-model
hpmaxi Nov 13, 2026
5517494
docs: restore O13 and number the feed threat O14
hpmaxi Nov 13, 2026
268d752
Merge pull request #455 from BootNodeDev/docs/threat-model-o14
hpmaxi Nov 13, 2026
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
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/3-epic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ body:
attributes:
label: Architecture & technical considerations
description:
Key technical decisions, patterns, constraints, or risks. Link to ADRs
or design docs if they exist.
Key technical decisions, patterns, constraints, or risks. Link to design
docs if they exist.
validations:
required: false

Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,13 @@ jobs:
set -o pipefail
stellar contract build --package share-token
stellar contract build --package nav-oracle
stellar contract build --package sep40-feed
CARGO_TARGET_DIR=target/upgrade-probe stellar contract build --package share-token --features upgrade_probe
CARGO_TARGET_DIR=target/upgrade-probe stellar contract build --package nav-oracle --features upgrade_probe
CARGO_TARGET_DIR=target/upgrade-probe stellar contract build --package async-vault --features upgrade_probe
cargo test --locked -p async-vault -p nav-oracle --features upgrade_wasm with_wasm 2>&1 | tee upgrade-tests.log
scripts/ci/check-tests-ran.sh upgrade-tests.log test::upgrade::with_wasm test::governance::with_wasm
CARGO_TARGET_DIR=target/upgrade-probe stellar contract build --package sep40-feed --features upgrade_probe
cargo test --locked -p async-vault -p nav-oracle -p sep40-feed --features upgrade_wasm with_wasm 2>&1 | tee upgrade-tests.log
scripts/ci/check-tests-ran.sh upgrade-tests.log test::upgrade::with_wasm test::governance::with_wasm test::timelock::with_wasm

network:
needs: changes
Expand Down Expand Up @@ -297,8 +299,9 @@ jobs:
echo "Expected $INDEX to exist and be non-empty after client generation."
exit 1
fi
# Count one exported const per contract
EXPECTED=$(find contracts -mindepth 1 -maxdepth 1 -type d | wc -l | tr -d ' ')
# Count one exported const per contract; the scaffold deploys every
# workspace contract, examples included.
EXPECTED=$(find contracts examples -mindepth 1 -maxdepth 1 -type d | wc -l | tr -d ' ')
ACTUAL=$(grep -c "^export const " "$INDEX" || true)
if [ "$ACTUAL" -ne "$EXPECTED" ]; then
echo "Expected $EXPECTED client(s) in $INDEX, found $ACTUAL."
Expand Down Expand Up @@ -335,6 +338,10 @@ jobs:
run: npm run test:happy-path -w scripts/harness
env:
HARNESS_NETWORK: local
- name: Read the share price through SEP-40 on the local network
run: npm run test:sep40 -w scripts/harness
env:
HARNESS_NETWORK: local
- name: Run the vault guards on the local network
run: npm run test:guards -w scripts/harness
env:
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ playwright-report

scripts/harness/deployed.*.json
scripts/harness/runs

# Raw security tool output, kept as the tool wrote it
docs/evidence/scout
6 changes: 5 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ contracts. The addresses emitted by the deploy script are authoritative.

- **Crate names.** Shared crates in `crates/` start with `strata-`
(`strata-timelock`, `strata-storage`, `strata-bindings`), so a path such as
`strata_timelock::DAY_DURATION` reads as the kit's own code.
`strata_timelock::DAY_DURATION` reads as the kit's own code. `crates/sep40`
keeps the standard's name, without the `strata-` prefix, because it holds a
Stellar standard and no kit code.
- **Addresses in entrypoints.** In an entrypoint the kit defines, `caller` is
the account that must sign the call, and `holder` is the account whose
position, request or balance the call is about. When one account is both, the
Expand Down Expand Up @@ -175,6 +177,8 @@ contracts. The addresses emitted by the deploy script are authoritative.
and with no issue numbers or decision ids.
- **Exact pins.** Every crates.io dependency, dev-dependencies included, is
pinned with `=` to the version in `Cargo.lock`.
- **Examples.** `examples/` holds contracts that show a third party using the
kit; an example depends on no kit crate, only on standards such as `sep40`.

## Conventions

Expand Down
29 changes: 29 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
members = ["crates/*", "contracts/*"]
members = ["crates/*", "contracts/*", "examples/*"]

[workspace.package]
edition = "2021"
Expand Down
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ than its pending deposits, and once a wind-down is proposed.
ledger time, events and calls between contracts.
- [Threat model](./docs/THREAT_MODEL.md) — what can go wrong with the oracle,
the roles and the redemption paths, what stops it, what is left, and the
test for each control.
test for each control, with each threat placed under STRIDE.
- [STRIDE threat model](./docs/STRIDE-threat-model.md) — the threat model in
the format of Stellar's STRIDE template: a data flow diagram, numbered flows,
issues for each category and their remediations.
- [Security scan](./docs/SECURITY_SCAN.md) — what the self-service security
tools found in the contracts, how each finding was triaged, and the plan for
what stays open.
- [Monitoring plan](./docs/MONITORING_PLAN.md) — what an operator watches on
chain, where each signal comes from, and what to do when it fires.
- [Grant differences](./docs/GRANT_DIFFERENCES.md) — where the built kit
Expand All @@ -57,6 +63,7 @@ deploy from `environments.toml` → `[staging.contracts]`, which is the record.
| `share_token` | `CDOZT5VNIKSLQSFELF4PHVZRZA3GCJYJEHVDZTUB7O2QMBHBKKOYORQI` |
| `identity_verifier` | `CCGHNGPI66WGVSLLALQVCIRIOZKX73QW23UDZLZ3LMXLGEG7SLVUOULD` |
| `compliance` | `CCQI5NFRWBOO77LYSFY54D6PSU4TVWD5A3CFX2A5AWLEURVR35XISMKG` |
| `sep40_feed` | `CCDNFOV7GFBAZQLXLFBBX6H3T66NYAZG7Z6AWBEHSKLYFNJWRZTPYD2N` |
| `asset` | `CCOHKZLQ5EAD2A3RLHYHH7W4K2TNLNELXUVLWZIZALH45WXHH5H3QV7E` |
<!-- deployed-addresses:end -->

Expand Down Expand Up @@ -106,6 +113,28 @@ refused with `ClaimNotCovered`. It fails at simulation and leaves no
transaction, so the evidence of the short reserve is the pricing transaction
before it and the `fund` that clears it.

## SEP-40 price feed

The feed answers a vault's share price through SEP-40, the Stellar price-feed
interface, so a third-party contract can read it without depending on any kit
crate; the design document explains how it is built
([Valuation and accounting](./docs/strata-product-and-architecture.md#85-valuation-and-accounting)).
The harness repeats the scenario with the team's keys: it deploys a new
consumer and, when the NAV is stale, first attests a fresh one on the oracle:

```sh
HARNESS_NETWORK=testnet npm run test:sep40 -w scripts/harness
```

| Step | Contract | Transaction |
| --- | --- | --- |
| Deploy the consumer | `sep40_consumer` `CDKCYZ6IHE2I6KAGATCQPTOYX7GUTTCYRLK26HOQ2JVHEHGXNVA27DOJ` | [`5142b57e…4505`](https://stellar.expert/explorer/testnet/tx/5142b57e6f09a07dcf7d07b09aa41818c85e9b8460165067dddc0071057a4505) |
| Attest a fresh NAV | `nav_oracle` | [`3478b5b3…2bf2`](https://stellar.expert/explorer/testnet/tx/3478b5b3a2abf4b7435832e13aca2cc2f40c0aa2228f2a4e8cf5218ecf752bf2) |
| Call `record_price` against the feed | `sep40_consumer` | [`eb0fd738…fba7`](https://stellar.expert/explorer/testnet/tx/eb0fd738e9ffa10f736946c7fb8c51f18a7595ab941214aa9f3c8a9c4beffba7) |

The call recorded a price of 1.00100000000000 (100100000000000 at 14
decimals) on 2026-11-11. The mainnet run is tracked in #433.

## Vault figures

The [live dApp](https://strata-vault-kit-app.vercel.app) shows Withdrawable and
Expand Down
56 changes: 30 additions & 26 deletions contracts/async-vault/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ use stellar_contract_utils::pausable::{self as pausable, Pausable};
use stellar_contract_utils::upgradeable;
use stellar_macros::{only_admin, only_role, when_not_paused};
use stellar_tokens::fungible::FungibleTokenClient;
use strata_bindings::VaultView;
use strata_timelock::{Clock, ClockSource, Refusal, TimelockHost, DAY_DURATION};

use keys::DataKey;
Expand Down Expand Up @@ -167,26 +168,6 @@ impl AsyncVault {
upgradeable::set_schema_version(e, 1);
}

/// The deposit asset's token contract.
pub fn asset(e: &Env) -> Address {
state::get_addr(e, &DataKey::Asset)
}

/// The share token.
pub fn share_token(e: &Env) -> Address {
state::get_addr(e, &DataKey::ShareToken)
}

/// The feed epochs are priced from.
pub fn oracle(e: &Env) -> Address {
state::get_addr(e, &DataKey::Oracle)
}

/// The admin: governance.
pub fn governance(e: &Env) -> Option<Address> {
access_control::get_admin(e)
}

/// The first holder of `manager`, which closes epochs.
pub fn manager(e: &Env) -> Option<Address> {
role_holder(e, &MANAGER_ROLE)
Expand Down Expand Up @@ -396,12 +377,6 @@ impl AsyncVault {
state::min_epoch_duration(e)
}

/// The wind-down once proposed: whether it is proposed or active, the time
/// in seconds it may start, and the rounds finalised.
pub fn wind_down(e: &Env) -> Option<WindDownInfo> {
wind_down::info(e)
}

/// Announces a wind-down, which anyone can start once the delay has run.
/// New deposits stop at once; exits go on.
///
Expand Down Expand Up @@ -1292,6 +1267,35 @@ impl Pausable for AsyncVault {
}
}

#[contractimpl(contracttrait)]
impl VaultView for AsyncVault {
/// The deposit asset's token contract.
fn asset(e: &Env) -> Address {
state::get_addr(e, &DataKey::Asset)
}

/// The share token.
fn share_token(e: &Env) -> Address {
state::get_addr(e, &DataKey::ShareToken)
}

/// The feed epochs are priced from.
fn oracle(e: &Env) -> Address {
state::get_addr(e, &DataKey::Oracle)
}

/// The wind-down once proposed: whether it is proposed or active, the time
/// in seconds it may start, and the rounds finalised.
fn wind_down(e: &Env) -> Option<WindDownInfo> {
wind_down::info(e)
}

/// The admin: governance.
fn governance(e: &Env) -> Option<Address> {
access_control::get_admin(e)
}
}

#[contractimpl(contracttrait)]
impl ClockSource for AsyncVault {
/// The clock the kit's timelocks run on: the upgrade delay and the notice
Expand Down
14 changes: 14 additions & 0 deletions contracts/async-vault/src/test/constructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,20 @@ fn compliance_may_not_also_be_the_treasury() {
register_with(&e, roles);
}

fn implements_the_feeds_view<T: strata_bindings::VaultView>() {}

#[test]
fn the_vault_answers_the_view_the_feed_reads() {
implements_the_feeds_view::<AsyncVault>();
let f = setup();
let view = strata_bindings::VaultViewClient::new(&f.e, &f.vault.address);
assert_eq!(view.asset(), f.asset);
assert_eq!(view.share_token(), f.share.address);
assert_eq!(view.oracle(), f.oracle.address);
assert_eq!(view.wind_down(), None);
assert_eq!(view.governance(), Some(f.admin.clone()));
}

#[test]
fn the_guardian_may_be_governance() {
let e = Env::default();
Expand Down
19 changes: 2 additions & 17 deletions contracts/async-vault/src/wind_down.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ use soroban_sdk::{contracttype, panic_with_error, token::TokenClient, Address, E
use stellar_contract_utils::math::i128_fixed_point::checked_mul_div_floor;
use stellar_tokens::{fungible::FungibleTokenClient, rwa::RWATokenClient};

pub use strata_bindings::{WindDownInfo, WindDownStatus};

use crate::error::VaultError;
use crate::event::{
WindDownActivated, WindDownClaimed, WindDownDelaySet, WindDownProposalCancelled,
Expand All @@ -25,23 +27,6 @@ pub const MIN_WIND_DOWN_DELAY: u64 = 7 * strata_timelock::DAY_DURATION;
#[cfg(feature = "short_wind_down")]
pub const MIN_WIND_DOWN_DELAY: u64 = 0;

#[contracttype]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum WindDownStatus {
Proposed,
Active,
}

#[contracttype]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct WindDownInfo {
pub status: WindDownStatus,
/// Ledger time the proposal may be activated.
pub active_at: u64,
/// Rounds finalised so far. Zero means no snapshot has been taken.
pub round: u32,
}

#[contracttype]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct WindDownPosition {
Expand Down
29 changes: 29 additions & 0 deletions contracts/sep40-feed/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[package]
name = "sep40-feed"
version = "0.1.0"
edition.workspace = true
license.workspace = true
publish = false

[lib]
crate-type = ["lib", "cdylib"]
doctest = false

[dependencies]
soroban-sdk = { workspace = true }
sep40 = { path = "../../crates/sep40" }
strata-bindings = { path = "../../crates/strata-bindings" }
strata-timelock = { path = "../../crates/strata-timelock" }
strata-storage = { path = "../../crates/strata-storage" }
stellar-contract-utils = { workspace = true }

[dev-dependencies]
soroban-sdk = { workspace = true, features = ["testutils"] }
async-vault = { path = "../async-vault" }
nav-oracle = { path = "../nav-oracle" }

[features]
# Builds a stand-in for a later feed version, used only by the upgrade test.
upgrade_probe = []
# Runs the test that upgrades the built feed to its probe build. Build both first.
upgrade_wasm = []
Loading
Loading