Skip to content

Code4rena

Curves

Every publicly disclosed report for Curves and what kind of bugs they were.

disclosed reports
15
most reported class
Business logic
bug classes found
4
first disclosure
2024
Find Curves on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Curves chose to make public.

Business logic

Theft of holder fees when holderFeePercent was positive and is set to zero

When the holder fee percentage is set to zero, the contract stops updating shareholder balances in the FeeSplitter, so new shareholders can claim fees that were accumulated for previous shareholders. An attacker can buy shares after the fee is zeroed and then claim the victim's unclaimed fees, draining the FeeSplitter.

Curves

Medium
Smart contracts

Unrestricted claiming of fees due to missing balance updates in FeeSplitter

The FeeSplitter contract fails to update a user's fee accumulator when tokens are transferred, so a new account receiving tokens has a zero offset and can claim fees as if it had held the tokens from the start. An attacker could repeatedly transfer the same tokens to fresh accounts and claim fees each time, draining the contract.

Curves

High
DoS

Whitelisted accounts can be forcefully DoSed from buying curveTokens during the presale

A whitelisted account's array of owned token subjects can be inflated by anyone transferring tokens of many different subjects to it, causing a gas error when the account later tries to buy during a presale. This forces the whitelisted user to miss the presale and buy only in the open sale with a different account.

Curves

High
Business logic

Attack to make CurveSubject to be a HoneyPot

The creator of a CurveSubject can set a referral fee receiver contract that rejects incoming payments unless the sender's token balance has increased, so any sell transaction reverts. The creator can then buy tokens cheaply, enable this mode, and later sell their own tokens at a higher price while other users can only buy.

Curves

High
Access control

Unauthorized Access to setCurves Function

The setCurves function in FeeSplitter.sol had no access control, so any user could point the contract at a fake Curves contract. An attacker could then set arbitrary token balances and supplies to inflate their claimable fees and take funds owed to legitimate token holders.

Curves

High
Access control

Malformed equate statement

The onlyOwner and onlyManager modifiers in a Solidity contract only evaluate a condition without enforcing it, so any caller can execute functions meant to be restricted to the owner or managers. An attacker could perform privileged actions such as withdrawing funds or changing critical settings.

Curves

High
Business logic

Withdrawing with amount = 0 will forcefully set name and symbol to default and disable some functions for token subject

The withdraw function in the Curves contract does not check for a zero amount, so anyone can call it with amount 0 to deploy the external ERC20 token with default name and symbol before the token subject does. This permanently prevents the token subject from setting a custom name and symbol or using functions like mint and buyCurvesTokenWithName.

Curves

Medium
Audit finding

Stuck rewards in FeeSplitter contract

The FeeSplitter contract accumulates rewards per token using integer division, which leaves a remainder that no user can ever claim. As a result, a growing amount of ETH becomes permanently stuck in the contract with each buy or sell.

Curves

Medium
Business logic

Selling will be bricked if all other tokens are withdrawn to ERC20 token

The fee splitter's total supply calculation returns zero when every token holder has withdrawn their tokens to the ERC20 contract, so the fee distribution call reverts. This means a remaining holder cannot sell their tokens, effectively locking them out of the sale path.

Curves

Medium
Business logic

Single token purchase restriction on curve creation enables sniping

The price calculation in the Curves contract reverts when a curve subject tries to buy more than one token during initialisation, because of the order of terms in the sum2 expression. This forces the subject to buy only a single token, letting automated sniping bots buy up the rest at a low price before the subject can acquire more.

Curves

Medium
Business logic

onBalanceChange causes previously unclaimed rewards to be cleared

The onBalanceChange function resets a user's fee offset without first crediting the fees they have already earned, so unclaimed rewards are wiped out. An attacker could buy the same token twice and lose the reward from the first purchase.

Curves

Medium