ChainPe Docs
Security

Audit Checklist

Audit Checklist

Pre-audit readiness status and known risk areas. See contracts/SECURITY.md in the repository for the full security notes and Slither triage.

Access control inventory

ContractPrivileged roleFunctions
ChainPeRegistryOwner (Ownable2Step)pause, unpause, setRegistrationFee, setUpdateFee, setFeeRecipient, setFeeToken, setIdentityRegistry, ownerWithdraw
PolicyVaultContract owner (deployer)pause, unpause
PolicyVaultVault owner (any address)deposit, withdraw, setPolicy, setAllowlist, revokeSession
PolicyVaultSession key holdersigns Spend (no on-chain function, just signing)
PolicyVaultAny relayerspend (submits signed authorization)
PolicyVaultAny addresscleanupDailySpent (gas reclaim, no funds moved)
ChainPeICMReceiverOwnersetTrustedSender
ChainPeICMReceiverTeleporter messenger onlyreceiveTeleporterMessage
ERC-8004 registriesOwnerUpgrade authorization (_authorizeUpgrade)

Known risk areas

Critical

  • None identified post-audit. See contracts/SECURITY.md for the full critical findings resolution.

High

  • Facilitator gas key compromise: an attacker who obtains the facilitator key cannot steal payer USDC (EIP-3009 is already signed), but can prevent settlement by spending the gas balance. Mitigation: keep the gas key balance minimal (top up in small amounts).
  • Registry fee token change race: a setFeeToken call while users have pending transactions can cause reverts. Mitigation: pause before changing fee token.

Medium

  • ERC-8004 Sybil reputation: a provider can create multiple buyer wallets to inflate reputation. Gas cost and the single-address-one-identity enforcement partially mitigate this.
  • Indexer trustfulness: as noted in the trust model, the indexer is an off-chain cache. Critical operations should read on-chain.

Low

  • PolicyVault cleanupDailySpent can be called by anyone; it only deletes past day slots. No funds can be moved. Primarily a gas optimization.
  • String field validation in ChainPeRegistry: field lengths are checked (name ≤ 64, description ≤ 1024, etc.), but Unicode vs. byte counting: bytes(input.name).length counts bytes, not characters. Providers with multi-byte UTF-8 names may hit the limit unexpectedly.

Static analysis

Slither and Aderyn (where applicable) are run as part of the CI pipeline. The output is recorded in contracts/SECURITY.md. The contracts had zero error-level findings at the time of audit submission.

Fuzzing

:::note Property-based fuzzing (e.g. Echidna) is not yet set up. This is a planned improvement before mainnet launch. :::

Upgrade safety

For upgradeable contracts:

  • Storage layouts are documented in each contract and must not be reordered between upgrades
  • _authorizeUpgrade is restricted to the owner (multisig on mainnet)
  • New implementations must be independently reviewed before deployment
  • A timelock on upgrades is recommended for mainnet (not yet implemented)

On this page