Skip to content

Code4rena

Tracer contest

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

disclosed reports
21
most reported class
Business logic
bug classes found
5
first disclosure
2021
Find Tracer contest on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Tracer contest chose to make public.

Business logic

Wrong keeper reward computation

The keeper reward calculation incorrectly treats a percentage value as a WAD (1e18) value, causing the tip portion of the reward to be divided by 1e18 instead of 100. As a result, keepers receive almost no tip, only their gas cost.

Tracer contest

Medium
Business logic

uncommit sends tokens to the wrong user

The `_uncommit` function in `PoolCommitter` sends tokens to the pool contract itself instead of the commit owner, because it uses `msg.sender` which is the pool. If `_uncommit` is ever triggered, users would lose their committed tokens as they are sent to the pool.

Tracer contest

Medium
Business logic

Deposits don’t work with fee-on transfer tokens

The commit function records the full amount of a deposit, but fee-on-transfer tokens cause fewer tokens to actually arrive, creating an inconsistency between the recorded commitment and the pool's actual balance. An attacker could exploit this to extract value from the protocol.

Tracer contest

Medium
Smart contracts

Use of deprecated Chainlink API

The smart contracts use Chainlink's deprecated latestAnswer() function to fetch price data. If Chainlink stops supporting this deprecated API, the protocol would be unable to obtain prices and would halt, requiring contract redeployment.

Tracer contest

Medium
Business logic

Malicious owner can arbitrarily change fee to any % value

The market owner can change the trading fee to any percentage without emitting an event or enforcing a timelock, so users cannot monitor or react to the change. An attacker could set the fee to 100% and users would only notice after their trades execute, damaging confidence in the market.

Tracer contest

Medium
Access control

Single-step process for critical ownership transfer

The Tracer Perpetuals Factory contract transfers ownership to a governance address in a single step during construction, making the change irreversible. If an incorrect address is used, all onlyOwner functions become permanently inaccessible, forcing redeployment and causing reputational damage.

Tracer contest

Medium
Audit finding

Underflow problems occurring when a token has >18 decimals

The contracts assume all tokens have 18 or fewer decimals, but if a token with more than 18 decimals is used, the scaler computations underflow and produce incorrect values. An attacker could exploit this to manipulate balances or bypass checks, though the report does not detail a concrete attack.

Tracer contest

Medium
Business logic

avoid paying insurance

The insurance funding rate is set to zero when the insurance pool is sufficiently full, allowing an attacker to avoid paying insurance by temporarily filling the pool with a flash loan and triggering a minimal trade. This can be repeated to keep the rate at zero, causing insurance depositors to miss interest payments.

Tracer contest

Medium
Business logic

No check transferFrom() return value

The smart contract does not check the return value of token transfer functions, so a token that returns false instead of reverting could let a user deposit without actually transferring funds.

Tracer contest

Medium
Business logic

Claim liquidation escrow

A liquidator could create a second account and execute a trade between their own accounts with large slippage, then claim the liquidation escrow for that slippage. This allowed them to get reimbursed for slippage they caused themselves.

Tracer contest

Medium
Smart contracts

Add reentrancy protections on function executeTrade

The executeTrade function in the Trader contract can be reentered because it calls an external contract controlled by the user. An attacker could exploit this to reenter critical functions, though the team notes whitelisting may limit the impact.

Tracer contest

Medium
Crypto

Wrong price scale for GasOracle

The GasOracle contract multiplies raw values from two Chainlink oracles without scaling them to a common 18-decimal format, assuming the result is already in 18 decimals. If the oracles use different decimals, the gas price can be heavily inflated or under-reported.

Tracer contest

High
Business logic

Insurance slippage reimbursement can be used to steal insurance fund

The liquidation contract's claimReceipt function does not check for duplicate orders, allowing a liquidator to submit the same bad trade multiple times and receive excessive slippage reimbursement from the insurance fund. An attacker can drain the insurance fund by repeatedly exploiting this.

Tracer contest

High
Business logic

Logic error in fee subtraction

The fee calculation in LibBalances.applyTrade() incorrectly adds the fee to the long position instead of subtracting it from both positions. This causes the contract to believe it can withdraw collected fees, leaving users with an incorrect amount of quote tokens.

Tracer contest

High
Business logic

Use of incorrect index leads to incorrect updation of funding rates

The updateFundingRate function incorrectly calculates the cumulative funding rate by always adding the instant rate to zero instead of the previous cumulative value, due to using the current funding index instead of the previous one. This causes incorrect funding rates and affects account settlement across the protocol, potentially leading to user fund loss and protocol shutdown.

Tracer contest

High
Business logic

Trader orders can be front-run and users can be denied from trading

The Trader contract allows an attacker to front-run a user's trade by matching the user's counter order with their own order, preventing the user's trade from being filled. This griefing attack can deny trading, especially to liquidators trying to avoid liquidation.

Tracer contest

Medium
Misconfiguration

Missing events for critical parameter changing operations by owner

The owner of the TracerPerpetualSwaps contract can change critical parameters such as addresses and values without emitting events. This lack of on-chain logging means off-chain monitors and users cannot detect malicious changes, potentially leading to lost funds and confidence.

Tracer contest

Medium
Business logic

Wrong funding index in settle when no base?

The settle function sets a user's last updated funding index to the current global index when their base position is zero, but a comment and the else branch indicate it should be the previous index. This could let first-time depositors avoid paying the first funding rate period.

Tracer contest

Medium
Business logic

Wrong trading pricing calculations

An agent could manipulate trading prices by creating many tiny orders at arbitrary prices and matching them with another account, which skewed the hourly average price used for funding rates and fair price. This allowed a malicious agent to manipulate the market.

Tracer contest

High
Business logic

Deflationary tokens are not supported

The deposit functions of Insurance and TracerPerpetualSwaps assume that the contract's external ERC20 balance increases by exactly the amount specified in transferFrom, but deflationary tokens charge a fee on each transfer, so the user is credited the full amount without accounting for the tax. An attacker could exploit this to receive more credit than the tokens actually received.

Tracer contest

Medium