forge build- Compile all contractsforge test- Run all testsforge test --match-test testFunctionName- Run a single testforge test --match-path test/Kernel.t.sol- Run tests in a specific fileforge test -vv- Run tests with verbose outputFOUNDRY_PROFILE=optimized forge test- Run tests with optimized profile
- Indentation: 4 spaces
- Opening braces: same line as declaration
- Use named imports:
import {Contract} from "./path.sol"; - Line separators:
// --- Section Name ---
- Contracts: PascalCase (e.g.
Kernel) - Interfaces: Prefixed with "I" (e.g.
IValidator) - Functions: camelCase (e.g.
validateUserOp) - Private/internal: underscore prefix (e.g.
_executeUserOp) - Constants: ALL_CAPS_WITH_UNDERSCORES
- Use custom errors instead of require (e.g.
error InvalidValidator();) - Use if-revert pattern:
if (condition) { revert ErrorName(); }
- Use immutable variables when possible for gas optimization
- Follow ERC-4337 and ERC-7579 standards
- Use explicit storage slots with assembly for upgradeability