This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Safer Safe is a multisig solution that enhances security through fully on-chain Actions contracts and dynamic timelocks. The system is built on top of Safe smart contracts and provides a safer way to execute transactions with time delays and approval mechanisms.
- SafeEntrypoint: Main contract that allows execution of transactions on a Safe with time delays and approval mechanisms
- ActionHub: Abstract contract for managing action builders - contracts that define specific transaction patterns
- Actions Builders: Specific implementations for different transaction types (SimpleActions, CappedTokenTransfers, etc.)
- SafeManageable: Base contract providing Safe integration functionality
- EmergencyModeHook: Security mechanism to pause operations in emergency situations
- OnlyEntrypointGuard: Guard that ensures transactions go through the proper entrypoint
src/contracts/: Core contract implementationssrc/interfaces/: Interface definitionstest/unit/: Unit tests isolated from externalitiestest/integration/: Integration tests that run on blockchain forkstest/invariants/: Invariant tests using Medusa fuzzingscript/: Deployment scripts
yarn build- Fast build (development)yarn build:optimized- Optimized build via IR compilation
yarn test- Run all tests (unit + integration)yarn test:unit- Run only unit testsyarn test:unit:deep- Run unit tests with 5x more fuzzingyarn test:integration- Run only integration testsyarn test:fuzz- Run Medusa fuzzing campaign (requires Medusa installed)yarn test:symbolic- Run symbolic execution tests (requires Halmos installed)yarn coverage- Generate code coverage report
yarn lint:check- Check formatting and lintingyarn lint:fix- Fix formatting and linting issuesyarn lint:sol- Run Solhint on Solidity filesyarn lint:bulloak- Check .tree files in test/unit
yarn deploy:ethereum:entrypoint- Deploy entrypoint to Ethereumyarn deploy:ethereum:safer-safe- Deploy safer-safe to Ethereumyarn deploy:optimism:entrypoint- Deploy entrypoint to Optimismyarn deploy:optimism:safer-safe- Deploy safer-safe to Optimism
- Solidity version: 0.8.29
- EVM version: Prague
- Optimizer runs: 10,000
- Via IR enabled for test and optimized profiles
- Invariant testing timeout: 1200 seconds
- Fuzz runs: 1000
- Safe contracts:
@safe-global/safe-contracts - Solady utilities:
solady - Forge standard library:
forge-std
- Unit tests use
.treefiles with bulloak for test specification - Integration tests fork mainnet/optimism networks
- Invariant testing uses Medusa fuzzer with corpus storage
- Symbolic execution available via Halmos
- CREATE3 for deterministic address deployment
- Time-delayed execution with configurable delays
- Approval-based action builder management
- Emergency mode for pausing operations
- Guard-based transaction validation
- Install Foundry
- Install Rust dependencies:
cargo install lintspec - Install Node dependencies:
yarn install - Copy
.env.exampleto.envand configure variables - For deployment: Import private keys to Foundry keystore using
cast wallet import