Environment Configuration
Relevant source files
The following files were used as context for generating this wiki page:
The environment configuration for Canon Guard establishes the multi-chain development, testing, and deployment framework necessary for a high-security multisig solution. It integrates Ethereum and Optimism network parameters, Solidity compiler settings, and specialized testing environments including fuzzing and symbolic execution.
The configuration ensures that all components, such as the SafeEntrypoint and various Actions Builders, operate under consistent security assumptions, including defined transaction execution delays and expiry windows.
Sources: README.md:1-10, CLAUDE.md:7-15
Core Development Environment
The project utilizes Foundry as its primary development framework, supplemented by Node.js for task management and Rust for specific linting tools. The environment is partitioned into different profiles to support development speed versus deployment optimization.
Tooling Requirements
| Tool | Purpose | Installation/Source |
|---|---|---|
| Foundry | Smart contract development and testing | foundry-rs/foundry |
| Node.js/Yarn | Dependency management and scripts | yarn install |
| Rust/Lintspec | Custom Solidity linting | cargo install lintspec |
| Medusa | Invariant fuzz testing | crytic/medusa |
| Halmos | Symbolic execution | a16z/halmos |
Sources: README.md:13-17, package.json:44-53
Foundry Profile Configuration
The foundry.toml file defines specific profiles that adjust how the EVM bytecode is generated and tested.
[profile.default]
solc_version = '0.8.30'
optimizer_runs = 10_000
evm_version = 'prague'
[profile.optimized]
via_ir = true
[profile.test]
via_ir = true
Sources: foundry.toml:13-24
Network and Deployment Configuration
Canon Guard is configured for deployment on Ethereum and Optimism. Sensitive information and network-specific endpoints are managed via environment variables defined in a .env file.
RPC and API Mapping
The project maps network aliases to environment variables to facilitate seamless cross-chain scripts.
| Network | RPC Endpoint Variable | Etherscan API Key |
|---|---|---|
| Ethereum | ${ETHEREUM_RPC} | ${ETHERSCAN_API_KEY} |
| Optimism | ${OPTIMISM_RPC} | ${ETHERSCAN_API_KEY} |
Sources: foundry.toml:35-41
Deployment Workflow
Deployments utilize Foundry's encrypted keystore for security, requiring the import of deployer accounts before executing deployment scripts.
The diagram shows the sequence of environment preparation leading to contract deployment and the generation of broadcast logs.
Sources: README.md:58-85, package.json:15-18
Testing and Invariant Configuration
The environment provides distinct configurations for different testing methodologies, ensuring high coverage and security verification.
Fuzzing with Medusa
Invariant testing is configured through medusa.json, which defines the execution environment for the fuzzer, including gas limits and sender addresses.
- Workers: 10
- Target Contracts:
FuzzTest - Sender Addresses:
0x10000,0x20000,0x30000 - Block Delay Max: 604,800 seconds
Sources: medusa.json:3-23
Security Constraints and Delays
The environment enforces specific timing constraints for transaction execution to prevent state inconsistencies and overflows.
| Parameter | Constraint / Description |
|---|---|
SHORT_TX_EXECUTION_DELAY | Used for pre-approved transactions |
LONG_TX_EXECUTION_DELAY | Default delay for standard queued transactions |
TX_EXPIRY_DELAY | Maximum time a transaction remains valid (must be < 10 years) |
MAX_APPROVAL_DURATION | Limit for how long an approval expiry can be set |
Sources: test/invariants/PROPERTIES.md:21-48
Dependency Management and Paths
The project uses a flat remapping structure to manage local source files and external libraries like Safe contracts and Solady.
The diagram illustrates how the project resolves internal and external Solidity imports.
Sources: remappings.txt:1-8
Summary
The Canon Guard environment configuration is designed for high-assurance DeFi operations. By integrating strict Solidity compiler settings (0.8.30, prague EVM), comprehensive testing suites (unit, integration, fuzzing, and symbolic), and structured deployment pipelines for Ethereum and Optimism, the system ensures that transaction guards and action hubs function predictably under defined time-locks and security invariants.