Scope: Only applicable to DeFi projects (DEX, lending, staking, LP, yield). Non-DeFi projects can ignore this skill.
| Whale manipulation | Daily transaction caps + per-tx amount limits + cooldown window | | MEV / sandwich attack | EOA-only checks (msg.sender == tx.origin), or use commit-reveal pattern | | Arbitrage | Referral binding + liquidity distribution + fixed yield model + lock period |
| Reentrancy | ReentrancyGuard on all external-call functions (see solidity-security skill) | | Flash loan attack | Check block.number change between operations, or use TWAP pricing | | Price manipulation | Chainlink oracle or TWAP — never rely on spot AMM reserves for pricing |
[INVOCA AUTOMATICA] DEVE essere invocato PRIMA di implementare i contratti DeFi (DEX, prestito, staking, LP, token). Copre l'anti-balena, l'anti-MEV, la protezione del prestito flash, le liste di controllo del lancio e la risposta alle emergenze. Trigger: qualsiasi implementazione o revisione della sicurezza dei contratti relativi alla DeFi. Fonte: 0xlayerghost/solidity-agent-kit.