Build Configuration
Relevant source files
The following files were used as context for generating this wiki page:
The build configuration for Canon Guard is centered around a multi-layered environment that integrates Solidity development tools (Foundry), package management (Yarn/NPM), and advanced testing frameworks (Medusa, Halmos). It is designed to support both rapid development cycles and high-assurance production deployments through optimized Intermediate Representation (IR) compilation and extensive fuzzing capabilities.
Sources: README.md:16-32, CLAUDE.md:38-46
Foundry Configuration
Foundry serves as the primary engine for compilation and testing. The project utilizes specific profiles to manage different execution environments, such as standard development, optimized production builds, and documentation generation.
Compiler Settings
The project targets Solidity version 0.8.30 with the Prague EVM version. The optimizer is configured for 10,000 runs to balance contract size and gas efficiency.
| Parameter | Value | Description |
|---|---|---|
solc_version | 0.8.30 | Target Solidity compiler version |
evm_version | prague | Target Ethereum Virtual Machine version |
optimizer_runs | 10,000 | Number of optimization passes |
via_ir | true | Enabled for optimized and test profiles |
Sources: foundry.toml:13-26, CLAUDE.md:76-80
Profile Management
The configuration defines three primary profiles:
- Default: Standard settings for local development.
- Optimized: Enables
via_irand outputs to a dedicatedout-via-irdirectory for deployment readiness. - Test: Enables
via_irto ensure test execution matches optimized contract behavior.
Sources: foundry.toml:18-29, package.json:16
Dependency Management and Path Mapping
The project manages dependencies through package.json and simplifies Solidity imports using a remappings.txt file. This allows for cleaner source code by mapping complex node module paths to simple aliases.
Path Remappings
forge-std/=node_modules/forge-std/src
halmos-cheatcodes=node_modules/halmos-cheatcodes
contracts/=src/contracts
interfaces/=src/interfaces
@safe-smart-account/=node_modules/@safe-global/safe-contracts/contracts
solady/=node_modules/solady/src
Sources: remappings.txt:1-8
External Dependencies
Key libraries include the Safe smart account ecosystem and Solady utilities.
@safe-global/safe-contracts: Provides the base multisig logic.solady: Gas-optimized Solidity snippets.forge-std: The standard library for Foundry testing.
Sources: package.json:44-51
Build and Execution Workflow
The project uses Yarn scripts to orchestrate the build process. The following diagram illustrates the relationship between the developer commands and the underlying tools.
The workflow prioritizes fast feedback for unit testing while providing separate paths for deep fuzzing and symbolic execution.
Sources: package.json:15-32, README.md:16-56
Advanced Testing Configuration
Beyond standard unit tests, the project is configured for invariant testing and symbolic execution.
Medusa Fuzzing
Medusa is configured via medusa.json to perform property-based testing. It is set up with 10 workers and specific gas limits to ensure comprehensive coverage.
- Target:
test/invariants/fuzz/FuzzTest.t.sol - Gas Limit: 125,000,000 (Block) / 12,500,000 (Transaction)
- Corpus: Stores findings in
test/invariants/fuzz/corpus
Sources: medusa.json:2-10, foundry.toml:34-39
Symbolic Execution
Halmos is integrated to provide formal verification of contract properties, triggered via yarn test:symbolic.
Sources: package.json:28, CLAUDE.md:60
Deployment Environment
Deployment is handled via Foundry scripts that leverage environment variables for network-specific configurations.
Supported Networks
The project includes predefined RPC endpoints and Etherscan API configurations for:
- Ethereum: Mainnet deployment and verification.
- Optimism: L2 deployment and verification.
Sources: foundry.toml:44-50, package.json:18-21, README.md:65-90
Summary
The Canon Guard build configuration provides a robust environment that balances development speed with rigorous security verification. By utilizing Foundry profiles, IR-based optimization, and multiple testing paradigms (Unit, Fuzzing, Symbolic), the system ensures that the multisig solution is both efficient and verifiably secure across different EVM-compatible chains.