Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
hpmaxi
marked this pull request as ready for review
October 20, 2026 10:23
The kit spec and the design doc said a gain or a loss at the custodian never moves deposited capital. It does once exits pay it out: a priced redemption takes off what it pays, gain included. After leavers are paid a gain the figure can go negative, and the cap then admits more than its own amount; after a loss it stays above the vault's value, and the cap refuses deposits sooner. Two tests pin both directions.
3 tasks
- The NotAllowlisted doc and the compliance matrix say that a verifier that cannot answer counts as a failed check, and a test pins it. - The kit spec says this version is deployed fresh, not upgraded in place. - The design doc gives the epoch remainder rule in the pricing section, and says the share token's upgrades, role grants and admin hand-overs wait for the vault's timelock.
Also say the deposit cap is vault-wide, and list the testnet identity verifier's limits as limits of the stub.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #329
No contract said which choices it makes or what each one costs, so a reader had to rebuild the reasons from the code. Several docs also promised more than the code does: a proof reference on every report, an exit window from the timelock, "five authorities" in a comment that lists six, and one
managerrow for two different roles. Nothing said how to replace a compromised attester, what the supply and capital figures count, or that a refund worth less than one share is not reserved.Each contract and each shared crate now opens with a short design section, and the docs say only what the code does.
Changes
# Designsection: five to ten choices, each with its cost.managerroles.total_economic_supplyand deposited capital count (money in and out, not the vault's value), that the custodian repays throughfund, and that a refund below one share base unit is not reserved, and why.NotAllowlisteddoc, compliance matrix); the kit spec says this version is deployed fresh; the design doc gives the epoch remainder rule and the share token's timelocked upgrades, grants and hand-overs.fundcounts once; a gain paid out to leavers leaves room above the cap, while a loss at the custodian still counts toward it; a zero-share legal transfer passes and is published; an unbound compliance swap lands and stops every move.rolesholds.request_redeemis refused in a wind-down; a rule change gets the delay as notice, not a finished exit;feed_validincludes the band;environments.tomllists everyfinish_setupcheck.legal_transfer's doc says only the compliance rules' check is skipped, and the token's constructor doc says which moves are checked.TESTING.mdandAGENTS.mdname the doc-length test and theerror_enum!doctests.feed_bound_here_and_answeringandvalid_change.Deviations
Clock.exit_windowdoc (it called the notice "the longest an exit takes"),MIN_DELAY,MANAGER_ROLEandTREASURY_ROLEdocs, the matrix's "five authorities" list, thefundrows (anyone may fund), and "two further limits" that listed three.Clock.exit_window's doc is in the vault's spec, so the vault's Wasm grows by 36 bytes; its code section is unchanged.lib.rs, the crate root.Acceptance criteria
lib.rsopens with a# Designsection: five to ten choices, each with its costtotal_economic_supplyand deposited capital count, and that the custodian repays throughfundTest plan
Automated tests
SOROBAN_SDK_BUILD_SYSTEM_SUPPORTS_SPEC_SHAKING_V2=1 cargo test --locked: 716 passed, includingevery_contract_doc_fits_the_specand the eight new tests (a_module_failing_on_burn_blocks_wind_down_claims_and_cannot_be_removed,capital_funded_back_counts_once_toward_the_cap,a_plain_transfer_back_counts_twice_toward_the_cap,a_gain_paid_out_to_leavers_leaves_room_above_the_cap,a_loss_at_the_custodian_still_counts_toward_the_cap,a_verifier_that_cannot_answer_counts_as_a_failed_check,a_zero_share_legal_transfer_passes_and_is_published,an_unbound_compliance_swap_lands_and_stops_every_move). Each new test fails when the behaviour it pins is changed.cargo clippy --locked --all-targets -- -D warningsandcargo docwithRUSTDOCFLAGS="-D warnings"on the eight touched crates: clean.--features upgrade_wasm with_wasm): vault 5, oracle 2, passed.Manual verification
stellar contract buildat the base (527620d) and after the first two design-section commits (e34e5b9): the five Wasm files are byte-identical.ea0d661onlyasync_vault.wasmdiffers from the base. Its spec section carries the correctedClock.exit_windowdoc, its code section is identical, and its data section differs only in that entry's 8-byte spec marker.66b60fcthe token's spec section carries its two corrected docs (code unchanged), and the two guard renames reorder the vault's functions: the same 284 function bodies, in another order. The oracle, compliance and verifier are byte-identical to the base.527620d)66b60fc)async_vaultshare_tokennav_oraclecomplianceidentity_verifierBreaking changes
None. Signatures, types, events and error codes are unchanged. Docs in the vault's and the token's specs change, and the vault's functions are reordered, so both Wasm hashes change.
Checklist
Screenshots
None.