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 4,451 to 4,500 of 5,700
  1. The requested transfer amount is recorded as the escrow balance without checking the actual balance change.

    Seen in 1 report
  2. The require statement checked the first reserve twice instead of checking both reserves against the dust threshold.

    Seen in 1 report
  3. The require statement compared the contract's token balance to the initial supply variable, which was always zero.

    Seen in 1 report
  4. The require statement uses a logical OR instead of AND, so the check passes if either condition is true.

    Seen in 1 report
  5. The require used the wrong comparison operator, checking the count against the proposal ID in the wrong direction.

    Seen in 1 report
  6. The required amount was computed from mutable pool state at execution time, so another user's exit could change it between approval and execution.

    Seen in 1 report
  7. The required product ID was validated only in the browser, so valid IDs could be generated and registered.

    Seen in 1 report
  8. The required USD value multiplies a raw debt amount by a ratio before converting the debt to USD, mixing units and understating the requirement.

    Seen in 1 report
  9. The required-underlying check added the full mint value and pool fee without scaling by minUnderlyingBackingBIPS, so it demanded more backing than the protocol actually required.

    Seen in 1 report
  10. The reroll uses the caller-supplied type for limit checks and generation without verifying it matches the token.

    Seen in 1 report
  11. The rescue function does not check total reclaimed and does not restrict withdrawals when total stakers is zero.

    Seen in 1 report
  12. The rescue function reverts when the token address matches the stream token, so excess stream tokens cannot be recovered.

    Seen in 1 report
  13. The rescue function set the per-account claimed flag without checking whether the period was still open, and the flag was treated as final even though the share slot could be refilled.

    Seen in 1 report
  14. The rescue function wrote a permanent claimed flag for a future period without checking whether the period had started, and the withdrawal request path never checked that flag.

    Seen in 1 report
  15. The rescue path records a permanent boolean per account and period instead of tracking the exact shares it moved.

    Seen in 1 report
  16. The rescue path wrote a terminal never-cleared claimed flag to a bucket still open for new entries, whereas the normal claim path was bounded to closed buckets.

    Seen in 1 report
  17. The rescue request timestamp was not deleted after a rescue, leaving stale state that bypassed the cooldown for re-added assets.

    Seen in 1 report
  18. The resend endpoint lacked rate limiting or anti-automation controls.

    Seen in 1 report
  19. The reservation fee calculation used only the user's minting amount instead of the total collateral reserved including the pool fee.

    Seen in 1 report
  20. The reservation fee was waived for always-allowed minters, making repeated blocking free.

    Seen in 1 report
  21. The reserve active flag is consumed inconsistently: account data and borrow validation never check it, while withdraw and liquidation reject inactive reserves.

    Seen in 1 report
  22. The reserve function does not delete the existing listing mapping for the token.

    Seen in 1 report
  23. The reserve function does not reset the liquidation flag for the token.

    Seen in 1 report
  24. The reserve hard-coded a single authorised router instead of allowing several.

    Seen in 1 report
  25. The reserve price is not enforced beyond allowing the borrower to cancel, so there is no competitive pressure to reach it.

    Seen in 1 report
  26. The reserve ratio calculation included portfolio funds unavailable for redemptions.

    Seen in 1 report
  27. The reserve-factor setter only overwrites configuration and never checkpoints the elapsed interval or recomputes the current rates.

    Seen in 1 report
  28. The reserved-username blacklist was applied only in the email registration flow, and the username was used directly as a site path.

    Seen in 1 report
  29. The reset endpoint counts requests per connection or per payload slot rather than per email address.

    Seen in 1 report
  30. The reset endpoint has no per-account or per-IP throttling.

    Seen in 1 report
  31. The reset endpoint lacked both existence checks and rate limiting on the email parameter.

    Seen in 1 report
  32. The reset endpoint lacked rate limiting and generated a new password on every request instead of using a single-use token.

    Seen in 1 report
  33. The reset endpoint performed the reset directly from the request without a confirmation step and without rate limiting.

    Seen in 1 report
  34. The reset function cleared other per-period fields but omitted the total withdrawal requests counter.

    Seen in 1 report
  35. The reset function does not skip tokens that are paused according to the rewards whitelister.

    Seen in 1 report
  36. The reset function fails to zero the current withdrawal group's total base token amount, so later calculations double-count it.

    Seen in 1 report
  37. The reset handler assumed a vested pending unstake epoch was already processed or purged and did not account for fresh post-reset exit balances.

    Seen in 1 report
  38. The reset handler never compared the new password with the stored current password or a password history.

    Seen in 1 report
  39. The reset password page used a different, older validation rule than the other password pages.

    Seen in 1 report
  40. The reset path did not subtract redeemed unstake units from the epoch exit balance, unlike the normal release path, so rounding errors accumulated.

    Seen in 1 report
  41. The reset zeroes the claimed amount without accounting for a withdrawal ordered just before it.

    Seen in 1 report
  42. The resolve function validates only the price signature and does not compare the asset parameter to the queued trade's asset.

    Seen in 1 report
  43. The restore process did not check whether the resulting repository name was retired.

    Seen in 1 report
  44. The restriction check requires both from and to to be whitelisted without an exception for the zero address.

    Seen in 1 report
  45. The restriction compares input against a blacklist of exact strings without normalising or checking for Unicode homoglyphs.

    Seen in 1 report
  46. The restriction function omits a comparison between sender and recipient addresses.

    Seen in 1 report
  47. The resume helper never marked the reader as having used the callback, so the redirect logic applied the resume offset twice.

    Seen in 1 report
  48. The resume option takes precedence over file-safety options without checking for the conflicting combination.

    Seen in 1 report
  49. The resumption code clamped the offset to zero without clearing the carried-over hash state, and the failsafe only triggered when the offset was greater than zero.

    Seen in 1 report
  50. The retain function omitted the nominee checkpoint before using the staking weight.

    Seen in 1 report