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 contract uses a fixed BTC-to-token ratio rather than a live price feed.
Seen in 1 report
-
The contract uses a zero last bid to detect a gifted NFT, but an earlier bid makes it non-zero.
-
The contract uses its current token balance to calculate rewards without initializing the last reward timestamp.
Seen in 1 report
-
The contract uses its own address as the referral argument instead of a separate account, so the referral is invalid.
Seen in 1 report
-
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
-
The contract uses safeTransferFrom from its own balance without approving itself.
-
The contract uses safeTransferFrom with the requested amount instead of transferShares, ignoring Lido's one or two wei rounding behaviour.
Seen in 1 report
-
The contract uses the current block timestamp as the deadline instead of a user-supplied value.
Seen in 1 report
-
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
-
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
-
The contract uses the standard transfer interface that assumes a boolean return, which reverts for tokens that return nothing.
Seen in 1 report
-
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.
-
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
-
The contract's own address is used instead of the caller's address when populating the sender field of the transaction record.
-
The contracts assume all meta pool tokens have 18 decimals and sum amounts without normalising.
Seen in 1 report
-
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
-
The controller assumed claimFees always results in WETH being received without checking the balance.
Seen in 1 report
-
The controller assumed tokens with a zero minimum would not be received, but Curve always transfers all underlying tokens.
-
The controller infers reward claiming from the function signature rather than decoding the actual boolean argument.
Seen in 1 report
-
The controller inspects only the first token in the batch swap path rather than using the returned asset deltas.
Seen in 1 report
-
The controller only accounts for the final token in a batch swap, ignoring intermediate tokens returned to the user.
Seen in 1 report
-
The controller used its own immutable treasury address instead of querying the vault's treasury address.
Seen in 1 report
-
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
-
The conversion divided a USDV amount by the USDV price instead of using the VADER price.
Seen in 1 report
-
The conversion divides by a hardcoded factor instead of reading the token's decimals.
-
The conversion functions add one to cached totals that already include a plus one from the settle preview.
-
The conversion included tokens pending undelegation whose shares had already been burned.
-
The conversion marked the merkle proof as used even when the transferred amount was zero.
-
The conversion multiplied the settlement and trade fee percentages instead of subtracting both fees from the deposit.
-
The conversion multiplies by the multiplier but omits division by the basis points constant.
Seen in 1 report
-
The conversion routine stores a slice-relative index as an absolute cursor and prefix validation only checks the final span element.
-
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
-
The cooldown check uses less-than-or-equal instead of strict less-than.
Seen in 1 report
-
The cooldown end time for a user-validator slot was overwritten on each unstake instead of tracking each unstake separately.
-
The cooldown end time is recomputed from the mutable global interval instead of preserving the interval stored when unstaking began.
Seen in 1 report
-
The cooldown used a timestamp comparison while reward accounting used an epoch counter that could lag behind the timestamp.
Seen in 1 report
-
The cooldown was only extended when the post-withdrawal collateral fell below the minimum.
-
The counter is incremented only on a user's first deposit but decremented on every withdrawal that empties the deposit.
-
The counter was decremented without checking whether the token was previously allowed.
Seen in 1 report
-
The coupon code input field lacked rate limiting, allowing brute-force guessing of valid codes.
Seen in 1 report
-
The coupon verification endpoint trusted a client-supplied discount value instead of calculating the discount server-side.
Seen in 1 report
-
The courier is only set when the user's share balance is zero, so any existing shares prevent assignment.
Seen in 1 report
-
The create fee discount state variable has no setter and defaults to zero.
Seen in 1 report
-
The create function did not require the collateral token to be the zero address when ETH was sent.
Seen in 1 report
-
The create function stored the caller-supplied duration without validating it against the allowed minimum and maximum.
Seen in 1 report
-
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
-
The create_deposit endpoint did not verify that submitted scripts matched the scripts in the referenced Bitcoin transaction.
-
The creation function wrote to the deployed markets slot without checking it was empty.
Seen in 1 report
-
The creation timestamp is only updated when duration changes, but tax is always calculated for the full duration.
Seen in 1 report
-
The creator can change the sell royalty at any time with no delay, and it applies to existing shares.
Seen in 1 report