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,651 to 2,700 of 5,700
  1. The contract uses a fixed BTC-to-token ratio rather than a live price feed.

    Seen in 1 report
  2. The contract uses a zero last bid to detect a gifted NFT, but an earlier bid makes it non-zero.

    Seen in 1 report
  3. The contract uses its current token balance to calculate rewards without initializing the last reward timestamp.

    Seen in 1 report
  4. The contract uses its own address as the referral argument instead of a separate account, so the referral is invalid.

    Seen in 1 report
  5. The contract uses its own token balances as the desired amounts and sets minimums as a fixed percentage of those balances.

    Seen in 1 report
  6. The contract uses safeTransferFrom from its own balance without approving itself.

    Seen in 1 report
  7. The contract uses safeTransferFrom with the requested amount instead of transferShares, ignoring Lido's one or two wei rounding behaviour.

    Seen in 1 report
  8. The contract uses the current block timestamp as the deadline instead of a user-supplied value.

    Seen in 1 report
  9. The contract uses the name and symbol strings as the sole indicator of initialisation, without preventing them from being set to empty strings.

    Seen in 1 report
  10. The contract uses the nominal collateral ratio function instead of the current one, and the nominal value is always below the minimum threshold.

    Seen in 1 report
  11. The contract uses the standard transfer interface that assumes a boolean return, which reverts for tokens that return nothing.

    Seen in 1 report
  12. The contract validates the token address against a whitelist but not that the declared token type matches the actual standard, and the ERC721 path uses a low-level call.

    Seen in 1 report
  13. The contract's interface definitions for the gauge getReward function and the router poolFor and Route struct did not match the actual DEX interfaces.

    Seen in 1 report
  14. The contract's own address is used instead of the caller's address when populating the sender field of the transaction record.

    Seen in 1 report
  15. The contracts assume all meta pool tokens have 18 decimals and sum amounts without normalising.

    Seen in 1 report
  16. The contracts do not verify the actual amount received after a transfer, so fees and balance changes are not accounted for.

    Seen in 1 report
  17. The controller assumed claimFees always results in WETH being received without checking the balance.

    Seen in 1 report
  18. The controller assumed tokens with a zero minimum would not be received, but Curve always transfers all underlying tokens.

    Seen in 1 report
  19. The controller infers reward claiming from the function signature rather than decoding the actual boolean argument.

    Seen in 1 report
  20. The controller inspects only the first token in the batch swap path rather than using the returned asset deltas.

    Seen in 1 report
  21. The controller only accounts for the final token in a batch swap, ignoring intermediate tokens returned to the user.

    Seen in 1 report
  22. The controller used its own immutable treasury address instead of querying the vault's treasury address.

    Seen in 1 report
  23. The controller's withdrawal loop did not check that the requested amount was fully satisfied and did not revert when a remainder was left.

    Seen in 1 report
  24. The conversion divided a USDV amount by the USDV price instead of using the VADER price.

    Seen in 1 report
  25. The conversion divides by a hardcoded factor instead of reading the token's decimals.

    Seen in 1 report
  26. The conversion functions add one to cached totals that already include a plus one from the settle preview.

    Seen in 1 report
  27. The conversion included tokens pending undelegation whose shares had already been burned.

    Seen in 1 report
  28. The conversion marked the merkle proof as used even when the transferred amount was zero.

    Seen in 1 report
  29. The conversion multiplied the settlement and trade fee percentages instead of subtracting both fees from the deposit.

    Seen in 1 report
  30. The conversion multiplies by the multiplier but omits division by the basis points constant.

    Seen in 1 report
  31. The conversion routine stores a slice-relative index as an absolute cursor and prefix validation only checks the final span element.

    Seen in 1 report
  32. The cooldown check in the reward claim path prevented claiming external rewards during withdrawal initiation, so the accumulator was not updated before the final claim.

    Seen in 1 report
  33. The cooldown check uses less-than-or-equal instead of strict less-than.

    Seen in 1 report
  34. The cooldown end time for a user-validator slot was overwritten on each unstake instead of tracking each unstake separately.

    Seen in 1 report
  35. The cooldown end time is recomputed from the mutable global interval instead of preserving the interval stored when unstaking began.

    Seen in 1 report
  36. The cooldown used a timestamp comparison while reward accounting used an epoch counter that could lag behind the timestamp.

    Seen in 1 report
  37. The cooldown was only extended when the post-withdrawal collateral fell below the minimum.

    Seen in 1 report
  38. The counter is incremented only on a user's first deposit but decremented on every withdrawal that empties the deposit.

    Seen in 1 report
  39. The counter was decremented without checking whether the token was previously allowed.

    Seen in 1 report
  40. The coupon code input field lacked rate limiting, allowing brute-force guessing of valid codes.

    Seen in 1 report
  41. The coupon verification endpoint trusted a client-supplied discount value instead of calculating the discount server-side.

    Seen in 1 report
  42. The courier is only set when the user's share balance is zero, so any existing shares prevent assignment.

    Seen in 1 report
  43. The create fee discount state variable has no setter and defaults to zero.

    Seen in 1 report
  44. The create function did not require the collateral token to be the zero address when ETH was sent.

    Seen in 1 report
  45. The create function stored the caller-supplied duration without validating it against the allowed minimum and maximum.

    Seen in 1 report
  46. The create handler inserts a new pending entry without checking for an existing entry with the same transaction ID and output index.

    Seen in 1 report
  47. The create_deposit endpoint did not verify that submitted scripts matched the scripts in the referenced Bitcoin transaction.

    Seen in 1 report
  48. The creation function wrote to the deployed markets slot without checking it was empty.

    Seen in 1 report
  49. The creation timestamp is only updated when duration changes, but tax is always calculated for the full duration.

    Seen in 1 report
  50. The creator can change the sell royalty at any time with no delay, and it applies to existing shares.

    Seen in 1 report