The core smart contract system for the ShieldYield vault. Built with Foundry.
ShieldVault.sol: The main interface for users. Handles deposits, withdrawals, and proportional distribution to protocol adapters.RiskRegistry.sol: Stores risk scores and threat levels for different protocols. Updated by the AI Risk Engine (CRE).ShieldBridge.sol: Integrates with Chainlink CCIP to evacuate funds to a "Safe Haven" on a destination chain (e.g., Base).WorkflowLogger.sol: Emits detailed events for off-chain monitoring and indexing.
forge buildforge test
forge test -vv # Verbose- Start a local node:
anvil
- Deploy the contracts:
forge script script/Deploy.s.sol --rpc-url http://localhost:8545 --broadcast
- Access Control: Critical functions (emergency withdrawals, bridging) are restricted to the
onlyCREmodifier or the contract owner. - SafeERC20: Used for all token interactions to prevent silent failures.
- ReentrancyGuard: Applied to all user-facing state-changing functions.
🛡️ Shielding your yield, one block at a time.