Skip to main content
Important: We do not provide financial advice or custody funds. All transactions occur on third-party platforms.

Smart Contract Risk

In simple terms

Smart contract risk is the danger that a mistake in computer code causes you to lose your money. Think of it like a vending machine that's programmed incorrectly—it might give away free snacks or eat your money instead of dispensing what you paid for.

Definition

The risk that a bug or vulnerability in code leads to loss of funds.

In depth

Smart contract risk refers to the possibility that logical flaws, reentrancy vulnerabilities, integer overflow errors, or other code defects in blockchain-based smart contracts result in unintended fund transfers or permanent loss of assets. Since smart contracts are immutable once deployed on-chain and execute automatically based on predefined conditions, any vulnerability in the contract code cannot be patched without redeploying to a new address. This risk is compounded by the difficulty of auditing complex contract interactions and the inability to recover funds if a critical bug is exploited before detection.

How does Smart Contract Risk work?

A smart contract is a program deployed to a blockchain that holds and moves funds according to its code, and on most chains that code cannot be edited once deployed. Depositing means transferring assets into the contract's control and relying on the logic to release them correctly. If the code contains a flaw — reentrancy, a missing permission check, a rounding error, or a price feed that can be manipulated — anyone who finds it can drain the balance, and the transaction is final. Audits and bug bounties reduce the odds but do not eliminate them; audited contracts have been exploited.

An example

Illustrative exploit: a lending protocol values collateral using the price from one decentralized exchange pool holding $2 million. An attacker borrows $50 million in a flash loan, buys heavily from that pool so the recorded price triples, deposits a small amount of the now-overvalued token, and borrows $8 million of stablecoins against it. The flash loan is repaid in the same transaction. The protocol keeps worthless collateral, and depositors absorb the $8 million shortfall.

Figures are illustrative only.

What beginners get wrong

  • An audit is a point-in-time review of specific code; upgrades or new contracts deployed afterwards are not covered by it.
  • Token approvals often grant unlimited spending rights that persist after use, so revoking old approvals matters as much as vetting new contracts.
  • Total value locked measures how much is at stake, not how safe the code is; large protocols have been drained.
  • Upgradeable contracts and admin keys mean the rules can change after a deposit, which is a separate risk from a coding bug.

Related terms

Part of

How do crypto scams work, and how do you avoid them? — the subject page for security and scams, with all 17 of its definitions in one place.

Educational only — not financial advice.