bcSHARE — the vault-gated share token
bcshare-token.clar is a SIP-010 fungible token whose balances are the
vault's share ledger. A depositor's bcSHARE balance is their claim on the pool's
collateral and premium.
Why it is gated
Because share balances drive premium accounting, every balance change must go through the vault so the premium-per-share index is harvested first. Therefore:
mint,burn, and the vault-internal transfer are authorized only for the vault contract (wired at deploy viabcshare-token.set-vault).- A direct
bcshare-token.transferfrom a wallet reverts withu401(not authorized).
Moving shares between wallets
Use the vault's wrapper, which keeps premium accounting in sync on both sides:
(transfer-shares (amount uint) (recipient principal))
The vault harvests and checkpoints both sender and recipient (the
recipient starts with a clean premium checkpoint — verified in tests), then
performs the underlying token transfer. Queued withdrawal intents that exceed
the remaining balance are trimmed.
Wiring
At deploy time, bcshare-token.set-vault(<vault principal>) points the token at
the vault. This is one of the wiring transactions recorded in the
deployment.