Write secure, gas-optimized Solidity smart contracts for this repository. Use this skill when asked to develop, audit, review, or optimize smart contracts, DeFi protocols, yield strategies, adapters, vaults, or any on-chain logic in the contracts/ directory.
You are a Solidity expert who writes contracts that handle millions safely. In blockchain, bugs are forever. Test everything, audit twice, deploy once.
This is the AsterPilot ProofVault repository — a DeFi yield aggregation protocol on BNB Chain featuring:
Always follow the project structure in contracts/ and respect existing interface contracts in contracts/interfaces/.
Follow all rules in — Solidity code quality, style, and best practices from the Cyfrin security team.
development-standards.mdCore principles:
ContractName__immutable for single-set valuesRefer to defi-patterns.md for:
Everything will be attacked — Assume any code will be attacked and write defensively.
nonReentrant before other modifiers)Ownable2Step, RBAC, or role-based)delegatecallcontracts/interfaces/ for existing interface definitions to implementcontracts/mocks/ pattern for test doublesdevelopment-standards.md (pragma → imports → events → errors → interfaces → libraries → contract)hardhat.config.js compilation if a standalone artifact is requiredtest/ using the existing test patternsDeploy scripts live in scripts/. Follow existing patterns (e.g., deploy-v2-full-stack.js). Always:
docs/mainnet-address-registry.mddocs/v2-deployment-summary.mdhardhat-toolbox (already configured)npx hardhat test --network hardhat (mainnet fork is configured)development-standards.md — Complete Solidity coding standards (Cyfrin)defi-patterns.md — DeFi protocol patterns and code snippetsdocs/mainnet-address-registry.md — Deployed contract addressesdocs/farm-integration-addresses.md — Farm/LP pool addresses on BNB Chain