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 5,451 to 5,500 of 5,700
  1. The winner selection loop does not check for or prevent duplicate addresses, so the same index can be chosen more than once.

    Seen in 1 report
  2. The winner-selection logic recorded the winner but never removed or marked the chosen ticket, so the ticket pool was reused unchanged.

    Seen in 1 report
  3. The winning prize index was calculated on the client and stored by the server without validation.

    Seen in 1 report
  4. The wiped-tranche guard was added only to one quote function, leaving the shared pricing helpers and their other callers unguarded against zero pricing assets.

    Seen in 1 report
  5. The withdraw call hardcodes the contract's own address instead of using the position parameter supplied to the hook.

    Seen in 1 report
  6. The withdraw function accrues rewards for the caller and receiver but not the owner.

    Seen in 1 report
  7. The withdraw function and its helper returned nothing and the accrual helper stayed internal, so no on-chain query exists.

    Seen in 1 report
  8. The withdraw function applies the non-Kerosene collateral check to Kerosene withdrawals, comparing the non-Kerosene value minus the withdrawn amount against the minted amount.

    Seen in 1 report
  9. The withdraw function calls safeTransferFrom on the asset token without first setting an allowance for the vault to spend its own tokens.

    Seen in 1 report
  10. The withdraw function capped the payout at the original deposit while burning the full share amount, leaving interest with no shares to claim it.

    Seen in 1 report
  11. The withdraw function deletes the whole NFT record without checking for a non-zero unpaid reward balance.

    Seen in 1 report
  12. The withdraw function did not check that the token being withdrawn was not the collateral token's legacy counterpart.

    Seen in 1 report
  13. The withdraw function did not check the lock-enabled state variable before allowing withdrawals.

    Seen in 1 report
  14. The withdraw function did not decrement the total voting amount or write a voting checkpoint, so the total stayed inflated after withdrawals.

    Seen in 1 report
  15. The withdraw function did not decrement the unstreamed variable.

    Seen in 1 report
  16. The withdraw function did not record that a withdrawal had occurred.

    Seen in 1 report
  17. The withdraw function did not remove old bids before checking the user's bid rate.

    Seen in 1 report
  18. The withdraw function did not return unused shares to the caller when Yearn only partially fulfilled the withdrawal.

    Seen in 1 report
  19. The withdraw function did not run the same safety check that enforces per-collateral borrow caps.

    Seen in 1 report
  20. The withdraw function does not check that the boost unlock time has passed.

    Seen in 1 report
  21. The withdraw function does not decrease the total delegated WETH state variable.

    Seen in 1 report
  22. The withdraw function does not reduce the user's voting power balance when the contract is stopped and the full amount is withdrawn.

    Seen in 1 report
  23. The withdraw function enforced the frozen check unlike the collect and burn functions, so gas fee deposits failed when the CoinStore was frozen.

    Seen in 1 report
  24. The withdraw function failed to decrease the pending withdrawals variable, overstating outstanding withdrawals.

    Seen in 1 report
  25. The withdraw function hardcodes a 1 percent slippage tolerance instead of letting the caller specify it.

    Seen in 1 report
  26. The withdraw function has no lock-up preventing immediate withdrawal after deposit and pays all accrued rewards to the caller.

    Seen in 1 report
  27. The withdraw function read the withdrawal proposal from the caller rather than the owner argument.

    Seen in 1 report
  28. The withdraw function relies only on a burn mechanism that needs sufficient excess balance, with no fallback liquidity source.

    Seen in 1 report
  29. The withdraw function subtracted from the minted counter instead of only adding to the removed counter.

    Seen in 1 report
  30. The withdraw function subtracts the underlying amount from the allowance instead of the equivalent number of shares.

    Seen in 1 report
  31. The withdraw function sweeps the entire reserve pool balance without tracking individual stakes.

    Seen in 1 report
  32. The withdraw function uses a minimum shares out check instead of a maximum shares in check.

    Seen in 1 report
  33. The withdraw guard ignores free cash and carry is projected out of the pledge, so the trader controls their own liquidation eligibility during the freeze.

    Seen in 1 report
  34. The withdraw guard uses the raw cached mark while liquidation applies a side-adverse confidence shift to the same mark, with no buffer between the thresholds.

    Seen in 1 report
  35. The withdraw message options builder only added gas and value options and omitted the ordered execution option.

    Seen in 1 report
  36. The withdraw reserve is only computed from the surplus above the auction's expected amount, so it is forced to zero when total assets do not exceed that expectation.

    Seen in 1 report
  37. The withdraw transaction preparation functions omitted an instruction to increment the nonce, so a failed withdrawal left the nonce unchanged.

    Seen in 1 report
  38. The withdraw-to-chain call set unwrap to false, so the destination received wrapped tokens the lock function could not use.

    Seen in 1 report
  39. The withdrawable calculation uses the reduced borrow limit as the denominator while the numerator uses the original total supply.

    Seen in 1 report
  40. The withdrawal accounting subtracted only the amount returned by the vault and ignored the fee the vault took.

    Seen in 1 report
  41. The withdrawal amount is set to zero instead of the full supply when the allocation is zero.

    Seen in 1 report
  42. The withdrawal amount parameter is 64-bit while other token amounts use 128-bit.

    Seen in 1 report
  43. The withdrawal amount was added in one function and then subtracted again by the caller, subtracting it twice.

    Seen in 1 report
  44. The withdrawal amount was scaled by price per share before being passed to a vault function that expected the exact token amount.

    Seen in 1 report
  45. The withdrawal check relies only on the lowest utilized price, which can be inflated by adding quote tokens to a high bucket.

    Seen in 1 report
  46. The withdrawal fee logic did not exempt withdrawals signed by the vault fee wallet or program fee wallet.

    Seen in 1 report
  47. The withdrawal function checked only the user's own share balance against the minimum, not total pool issuance.

    Seen in 1 report
  48. The withdrawal function checks the total remaining supply against a minimum amount, rather than checking only the withdrawing user's balance, so the last tokens cannot be withdrawn.

    Seen in 1 report
  49. The withdrawal function does not reset the high-water mark when total supply reaches zero.

    Seen in 1 report
  50. The withdrawal function does not verify that the lien has no active loan before transferring the NFT.

    Seen in 1 report