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.
-
A parameter name says underlying while the function and documentation expect debt tokens.
Seen in 1 report
-
A payable receive function exists but there is no rescue or withdrawal path for native ETH, unlike the ERC20 rescue.
Seen in 1 report
-
A payout checkpoint written at the current timestamp rather than the period start, so the period-start snapshot never reflects payouts.
-
A per-asset balance check is used as a global signal that all collateral is exhausted without verifying other assets.
Seen in 1 report
-
A percentage constant representing one hundred was used where the code expected one.
Seen in 1 report
-
A percentage is applied to the remaining pending rewards each time, producing negative compounding instead of distributing a fixed share of the original amount.
Seen in 1 report
-
A phone number was reserved for an account as soon as it was submitted, before verification.
Seen in 1 report
-
A premature optimisation returned an empty sequence for zero length without checking for side effects in the source expression.
Seen in 1 report
-
A price increase set a cooldown that then blocked the collateral and minting changes in the same adjust call.
Seen in 1 report
-
A quoting function updates a persistent temporary-storage counter that the execution path treats as authoritative.
Seen in 1 report
-
A race or confusion between a branch and a tag with the same name in a forked project let the merge request show approved changes while different code merged.
Seen in 1 report
-
A rate-limit 'too soon' response from the claim function is treated as 'nothing owed' instead of settling the already-computed payable amount before the beneficiary is swapped.
Seen in 1 report
-
A read error on the last-frame byte is treated as acceptable and the frame is decoded with the flag set to false.
Seen in 1 report
-
A refactor inlined the settleability check and dropped the explicit zero-expiration exception.
Seen in 1 report
-
A region-specific licensing or metadata flag was used in place of the account's subscription check for download permission.
-
A replacement contract starts its ID counter at zero instead of inheriting the previous contract's counter.
Seen in 1 report
-
A require statement reverts the whole transaction when one token has zero reward instead of skipping it.
Seen in 1 report
-
A require statement used a strict less-than comparison instead of less-than-or-equal, permitting one token beyond the intended maximum.
Seen in 1 report
-
A return inside a loop exits the whole function instead of skipping the invalid iteration.
-
A return statement inside the loop exited the function after removing the first matching DEX instead of continuing.
Seen in 1 report
-
A revert opcode is used instead of returning false in the gas check, undoing the transaction and preventing the failed flag.
Seen in 1 report
-
A rounding error in the matching engine that caused dust-sized offers to execute at a 1:1 rate rather than the market price.
Seen in 1 report
-
A rounding error in the order matching logic that treats very small trade amounts as equal regardless of the specified price.
Seen in 1 report
-
A same-block early return skips refreshing the stored transmuter token balance, so same-block inflows are never recorded.
Seen in 1 report
-
A scaling constant of 9000 was used where 90000 was needed, making the dirty liquidation fee 9 percent of the clean fee instead of 90 percent.
Seen in 1 report
-
A sentinel value represented the cancelled state instead of a dedicated status field, so a valid order could collide with it.
Seen in 1 report
-
A separate owner field is set at mint but the ERC721 transfer hooks are not overridden to update it.
Seen in 1 report
-
A settlement fee computed from minted value rather than compute and storage consumed, with dummy-leaf padding writing permanent nullifiers.
-
A shared internal claim routine that trusts callers to perform the already-claimed check.
Seen in 1 report
-
A signature-based allowance function was callable by anyone and did not bind the signature to a specific caller or transaction.
-
A signed free balance is exposed as an unsigned value, so a negative balance wraps into a huge positive one.
Seen in 1 report
-
A single balance is used for both withdrawable fees and fees that may need to be refunded.
-
A single boolean claim flag was reused for two meanings (bucket paid out and balance rescued) and never cleared, while the withdrawal request credited the same open bucket without checking it.
-
A single constant transaction ID identifies both the live wallet request and a freshly rebuilt UI descriptor, matched by ID alone.
Seen in 1 report
-
A single Curve pool address was hardcoded for the swap, so the contract could not adapt to changing liquidity.
Seen in 1 report
-
A single global disabled flag is used for all trade kinds.
Seen in 1 report
-
A single global timestamp enforced the rebalance interval across all vaults instead of tracking it per vault.
Seen in 1 report
-
A single global timestamp was used for the last reset instead of tracking each user's reset time.
Seen in 1 report
-
A single hardcoded initial mint amount was used for all token markets instead of a per-token value scaled to decimals and price.
Seen in 1 report
-
A single heartbeat variable was reused for two feeds with different intervals.
Seen in 1 report
-
A single last-update timestamp not tied to a period was overwritten when a new period started, losing the data needed for unclaimed rewards.
Seen in 1 report
-
A single LP token was used for both ordinary liquidity and synth debt, so the two claims were not accounted for separately.
Seen in 1 report
-
A single marker is used both for 'metering was missing' and 'the transaction is done with metering', so a cache miss discards a later valid response.
-
A single minimum asset amount decoded from the dex data was reused for every borrower instead of a per-borrower value.
-
A single oracle timeout is assumed for all feeds, and composite collaterals do not override the staleness check.
Seen in 1 report
-
A single order hash per vault is stored, so a new proposal overwrites the hash needed to verify the active listing.
-
A single shared value token was used for every closure, so tokens were fungible across closures.
Seen in 1 report
-
A single-block snapshot of delegation balance determines the multiplier without requiring the balance to be held.
Seen in 1 report
-
A single-collateral invariant is applied to a multi-collateral system where the stablecoin is shared across collateral types.
Seen in 1 report
-
A single-iterator vector erase was used where a range erase was needed, so only one logo was removed instead of truncating the list to two.
Seen in 1 report