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,801 to 2,850 of 5,700
  1. The deposit check used the total share supply directly instead of converting it to assets.

    Seen in 1 report
  2. The deposit check uses only the amount while the payout check uses amount plus reward against the same maximum.

    Seen in 1 report
  3. The deposit contract does not overwrite existing withdrawal credentials for a validator, so whoever deposits first sets them.

    Seen in 1 report
  4. The deposit contract processes deposits in order and allows multiple deposits for the same validator key, so a front-run deposit can set the withdrawal credentials.

    Seen in 1 report
  5. The deposit credited the requested amount rather than measuring the actual balance change.

    Seen in 1 report
  6. The deposit date used for the lockup was a weighted average of past deposits, so transfers could shorten it.

    Seen in 1 report
  7. The deposit fee applied only to direct deposits, not to queued deposits that were then minted.

    Seen in 1 report
  8. The deposit flow moves the full amount into the contract and approves the aggregator but never refunds leftovers.

    Seen in 1 report
  9. The deposit flow sets a future share unlock time before the bridge transfer is attempted.

    Seen in 1 report
  10. The deposit function checks shares against the minimum while the mint function checks assets, so the two checks are not equivalent when the share price differs from one.

    Seen in 1 report
  11. The deposit function checks the asset amount against max deposit but not the shares against max mint.

    Seen in 1 report
  12. The deposit function did not transfer tokens to the master contract, so its balance check always returned zero.

    Seen in 1 report
  13. The deposit function does not check that the caller is the trove owner.

    Seen in 1 report
  14. The deposit function does not let the caller specify a minimum output amount.

    Seen in 1 report
  15. The deposit function does not reject the native token address, and a transferFrom to that externally owned account succeeds without transferring funds.

    Seen in 1 report
  16. The deposit function does not reject zero liquidity while the withdrawal function uses zero liquidity as a marker for a non-existent position.

    Seen in 1 report
  17. The deposit function does not require the destination chain to differ from the source or the receiver to differ from the caller.

    Seen in 1 report
  18. The deposit function enforced a minimum amount but did not handle a remaining gap smaller than that minimum.

    Seen in 1 report
  19. The deposit function had no user-specified minimum LP token amount.

    Seen in 1 report
  20. The deposit function has no minimum-output parameter, exposing users to slippage.

    Seen in 1 report
  21. The deposit function incorrectly requires the swap input token to equal the target collateral token, though they should differ for a swap.

    Seen in 1 report
  22. The deposit function lacks a check that the token is in a supported token list.

    Seen in 1 report
  23. The deposit function lacks a minimum gas limit check.

    Seen in 1 report
  24. The deposit function overwrote bond information without preserving the remaining vesting period.

    Seen in 1 report
  25. The deposit function relies only on a one percent slippage tolerance and does not enforce that returned shares exceed deposited assets.

    Seen in 1 report
  26. The deposit function scaled the amount for the token transfer but used the unscaled amount to update the internal balance, causing a mismatch when the scaled amount rounded to zero.

    Seen in 1 report
  27. The deposit function trusted a caller-supplied amount instead of reading the contract's current token balance at execution time.

    Seen in 1 report
  28. The deposit gate is evaluated on amount plus dust while the credit uses the debited value, and the credit result is discarded.

    Seen in 1 report
  29. The deposit handler ignores the result returned by the message handler, so events collected in the temporary event manager are never copied back.

    Seen in 1 report
  30. The deposit instruction lacked a constraint verifying that the deposited token's mint address equalled the allowed token's mint address.

    Seen in 1 report
  31. The deposit instruction minted shares using a stale vault balance because it did not update the balance before calculating shares.

    Seen in 1 report
  32. The deposit limit check only updates the user's total deposited amount when a limit is active, so failed deposits made before the limit was set are not recorded.

    Seen in 1 report
  33. The deposit limit check subtracted the cash reserve a second time even though total deposits already excluded it.

    Seen in 1 report
  34. The deposit limit check uses the share balance of the caller instead of the receiver.

    Seen in 1 report
  35. The deposit limit is keyed on the sender rather than on the actual depositor address passed through the bridge call.

    Seen in 1 report
  36. The deposit logic always stakes on the external pool for that collateral type, with no fallback if the pool is shut down.

    Seen in 1 report
  37. The deposit logic does not initialise the position's claimed amount to reflect the existing per-share claimable amount, so new shares are treated as having been present for past rewards.

    Seen in 1 report
  38. The deposit path calls the transfer restriction check with a zero sender, which the registry treats as untrusted.

    Seen in 1 report
  39. The deposit path uses convertToShares which returns assets when supply is zero, while the mint path returns a fixed share amount, so protection covers only mint.

    Seen in 1 report
  40. The deposit request function does not check that the named controller consented, and the standard claim functions only inspect the first request in the controller queue.

    Seen in 1 report
  41. The deposit returns excess ETH as native ETH but the wrapper only measures its wrapped token balance to detect the residual.

    Seen in 1 report
  42. The deposit updates total assets before computing shares, so the post-deposit ratio is used.

    Seen in 1 report
  43. The deposit wraps ETH but then pulls the deposit amount from the user's token balance instead of using the wrapped ETH, leaving wrapped tokens in the contract.

    Seen in 1 report
  44. The deposit-for function unconditionally adds the value to the supply variable even when called for a merge where no new tokens are transferred.

    Seen in 1 report
  45. The depositCollateral function lacks a check that the pool status is active.

    Seen in 1 report
  46. The depositFor function let anyone modify any user's deposit record, including lockup end time and delegate, without access control.

    Seen in 1 report
  47. The depositReward function lacks access control, so anyone can call it with zero reward and extend the period.

    Seen in 1 report
  48. The deprecate function does not verify that at least one vault collateral token remains valid.

    Seen in 1 report
  49. The derivative's mint rejected any mint after expiry, but the payout logic still tried to mint after expiry.

    Seen in 1 report
  50. The description-to-subject fallback copied unsanitised user input into the subject field, bypassing the sanitisation applied to the original subject.

    Seen in 1 report