In-depth lesson · Business logic
Typical fixes
Every point the Business logic reports back under this heading, best-backed first, each with the reports it is seen in.
-
Require the etag and reject approve requests that omit it.
-
Require the native value to be zero when the input token is not ETH.
Seen in 1 report
-
Require verification before an address can be used as the notification email.
-
Reserve the marked profit of open winners in the solvency gates and the LP withdrawal firewall.
-
Reset the fee to zero when the decay period has fully elapsed.
Seen in 1 report
-
Reset the partial hash state when a download switches from parallel to serial.
Seen in 1 report
-
Resolve release downloads to the exact commit rather than the tag name, and clean up releases when a tag is deleted.
-
Restrict when setToProcessGroups can be called so rewards are not locked in at the start of an epoch.
Seen in 1 report
-
Retain or transfer outstanding cancellation charges when an account is deleted.
Seen in 1 report
-
Return a deep copy from the dataCopy precompile instead of the input slice.
Seen in 1 report
-
Return and transfer the actual redeemed amount rather than the requested amount.
Seen in 1 report
-
Return provenance with resolved addresses and refuse owner-fallback on transfer and grant paths.
-
Return the correct decimals in all branches of the price function.
Seen in 1 report
-
Revalidate stored scope_extensions on later launches and silent manifest updates, not only for Isolated Web Apps.
Seen in 1 report
-
Revert when the share removal helper cannot remove all requested shares.
Seen in 1 report
-
Round consistently in the flow-unit delta calculation so repeated small swaps cannot bypass the limit.
-
Sanitise the description before using it as a fallback subject.
Seen in 1 report
-
Save the validated slot's start and end values rather than the raw request parameters, and repeat the check at confirmation.
-
Seed the candidate oracle's accepted prices, basket and accepted-basket flag during rotation so ordering guards apply from the first update.
-
Send claimed rewards to the strategy itself rather than the vault.
Seen in 1 report
-
Set the period start to the end of the current period rather than the start of the next.
Seen in 1 report
-
Settle pending rewards before resetting the last reward index.
-
Show only verified business emails on the collaborator request review page.
-
Stop erasing the New Tab Page override permission from the comparison sets so adding it counts as a privilege increase.
Seen in 1 report
-
Store a per-stake unlock time fixed at deposit instead of reading the current global period.
Seen in 1 report
-
Store a snapshot of the voter's balance at vote time and subtract that snapshot when clearing.
Seen in 1 report
-
Strip whitespace before applying the length-based premium check.
Seen in 1 report
-
Subtract redeemed unstake units from the epoch exit balance in the reset path.
-
Surface the budget quote failure and keep the affordability check active instead of sizing the permit from a null value.
-
Tie the quota to the conversation or a strong token and force shared links into read-only mode for unauthenticated users.
-
Track cumulative withdrawals over time to enforce the intended cap.
Seen in 1 report
-
Track deposits internally instead of using the strategy's raw token balance to determine if it holds no funds.
Seen in 1 report
-
Track how much native value has been accounted for within a transaction.
Seen in 1 report
-
Transfer LP tokens instead of attempting to pay out unavailable WAVAX.
Seen in 1 report
-
Transfer the borrowed ETH to the lender during liquidation.
Seen in 1 report
-
Treat payment as final only after execution or finality, and clear the paid state when the watched transaction is replaced, dropped or fails.
Seen in 1 report
-
Trim and normalise the avatar name before validating it.
Seen in 1 report
-
Medium
-
-
Update reward debt with the trimmed amount actually sent and use the trimmed amount in the greater-than-zero check.
Seen in 1 report
-
Update stake bookkeeping on share transfers or make shares non-transferable.
Seen in 1 report
-
Critical
-
-
Update the last minted timestamp even when total staked is zero.
-
Use a manipulation-resistant oracle such as a TWAP for trade size calculation.
Seen in 1 report
-
Use a strict less-than in the single-block boundary check.
-
Use an assignment instead of a comparison to set the status to false.
Seen in 1 report
-
Use one JSON parser across the gateway and backend, reject duplicate keys, and verify the signature on every event type.
Seen in 1 report
-
Use strict comparison and cast identifiers to integers before comparing.
Seen in 1 report
-
Use the campaign start time as a lower bound when calculating elapsed reward time.
-
Use the fixed 18-decimal scale in the allocation formula.
Seen in 1 report
-
Use the internal reserve balance instead of the contract's actual token balance when minting LP tokens.
-
Use the original expiration period when checking whether a scheduled operation is ready.
-
Use the protocol's L2-aware block number helper for terminal receipts on Arbitrum.