Skip to content

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.

Back to the lesson 501 to 550 of 5,700
  1. A bitwise AND was used instead of a logical OR to test whether either amount was zero.

    Seen in 1 report
  2. A boolean flag is declared but never assigned, so refund logic always takes the wrong branch.

    Seen in 1 report
  3. A boundary check uses less-than-or-equal instead of less-than, so single-block queries return zero.

    Seen in 1 report
  4. A branch never assigns the compensated amount, leaving it at its default of zero.

    Seen in 1 report
  5. A burn function requiring an allowance is called without granting that allowance.

    Seen in 1 report
  6. A cache-miss marker was treated as proof the transaction was included without metering, but a transaction can be rejected before inclusion for a transient reason.

    Seen in 1 report
  7. A cache-reuse coverage check still compares every feed against an aggregate publish time that was redefined from the oldest to the newest component time.

    Seen in 1 report
  8. A caller-supplied reward token list was used to index storage without a duplicate check, and the same precomputed amounts were reused per entry.

    Seen in 1 report
  9. A checkpoint created during reset is counted for the new epoch, so the previous epoch's balance stays claimable.

    Seen in 1 report
  10. A client-controlled flag decided whether a convenience fee was applied instead of the server calculating charges itself.

    Seen in 1 report
  11. A clip function on the end square root price prevents it from contributing negatively to the active tick.

    Seen in 1 report
  12. A collateral activity check is applied to all vault interactions, including ones that do not need price validation.

    Seen in 1 report
  13. A condition used OR instead of AND when checking admin or host, so an admin who was not host returned early and skipped updating the recording status.

    Seen in 1 report
  14. A condition uses logical AND instead of OR when checking the caller is the owner and the short ID matches.

    Seen in 1 report
  15. A conditional check gates the application of the governance-set rate so the adjustment is skipped above a fixed threshold.

    Seen in 1 report
  16. A constant was set to 5000 instead of the documented 6600, likely a typo or oversight.

    Seen in 1 report
  17. A constraint variable is used in the bond calculation without first being set to the collateral sell value, so the kicker reward uses the wrong base.

    Seen in 1 report
  18. A copy-paste error called the generic tribute function instead of the governance variant.

    Seen in 1 report
  19. A copy-paste error called the inference score insert instead of the forecast score insert.

    Seen in 1 report
  20. A copy-paste error reverses the subtraction order for one token's pool exposure.

    Seen in 1 report
  21. A copy-paste error set the wrong array index to zero after processing.

    Seen in 1 report
  22. A copy-paste error: the unfreezeChain function calls freezeDiamond instead of unfreezeDiamond.

    Seen in 1 report
  23. A copy-paste or typo error assigns the cumulative ask where the cumulative bid was intended.

    Seen in 1 report
  24. A copy-paste typo made the require statement check the primary token's decimals instead of the secondary token's.

    Seen in 1 report
  25. A custom invite link was not reserved or monitored, so it became claimable when the boost level dropped.

    Seen in 1 report
  26. A custom price set during a position order was reused for later swaps in the same order.

    Seen in 1 report
  27. A custom transfer helper was used instead of a safe transfer library that handles non-standard tokens.

    Seen in 1 report
  28. A day-in-blocks constant was calculated from a pre-merge 13.3-second block time.

    Seen in 1 report
  29. A decode failure of the authoritative call bytes is caught without setting the flag that blocks confirmation, so indexer labels are shown instead.

    Seen in 1 report
  30. A deleted project name became immediately available for re-registration and package managers treated the new owner's package as a routine upgrade.

    Seen in 1 report
  31. A deprecated API allowed changing a field documented as read-only, and the console had no safeguard against forcing users into an organisation that was their only one.

    Seen in 1 report
  32. A design flaw where the same KeroseneManager list is used for two conflicting purposes: pricing (which must exclude Kerosene vaults to avoid recursion) and licensing (which must include Kerosene vaults).

    Seen in 1 report
  33. A discrete compounding formula is applied at irregular, activity-dependent intervals.

    Seen in 1 report
  34. A drip function fetches the stored revenue rather than accepting the calculated revenue as a parameter, so any bonus computed elsewhere is silently dropped.

    Seen in 1 report
  35. A dynamic redemption cap is used as a measure of ownership value instead of the LP tokens' proportional claim on pool liquidity.

    Seen in 1 report
  36. A failed cross-chain message is not marked as consumed, so it can be retried after the NFT has moved back.

    Seen in 1 report
  37. A failed NFT transfer to the bidder returns false and is interpreted as a signal to proceed to the next stage.

    Seen in 1 report
  38. A false return is treated as no transfer even though part of the reward was already forwarded to a sub-gauge.

    Seen in 1 report
  39. A faulty rate-limit implementation alternated reliable and unreliable responses, and registration returned distinguishable responses.

    Seen in 1 report
  40. A fee adjustment value with 18 decimals is used in a division without scaling.

    Seen in 1 report
  41. A fixed end block incentivises last-minute bidding and prevents proper price discovery.

    Seen in 1 report
  42. A fixed gas limit used to size the funding permit with no input for whether the resolver still needs deploying.

    Seen in 1 report
  43. A fixed initial liquidity amount of each asset ignores the real-world value of the gas token.

    Seen in 1 report
  44. A fixed leftover floor is inconsistent with the close-factor cap, so the leftover check rejects repayments the close factor permits.

    Seen in 1 report
  45. A fixed-point oracle price was multiplied in without converting back to a normal integer, so payouts could be off by the scaling factor.

    Seen in 1 report
  46. A fixed-share threshold was used for minting but redeem could reduce total shares below it.

    Seen in 1 report
  47. A function that floors negative changes at zero is used for the initial APR, combined with a slow exponential moving average.

    Seen in 1 report
  48. A gas charge before a state read that does not charge gas internally was removed.

    Seen in 1 report
  49. A global weight decays all users' collateral during redemption while only users with earmarked debt get debt relief.

    Seen in 1 report
  50. A greater-than comparison selects the larger value where a less-than comparison should select the smaller, inverting the operator cap.

    Seen in 1 report