Skip to main content

Contracts reference

Eight Clarity contracts, all deployed under one principal on Stacks testnet:

ST1QN0P1MB429DHV28KT68F80621FHE4NE880CBZK (explorer)

ContractIdentifierExplorer
Vault…​.vaultview
Black–Scholes…​.bs-mathview
Oracle adapter…​.oracle-adapterview
bcSHARE token…​.bcshare-tokenview
SIP-010 trait…​.sip-010-traitview
Pyth mock…​.pyth-mockview
Mock sBTC…​.sbtc-tokenview
Mock USDC…​.usdc-tokenview

Each contract id is ST1QN0P1MB429DHV28KT68F80621FHE4NE880CBZK.<name>.

Dependency / deploy order

Contracts are published in dependency order (Clarity 3):

  1. sip-010-trait — the fungible-token trait everything else implements/uses
  2. bs-math — pure pricing engine (no dependencies)
  3. pyth-mock — mock price feed
  4. oracle-adapter — reads pyth-mock
  5. bcshare-token — the share token
  6. sbtc-token, usdc-token — mock SIP-010 tokens (open mint = faucet)
  7. 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 shares
  • oracle-adapter.set-max-age(u691200) — relax staleness to 8 days for the demo
  • pyth-mock.set-price-now(<price>) — seed a live BTC price
  • vault.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.