In-depth lesson · Smart contracts
Root causes
Every point the Smart contracts reports back under this heading, best-backed first, each with the reports it is seen in.
-
State is updated after an external call, or a function with a callback lacks a reentrancy guard.
Seen in 18 reports
-
State is updated after an external call, or the reentrancy guard can be bypassed, in withdraw, claim, swap and mint paths.
Seen in 11 reports
-
Return values from transfer and transferFrom are ignored, so failed transfers are treated as successful.
Seen in 6 reports
-
The price source can be moved within a single transaction or returns stale data.
Seen in 6 reports
-
Functions that swap, mint, redeem or provide liquidity do not enforce a minimum output or maximum input.
Seen in 5 reports
-
Strategy allocation functions lack slippage control.
Seen in 5 reports
-
Only a narrow subset of ERC20 tokens is supported, so unusual tokens break accounting or lock funds.
Seen in 2 reports
-
Price oracles that time out return a huge but valid high price instead of reverting.
-
Reentrancy in service creation lets the owner steal protocol tokens.
Seen in 2 reports
-
The code calls ERC20 transfer or approve directly and does not check the returned boolean or handle tokens that return nothing.
-
Slippage bounds are computed with division before multiplication or from manipulable pool state, making them inaccurate.
-
Initialise functions are callable by anyone or lack protection against being front-run.
Seen in 1 report
-
The contract assumes the received amount equals the sent amount, breaking with fee-on-transfer or variable-balance tokens.
Seen in 1 report
-
Incorrect slippage values allow swap manipulation.
Seen in 1 report
-
A universal signature for produce allows front-running and collection hijack.
Seen in 1 report
-
Oracle accumulators are not updated in shift and sync functions, allowing price manipulation.
Seen in 1 report
-
A return variable shadows a storage variable, so storage updates are skipped.
Seen in 1 report
-
The get-year function parses timestamps incorrectly.
Seen in 1 report
-
Burn-from does not reduce total supply.
Seen in 1 report
-
The OKX helper is incompatible with the Uniswap V3 swap-to-with-permit selector.
Seen in 1 report
-
The total supply function overstates circulating supply.
Seen in 1 report
-
Distribute promoter payments is open to reentrancy.
-
Return values of external calls in Moonwell strategies are not checked.
Seen in 1 report
-
The is-valid-signature implementation on the strategy is wrong.
Seen in 1 report
-
Partial signatures on session calls can be replayed or front-run.
Seen in 1 report
-
Cross-contract reentrancy in liquidation converts phantom shares into real shares.
-
The recover-ERC20 function has no reentrancy guard.
Seen in 1 report
-
Reentrancy in the leave function halts bottom-up checkpoints.
Seen in 1 report
-
Cross-service reentrancy in the staking withdraw causes insolvency.
Seen in 1 report
-
The Uniswap swap has no slippage protection.
Seen in 1 report
-
The contract uses a Solidity version with known issues.
Seen in 1 report