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.
-
The total collateral ratio check was only performed once before the redemption loop, not on each iteration.
Seen in 1 report
-
The total debt check ran before the new lien was appended to the liens array, so it ignored the new lien.
-
The total locked collateral was reduced by the collateral transferred out instead of being scaled by the same debt-proportion factor used elsewhere.
-
The total net cost calculation included the full borrowing fee amount even though the fee receiver's portion was already included separately, causing double counting.
Seen in 1 report
-
The total royalty was incremented without checking the recipient was non-zero while the transfer was skipped.
Seen in 1 report
-
The total supply function read the contract's own entry in the token balance mapping rather than its native currency balance.
Seen in 1 report
-
The total value of all shares was calculated but not divided by total token supply.
Seen in 1 report
-
The total-contracts-sold variable was reset to zero on each withdrawal instead of persisting.
Seen in 1 report
-
The total-value helper used a stale internal accumulator of shares rather than the contract's live balance, double counting shares moved during liquidation.
Seen in 1 report
-
The totalRewardUnits variable was not decremented when an observer's reward was decremented for voting against the majority.
Seen in 1 report
-
The tradability state setter did not verify spot price against the oracle before allowing a state that disabled swapping but permitted removal.
-
The trade end timestamp was set to the auction end and not reset on early settlement.
Seen in 1 report
-
The trade functions did not subtract hedging fees from used funds after hedging added them, so the fees were double-counted.
-
The trade size calculation read instantaneous AMM pool reserves instead of using a manipulation-resistant oracle.
Seen in 1 report
-
The trade type was read from user input instead of being hardcoded to the single exact-in variant, so the caller could flip the direction of the trade.
-
The trading module revoked the sell token allowance after every swap, and a user could pick the same pool as the strategy, zeroing its infinite allowance.
Seen in 1 report
-
The transaction hash did not include the execution time, so identical calls produced the same hash.
Seen in 1 report
-
The transaction ID hash omitted the application priority while block ordering compared priority before ID, so duplicate IDs could coexist.
Seen in 1 report
-
The transaction object cached priority gas price and cost on first executability and never recomputed them when the base fee changed.
Seen in 1 report
-
The transaction origin address was used instead of the immediate caller address when emitting the event.
Seen in 1 report
-
The transaction pipe returned the committed sequence number from global state instead of the highest used sequence number, so the replay check used a stale value after cleanup.
Seen in 1 report
-
The transaction was added to the mempool before the send operation, with no rollback if the send failed.
Seen in 1 report
-
The transfer call used the underlying token address instead of the principal token address.
Seen in 1 report
-
The transfer code unconditionally decoded a boolean return value, which failed when the token returned no data.
Seen in 1 report
-
The transfer endpoint did not validate that the amount was positive, so a negative value reversed credit and debit.
Seen in 1 report
-
The transfer function checked only the grantor's remaining unclaimed amount, so moving the amount to the vesting manager blocked reallocation from the original grantor.
Seen in 1 report
-
The transfer function checked the contract's own balance instead of the sender's balance.
-
The transfer function compared the raw free balance to zero instead of the price-adjusted value of the transferred amount.
Seen in 1 report
-
The transfer function deducted a fee from the sender before checking that the total amount including the fee was within the allowance.
Seen in 1 report
-
The transfer function did not call the registry to update the holding position for either the source or destination account.
Seen in 1 report
-
The transfer function did not check whether sender and recipient were the same, so a self-transfer credited without debiting.
Seen in 1 report
-
The transfer function did not verify interface support before proceeding and silently did nothing.
Seen in 1 report
-
The transfer function downcast the share amount to a smaller integer type than the balance store used.
Seen in 1 report
-
The transfer function moved votes between sender and recipient instead of their respective delegatees.
Seen in 1 report
-
The transfer function returned early when the recipient was already the owner, so insufficient balance was not detected.
Seen in 1 report
-
The transfer function skipped the real token transfer when the balance was short but still updated the internal accounting.
-
The transfer function trusted tx.origin and skipped the normal approval step.
Seen in 1 report
-
The transfer function updated only the creator field and left royalty target and fee route unchanged.
Seen in 1 report
-
The transfer handler trusted a user-supplied fee field and transferred it from the recipient without validating it against any limit or actual cost.
Seen in 1 report
-
The transfer helper checked ERC721 support before ERC1155, so dual-interface tokens were handled as single-item ERC721.
-
The transfer helper returned the input amount instead of the actual shares received.
Seen in 1 report
-
The transfer hook added recipients to the holders array based only on zero balance, without checking the amount or excluding the zero address.
-
The transfer hook checked the from address even when burning to the zero address.
Seen in 1 report
-
The transfer hook did not skip the cooldown reset when sender and receiver were the same address.
Seen in 1 report
-
The transfer hook skipped fee caching for the pair address, so LP tokens minted to the pair left debts uninitialised.
Seen in 1 report
-
The transfer hook updated user rewards but not the global reward accumulator before balances changed.
Seen in 1 report
-
The transfer hook used pending rewards with the fresh flag off, skipping the global index update.
Seen in 1 report
-
The transfer logic failed to adjust the vault's total supply balance when the recipient was the sponsorship address.
Seen in 1 report
-
The transfer override omitted buy order contracts from the allowed set.
Seen in 1 report
-
The transfer overrides ignored approved addresses, deviating from the token standard.
Seen in 1 report