Expand description
Security guard packs – safe-by-default exploit prevention.
Pre-built validation bundles for common exploit classes:
- Account role mismatches (signer/writable/owner)
- Post-mutation conservation (balance invariants)
- Duplicate account detection
- Instruction introspection guards (flash loan, re-entrancy)
Functions§
- check_
lamport_ conservation - Verify SOL conservation: total lamports before == total lamports after.
- check_
writable_ coherence - Validate that every writable account in the slice is also a signer OR is owned by our program.
- require_
all_ unique - Verify that all accounts in a slice have unique addresses.
- require_
authority - Validate an authority account: must be signer, owned by expected program.
- require_
owned_ writable - Validate a writable program-owned account.
- require_
payer - Validate a payer account: must be signer + writable.
- require_
unique_ signers - Verify that no duplicated account is used as a signer.
- require_
unique_ writable - Verify that no duplicated account is writable.
- snapshot_
lamports - Snapshot lamport values for conservation checking.