# Security model and audit requirements

## Security properties intended by the source

1. **No on-demand issuance.** Initialization accepts only the standard SPL
   Token program, exactly nine decimals, exactly 50,000,000 PVTY supply, and
   permanently revoked mint and freeze authorities. No mint CPI exists.
2. **Bound inventory.** A sale cap is immutable and cannot exceed 2,500,000
   PVTY. Activation requires at least that amount in the PDA vault. Excess
   direct deposits never raise the amount that can be sold.
3. **Atomic exchange.** Buyer SOL and vault PVTY move in one instruction and one
   transaction. Solana rollback semantics prevent a successful one-sided trade.
4. **Immutable economics.** Treasury, mint, cap, wallet cap, start/end and the
   activation rate have no update instruction.
5. **Checked arithmetic.** Quote multiplication uses `u128`; all downcasts and
   cumulative `u64` additions are checked. Division has a fixed, non-zero
   denominator and rounds down to one PVTY base unit.
6. **Slippage bound.** Every buyer must sign a non-zero `min_tokens_out`.
7. **PDA isolation.** Configuration is unique per PVTY mint. Buyer state is
   unique per configuration and signing wallet. The vault authority is the
   configuration PDA.
8. **No early inventory withdrawal.** Remaining inventory is recoverable only
   at or after the committed end timestamp.

## Privileged powers

The immutable admin can fund and activate before launch, pause/unpause during
the window, and withdraw unsold PVTY after the end. The admin cannot mint,
change rate after activation, redirect buyer SOL, raise caps, extend the end, or
withdraw sale inventory early. Use a disclosed multisig/program-governance
authority for production rather than a single browser wallet.

## Threats this contract does not solve

- Legal eligibility, geographic restrictions, KYC/AML, sanctions screening or
  consumer disclosures.
- Multiple wallets controlled by one buyer.
- Compromise of the admin, treasury, build host, RPC, front end, DNS or package
  supply chain.
- SOL/USD volatility or a misleading USD equivalent in the interface.
- Liquidity, secondary-market execution, MEV outside this fixed-rate purchase,
  or economic suitability.
- A malicious token transfer into the PDA vault. Donations do not expand the
  recorded sale cap but remain locked until end.
- Bugs in Solana, Anchor, SPL Token, wallet software or dependencies.

## Required independent review

An auditor should at minimum verify:

- every account substitution and signer/owner/mint constraint;
- PDA seed uniqueness and signer derivation;
- `init_if_needed` state initialization and reinitialization resistance;
- transaction rollback assumptions across the system and SPL Token CPIs;
- all timestamp boundaries and emergency-pause paths;
- quote rounding, overflow, dust and cap edge cases;
- direct vault transfers before and after activation;
- malicious/non-canonical token accounts and mint authority state;
- upgrade-authority custody, reproducible/verifiable build, deploy buffer and
  closing of obsolete buffers;
- client construction of `min_tokens_out`, account addresses and finality
  confirmation;
- fuzz/property tests and a full localnet/devnet end-to-end run.

Do not label this program “audited” until an independent named auditor has
reviewed the exact commit and program binary, findings have been remediated, and
the final report is published with its scope and hash.
