In-depth lesson · Business logic
Root causes
Every point the Business logic reports back under this heading, best-backed first, each with the reports it is seen in.
-
An off-by-one error fetched reserved tokens outstanding for tier i instead of i+1, so redemption weights were wrong.
-
An off-by-one error in the check comparing the generation ID to the maximum uses a strict inequality instead of a non-strict one.
Seen in 1 report
-
An off-by-one makes the query start block equal the end block, returning zero while the last-earmark block is still updated.
-
An off-by-one nonce check uses one less than the specification limit for create transactions.
Seen in 1 report
-
An off-by-one range pattern excludes the minimal opcode for a lock time of 16.
Seen in 1 report
-
An oracle version was requested only for non-empty orders, but settlement still used the version at the order timestamp even when invalid.
-
An outdated OpenZeppelin version contained a known vulnerability in the quorum fraction contract.
Seen in 1 report
-
An unauthenticated faucet endpoint keys its anti-abuse controls on the caller-supplied address and waits on receipts with no timeout.
Seen in 1 report
-
An unchecked arithmetic block is used for a calculation involving totalAssets, which can be arbitrarily large when any ERC20 token is supported.
Seen in 1 report
-
An unconfirmed email was permanently disabled when the associated account was disabled, without verifying ownership.
Seen in 1 report
-
An unnecessary division by 1e18 is applied to a value already normalised to 18 decimals.
Seen in 1 report
-
An upgrade initialised the trusted root to the zero hash, and unset mapping entries also read as zero, so any unseen message hash was accepted.
Seen in 1 report
-
Annualised rate is multiplied by elapsed seconds without dividing by the number of seconds in a year.
Seen in 1 report
-
Any caller could add a contributor's pending voting power to a card owned by that contributor.
-
Any host with a zero registry length was treated as an intranet host, which also matched public IP literals.
Seen in 1 report
-
Any positive difference between the contract's token balance and its recorded balance is treated as a fresh reward, and this is reachable from an unprivileged claim function.
-
Any user can send a note from the trusted no-reply address and forwarded copies keep their original authentication.
-
Applications record only amounts, not which token funded them, and rely on a mutable global address.
Seen in 1 report
-
Approval removal logic does not trigger on force-pushed commits to an existing merge request.
Seen in 1 report
-
Approvals are not invalidated when the source branch is updated by merging another branch into it.
Seen in 1 report
-
Arguments to the internal swap function were in the wrong order, so the ownership check compared against the wrong token.
Seen in 1 report
-
An assertion checks the incoming parameter instead of the stored state variable, so any non-zero update reverts.
Seen in 1 report
-
Asset accounting uses the pool's instantly redeemable credit instead of the actual LP token balance held.
-
Assets are transferred to the treasury without first updating the interest rates.
-
Assignment is used instead of addition-assignment when updating pending balances.
Seen in 1 report
-
Associated folder records were not deleted with the account and creation had no rate limit.
Seen in 1 report
-
Auction closure checks for an exact zero balance instead of a small threshold, so dust or donations keep the auction open.
-
Auction end time is recalculated from the current global duration instead of being stored per auction.
Seen in 1 report
-
Auction functions process every order without first checking validity, so one bad order reverts the batch.
-
Auction parameters were read live from a factory the owner could change at any time, with no timelock or active-auction guard.
Seen in 1 report
-
Authorisation checks edit rights but not whether the resource is soft-deleted.
Seen in 1 report
-
Auto-vote information is recorded only when finalise is called instead of at the actual end of the epoch.
-
Autosuggestions were populated from search queries without validation or user consent.
Seen in 1 report
-
Available funds increased on direct payment without verifying corresponding minted assets.
Seen in 1 report
-
Available liquidity adds unsettled funding fees to the base amount without ensuring those fees are actually collected.
Seen in 1 report
-
The backend does not reject control characters in folder names and its path handling errors during permission revocation.
-
The backend trusts a client-supplied centre parameter and does not enforce random assignment server-side.
-
The backend trusts the client-side plan value and performs no own authorisation check before premium actions.
-
Backward compatibility paths skipped the redeemed-status check that newer clients enforce.
Seen in 1 report
-
Bad debt is accrued into a bad debt mapping but total debt is not reduced by the same amount, causing double counting.
-
Bad-debt cleanup is keyed off a strict greater-than comparison, so an exact-match seizure with remaining debt is never handled.
Seen in 1 report
-
A balance check counts rewards already owed to users as available funding.
-
Balance-crediting logic relied on transfer listings without checking the unlock time of received outputs.
Seen in 1 report
-
Balances were cached in memory before updating, so a self-transfer used the added-to balance.
Seen in 1 report
-
Basis points are divided by 100 instead of 10,000.
Seen in 1 report
-
Bidding is allowed at the end timestamp while claiming can happen at the same timestamp, leaving a one-second window.
-
Bidding is guarded by a not-paused modifier but the contract exposes no external pause or unpause functions.
Seen in 1 report
-
Block number is used as a proxy for elapsed time on chains where block production is irregular.
Seen in 1 report
-
Block time is stored as an immutable variable so it cannot adapt when the chain's block time changes.
-
Boosted tokens added to the emission were not excluded from the supply deduction, so externally sent tokens were double-counted.