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 2,351 to 2,400 of 5,700
  1. The code passed the entire amount slice to the community pool fund instead of the single coin being processed.

    Seen in 1 report
  2. The code passed the EVM chain id instead of the bridge chain id for the refund chain.

    Seen in 1 report
  3. The code passed the original source amount instead of the amount after settlement when calculating the destination amount.

    Seen in 1 report
  4. The code passed the stake token address to the transfer helper instead of the sell token address.

    Seen in 1 report
  5. The code passed the target denom to the multiplier lookup instead of the source coin's denom.

    Seen in 1 report
  6. The code passed the valid signer count to the threshold change instead of the computed new threshold.

    Seen in 1 report
  7. The code passes the full withdrawal amount to the redemption function instead of subtracting the contract's existing balance.

    Seen in 1 report
  8. The code path for amounts above the available maximum does not enforce the minimum implied rate slippage protection.

    Seen in 1 report
  9. The code path that swaps the remainder through the yield pool does not call the fee extraction logic.

    Seen in 1 report
  10. The code performed the irreversible on-chain key rotation before persisting the new signer to disk, without atomic write or recovery.

    Seen in 1 report
  11. The code picked the price with the wrong maximise flag when computing the impact pool value.

    Seen in 1 report
  12. The code read the caller's deposit instead of the receiver's deposit when computing the remaining lock duration.

    Seen in 1 report
  13. The code read total token supply instead of virtual supply, inflating the threshold.

    Seen in 1 report
  14. The code reads the proposer field after it has already been overwritten with the new proposer.

    Seen in 1 report
  15. The code reduced the saved total underlying by the requested amount rather than the amount actually received, and deducted the minimum pull even when nothing was withdrawn.

    Seen in 1 report
  16. The code returned early without reversing the transaction list, so transactions were processed newest-first and older ones were permanently bypassed.

    Seen in 1 report
  17. The code reused the initial token balance as the previous amount for every event inside the transfer loop instead of updating it after each transfer.

    Seen in 1 report
  18. The code sets the last position's withdrawal amount to the leftover liquidity instead of subtracting the leftover from the original amount.

    Seen in 1 report
  19. The code sets the output token amount from the auxiliary action's return without verifying the token and recipient match the expected underlying asset.

    Seen in 1 report
  20. The code size check can be bypassed by self-destructing the listener in the same transaction, leaving a non-contract that makes the try/catch revert.

    Seen in 1 report
  21. The code stores the zero address but emits the original non-zero parameter.

    Seen in 1 report
  22. The code subtracted reserved funds from the vault balance when measuring before and after balances.

    Seen in 1 report
  23. The code subtracts only the filled locked value from the pending locked balance instead of the total locked value of the original quote.

    Seen in 1 report
  24. The code subtracts the first bid time from the max duration instead of assigning the max duration directly.

    Seen in 1 report
  25. The code subtracts the refund currency amount from the user's token amount instead of the difference between the previous and new token amounts.

    Seen in 1 report
  26. The code takes the absolute value of the exponent and always multiplies by a positive power of ten.

    Seen in 1 report
  27. The code took the api_key value straight from request parameters without checking it was a single string, so an array was passed into the database lookup and turned into a multi-value match.

    Seen in 1 report
  28. The code transfers only the treasury portion and omits the creator share used to buy governance tokens.

    Seen in 1 report
  29. The code transfers the locker incentive but then sends the full reward amount to the caller without subtracting it.

    Seen in 1 report
  30. The code treated a vault as having no collateral based only on the current auction, without checking for another running auction.

    Seen in 1 report
  31. The code treats all three reasons for being unable to calculate a risk factor as equivalent and assigns the minimum premium, even when low capital should make protection expensive.

    Seen in 1 report
  32. The code unconditionally calls _setYIntercept after the if-else block even when the else branch sets withdrawReserve to zero.

    Seen in 1 report
  33. The code unconditionally calls deposit and redeem for all holdings even when the amount is zero.

    Seen in 1 report
  34. The code unconditionally copied the last nominee into the removed slot even when the removed nominee was itself the last element.

    Seen in 1 report
  35. The code unconditionally set the queue index to the new queue length after updating an existing rollover.

    Seen in 1 report
  36. The code updated the tier for the old boundary rank instead of the new boundary rank when the staker count increased without changing the tier 2 count.

    Seen in 1 report
  37. The code used a default of 0 when no used sequence number was found and could not tell 'nothing used yet' from '0 already used'.

    Seen in 1 report
  38. The code used a fixed precision constant of 1e18 for collateral amounts without adjusting for the token's actual decimals.

    Seen in 1 report
  39. The code used a single time segment with the rate at the last update instead of iterating over checkpoints.

    Seen in 1 report
  40. The code used a strict equality check for the pool creation fee and an 'any' check for token factory fees, mishandling shared denominations.

    Seen in 1 report
  41. The code used an impossible sentinel value for an unsigned integer index, so zero was ambiguous with not found.

    Seen in 1 report
  42. The code used block numbers instead of timestamps when calling the gauge controller's relative weight function.

    Seen in 1 report
  43. The code used block.number (which on Arbitrum is the L1 block number) instead of the L2 block number from Chain.currentBlockNumber() when setting the latest ADL block.

    Seen in 1 report
  44. The code used loose equality and did not reject a missing or null stored token, so null matched null.

    Seen in 1 report
  45. The code used the first return value of the deposit-and-fix call instead of the second, which is the principal token count.

    Seen in 1 report
  46. The code used the new total of tier 1 and tier 2 stakers to find the boundary rank, but when a tier 3 staker exited the current tier 1 and tier 2 counts had not changed, so the boundary rank was wrong.

    Seen in 1 report
  47. The code used the receiving asset identifier instead of the sending asset identifier when paying the relayer.

    Seen in 1 report
  48. The code used the wrong variable as the transfer amount instead of the correctly calculated cNote amount.

    Seen in 1 report
  49. The code used the wrong variable when transferring tokens, so the full-repayment sentinel was not replaced with the actual amount owed.

    Seen in 1 report
  50. The code used transfer instead of transferFrom to collect the swap fee.

    Seen in 1 report