Contracts reference
Eight Clarity contracts, all deployed under one principal on Stacks testnet:
ST1QN0P1MB429DHV28KT68F80621FHE4NE880CBZK
(explorer)
| Contract | Identifier | Explorer |
|---|---|---|
| Vault | ….vault | view |
| Black–Scholes | ….bs-math | view |
| Oracle adapter | ….oracle-adapter | view |
| bcSHARE token | ….bcshare-token | view |
| SIP-010 trait | ….sip-010-trait | view |
| Pyth mock | ….pyth-mock | view |
| Mock sBTC | ….sbtc-token | view |
| Mock USDC | ….usdc-token | view |
Each contract id is ST1QN0P1MB429DHV28KT68F80621FHE4NE880CBZK.<name>.
Dependency / deploy order
Contracts are published in dependency order (Clarity 3):
sip-010-trait— the fungible-token trait everything else implements/usesbs-math— pure pricing engine (no dependencies)pyth-mock— mock price feedoracle-adapter— readspyth-mockbcshare-token— the share tokensbtc-token,usdc-token— mock SIP-010 tokens (open mint = faucet)vault— depends on all of the above
Mock tokens
sbtc-token and usdc-token are SIP-010 mocks with an open mint so any
account can fund itself — this is what the web app's Faucet button and the
demo-user script use:
(mint (amount uint) (recipient principal)) ;; anyone -> any recipient
On mainnet the vault is re-pointed at the real sBTC contract (and a canonical
USDC) via vault.set-tokens(<sbtc>, <usdc>), which is owner-only and blocked
once shares exist.
Wiring (post-deploy)
After publishing, the vault is wired with these transactions:
bcshare-token.set-vault(<vault>)— authorize the vault to mint/burn sharesoracle-adapter.set-max-age(u691200)— relax staleness to 8 days for the demopyth-mock.set-price-now(<price>)— seed a live BTC pricevault.start-round(u1000, u55000000)— open round 1 at +10% OTM, IV 0.55
The exact txids are recorded in contracts/deployments/testnet-deployment.json
and summarized on the Deployment page.
Trait references
Functions that move tokens take a trait reference argument
((sbtc <sip010>) / (usdc <sip010>)) — you pass the token's contract
principal. The vault asserts the passed token equals its configured token
(ERR-WRONG-TOKEN u112), so a caller cannot substitute a rogue token.