Crypto glossary
Smart contract risk
Smart contract risk is the possibility of losing funds because the code of a protocol has a bug, can be manipulated or is changed by whoever controls it.
When users deposit into a DeFi protocol, the code itself holds the money. A logic error, a faulty price calculation, a reentrancy flaw or an unchecked input can let an attacker withdraw more than they should. Beyond pure bugs, the risk includes upgradeable contracts whose admins can change the rules, dependencies on external oracles or other protocols, and the compiler or libraries the code relies on.
Smart contract exploits account for a large share of the value lost in DeFi over the years, which is why risk teams, insurers and lending desks evaluate this factor before integrating a protocol. Common mitigations include independent audits, formal verification, bug bounties, gradual deposit caps, timelocks on upgrades and simply time: code that has held large balances for years without incident has survived more real-world testing.
No audit makes code risk-free, and many exploited contracts had been audited, sometimes more than once. Forks of proven code can still break when parameters or integrations change. Users can limit exposure by spreading funds, avoiding new contracts with large rewards and checking who can upgrade or pause the system.
Example
A newly launched yield vault passes one audit and attracts deposits quickly; three weeks later an attacker uses a rounding error in its share calculation to withdraw more than he deposited.
Related terms
Latest articles on Smart contract risk
- The Most Common Smart Contract Vulnerabilities and How Developers Can Prevent Them
- Ethereum Devs Delay Glamsterdam Hoodi Fork Over Smart Contract Risks
- TRX Rebounds as TRON Implements New Smart Contract Upgrade
- Ethereum Developers Postpone Glamsterdam Hoodi Testnet Deployment Following Smart Contract Warnings
- Aptos Labs Announces MonoMove Running Smart Contracts 55x Faster With Engine-Level Security
