Contract deployment
Simnet
Simnet deployment is automatic. When you runnpm test from the project root, the Clarinet SDK reads deployments/default.simnet-plan.yaml and deploys heirloom-vault (along with its sBTC and USDCx token dependencies) into the in-memory simnet environment before any test runs.
No configuration or token faucet is required. The simnet is fully self-contained.
Testnet
The contract is currently deployed on Stacks testnet:| Property | Value |
|---|---|
| Deployer address | STZJWVYSKRYV1XBGS8BZ4F81E32RHBREQSE5WAJM |
| Current contract name | heirloom-vault-v10 |
| Full identifier | STZJWVYSKRYV1XBGS8BZ4F81E32RHBREQSE5WAJM.heirloom-vault-v10 |
deployments/default.testnet-plan.yaml, signs the deployment transaction with the deployer key from settings/Testnet.toml, and broadcasts it to testnet.
Contract versioning
Each time you deploy a modified contract, increment the version suffix in the contract name:Clarinet.toml— update the[contracts.heirloom-vault-vN]section name.deployments/default.testnet-plan.yaml— update the contract name in the deployment plan.
VITE_CONTRACT_NAME in heirloom-app/.env so the frontend points to the new contract. See Environment variables for details.
Mainnet
settings/Mainnet.toml contains a placeholder configuration for mainnet deployment. Before deploying to mainnet:
Update settings/Mainnet.toml
Open
settings/Mainnet.toml and replace the placeholder deployer mnemonic with your real mainnet wallet mnemonic. Set an appropriate fee rate for current network conditions.Create a mainnet deployment plan
Create
deployments/default.mainnet-plan.yaml based on the testnet plan, referencing the mainnet network and deployer.Update frontend environment variables
Set
VITE_NETWORK=mainnet and update VITE_CONTRACT_ADDRESS and VITE_CONTRACT_NAME in your production .env to point to the mainnet contract. See Environment variables.Frontend deployment
Building for production
From theheirloom-app/ directory:
npm run build outputs a static site to heirloom-app/dist/. The build process reads environment variables from heirloom-app/.env at build time — all VITE_* variables are inlined into the bundle.
Deploying to Vercel
Avercel.json configuration file is included in heirloom-app/. To deploy:
Set environment variables in Vercel
In the Vercel project dashboard, add all five
VITE_* environment variables under Settings → Environment Variables. Do not use a .env file in production — use the Vercel dashboard instead.Post-deployment checklist
After deploying a new contract version and rebuilding the frontend:- Confirm the new contract is visible on the Stacks Explorer.
- Verify the frontend connects to the correct contract by opening the dashboard and checking that vault reads return data.
- Update
VITE_CONTRACT_NAMEin any CI/CD environment variables to match the new version. - Communicate the new contract address to any users who interact with the contract directly.
