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,551 to 4,600 of 5,700
  1. The reward loop includes the current unfinished epoch, allowing a claim-merge-reclaim cycle.

    Seen in 1 report
  2. The reward multiplies the last locked amount by the reward rate instead of the total locked balance.

    Seen in 1 report
  3. The reward notification always restarts the period and recalculates the rate on any new reward, with no minimum threshold.

    Seen in 1 report
  4. The reward notification combines leftover rewards with the new reward and divides by the new duration, ignoring the original period finish.

    Seen in 1 report
  5. The reward notification updates the last update time without first storing the accumulated reward per token, so the elapsed period is not accounted for.

    Seen in 1 report
  6. The reward parameter was set from the user's configuration at preparation time, but the user could change that configuration before the transaction was mined.

    Seen in 1 report
  7. The reward payout timestamp is not updated during the freeze, so the whole period's rewards go to whoever is staked at unfreeze.

    Seen in 1 report
  8. The reward period finish is set unconditionally to now plus the full rewards duration, even when a period is already ongoing.

    Seen in 1 report
  9. The reward period starts when rewards are notified regardless of whether any participants exist, so rewards accrue when no one can claim them.

    Seen in 1 report
  10. The reward pool allowed the same extra reward address to be added multiple times without a duplicate check.

    Seen in 1 report
  11. The reward processing stakes the main reward without checking the minimum stake requirement, so a small amount reverts the entire claim.

    Seen in 1 report
  12. The reward rate calculation omits the rollover amount while the reward reserve includes it.

    Seen in 1 report
  13. The reward rate uses the average of start and final ratios, which does not account for the non-linear reward curve when crossing a bound.

    Seen in 1 report
  14. The reward share calculation uses the current total supply, which can be temporarily inflated by a large stake.

    Seen in 1 report
  15. The reward split divided the total equally by receiver count instead of reading each operator's current bond.

    Seen in 1 report
  16. The reward token array is fixed in the constructor with no way to add entries.

    Seen in 1 report
  17. The reward tracker stores only the current stake amount and starting period, without preserving historical stake amounts per period.

    Seen in 1 report
  18. The reward update relied on current total borrows, which could be inflated within one transaction or block.

    Seen in 1 report
  19. The reward update runs after the token burn, so the reward calculation uses the reduced post-burn balance.

    Seen in 1 report
  20. The reward window end is hardcoded as a constant timestamp instead of being computed from deployment time in the constructor.

    Seen in 1 report
  21. The reward-per-token calculation returned early when total supply was zero, so incoming rewards were not accounted for.

    Seen in 1 report
  22. The reward-per-token-paid mapping is not updated on a user's first deposit, so vested tokens can be claimed immediately.

    Seen in 1 report
  23. The reward-processing threshold is derived from a token balance any external party can increase by a direct transfer, so reward timing can be controlled.

    Seen in 1 report
  24. The rewarder contract had no sweep or recovery function for unutilised reward tokens, unlike its base contract.

    Seen in 1 report
  25. The risk calculation uses the stored exchange rate instead of the current one that accrues interest.

    Seen in 1 report
  26. The risk check compares account value against zero without subtracting the trade fee charged afterwards.

    Seen in 1 report
  27. The risk check omits the referral fee the account will receive from the counterparty.

    Seen in 1 report
  28. The risk check used the full borrow amount instead of the amount after the origination fee.

    Seen in 1 report
  29. The roll function did not handle a zero new collateral, causing a zero-value transfer.

    Seen in 1 report
  30. The roll function lacked a limit on rolls and the toggle could not prevent multiple rolls in one transaction.

    Seen in 1 report
  31. The roller assumes it can always create a series at the calculated maturity, but the system enforces one series per adapter and maturity.

    Seen in 1 report
  32. The room login endpoint does not enforce any rate limiting or account lockout on failed password attempts.

    Seen in 1 report
  33. The room-ending routine failed to clean up the linked event, leaving an orphaned post with no valid delete path.

    Seen in 1 report
  34. The route-calculation function lacks logic to evaluate pools and indices and defaults to zero.

    Seen in 1 report
  35. The router approves the vault for the shares amount instead of the assets amount required by previewMint.

    Seen in 1 report
  36. The router calls a single permit signature that does not match DAI's non-standard implementation.

    Seen in 1 report
  37. The router calls permit on a pair contract that does not implement it.

    Seen in 1 report
  38. The router computed token amounts from virtual reserves while the pair's mint expected a different amount, so the values only matched in one case.

    Seen in 1 report
  39. The router constant was assigned the V3 router address instead of the V2 router address.

    Seen in 1 report
  40. The router did not transfer the user's tokens to itself before calling the unwrap, and it checked the destination address instead of the owner.

    Seen in 1 report
  41. The router does not reject liquidator equal to user, and the liquidation transfer lacks the self-transfer guard present in its sibling transfer function.

    Seen in 1 report
  42. The router enforced no minimum borrow or residual debt, so partial repayment could leave a position too small to be worth liquidating.

    Seen in 1 report
  43. The router forwards the full message value to each pool in a loop but only the fee-subtracted amount returns.

    Seen in 1 report
  44. The router only checked the input cap and never confirmed the received output equalled the requested amount.

    Seen in 1 report
  45. The router passed the auction duration instead of the final timestamp when initialising the accountant.

    Seen in 1 report
  46. The router signature hash included only the transfer ID and path length, not the actual router addresses.

    Seen in 1 report
  47. The router trusts a pre-calculated expected amount based on a possibly stale exchange rate instead of the actual amount received from the lToken.

    Seen in 1 report
  48. The router uses the wrong token variable when transferring proceeds back to the user.

    Seen in 1 report
  49. The router validates close admission against the queued-position projection while the engine validates the same request against the live position.

    Seen in 1 report
  50. The router withdrew both tokens but only forwarded one for conversion, never returning the base portion to the member.

    Seen in 1 report