Skip to content

Code4rena

Frankencoin

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

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

Disclosed reports

Newest first. Only what Frankencoin chose to make public.

Business logic

CHALLENGER_REWARD can be used to drain reserves and free mint

The challenger reward in the Frankencoin auction is calculated from the position's self-declared price, which the owner can set arbitrarily high. An attacker can open a position with a huge price, immediately challenge and end it, causing the protocol to pay an enormous reward by draining the reserve and minting new ZCHF.

Frankencoin

High
Business logic

Position owners can deny liquidations

A position owner can set the position price to the maximum unsigned integer value, which causes an overflow in the challenge logic so that bids and challenge endings revert. This lets the owner avoid liquidation and leave the challenger's funds stuck.

Frankencoin

High
Business logic

When the challenge is successful, the user can send tokens to the position to avoid the position’s cooldown period being extended

The position's cooldown period is only extended when its collateral balance falls below the minimum after a successful challenge. An attacker can send collateral just before the challenge ends, keeping the balance above the minimum, so the cooldown is not extended and they can immediately mint a large amount of ZCHF at the manipulated price.

Frankencoin

High
DoS

Transfer position ownership to addr(0) to DoS end() challenge

A position owner can transfer ownership to the zero address, causing the challenge end function to revert when it tries to refund the owner. This locks the bidder's funds and the challenger's collateral, preventing the challenge from completing.

Frankencoin

High
Race condition

Challenges can be frontrun with de-leveraging to cause lossses for challengers

A position owner can front-run a challenge by repaying the debt and setting the position price to zero, so the challenger's bid passes the collateral check with almost no value and the owner can then back-run with a tiny bid to take the challenger's collateral. This sandwich attack causes challengers to lose their collateral.

Frankencoin

High
Business logic

Manipulation of total share amount might cause future depositors to lose their assets

The share calculation in the Equity contract mints a fixed number of shares when total shares are below 1000e18, but shares can be burned below that threshold, so a depositor can receive only 1 share for a large deposit. An attacker can repeatedly redeem small amounts to keep total shares below the threshold, causing future depositors to lose most of their deposited Frankencoin.

Frankencoin

Medium
DoS

Need alternative ways for fund transfer in end() to prevent DoS

The end() function in MintingHub.sol performs multiple token transfers in one call, so if any single transfer reverts (for example, a zero-amount transfer on a token that rejects it, or a transfer to the zero address), the entire end() call fails and all funds remain locked. An attacker could exploit this to temporarily or permanently lock challengers' collateral and bidders' funds.

Frankencoin

Medium
Business logic

No slippage control when minting and redeeming FPS

The Equity contract allows minting and redeeming FPS without any slippage control, so the price changes with the ZCHF reserve. An attacker can sandwich a user's transaction to profit at the user's expense.

Frankencoin

Medium
Business logic

Can’t pause or remove a minter

The system allows token holders to suggest new minters but provides no mechanism to remove or pause a registered minter after a 10-day denial window. An attacker could exploit a buggy minter to break the whole system, affecting all token holders.

Frankencoin

Medium
DoS

initializeClone() price calculation should round up

The price calculation in initializeClone() rounds down, which can cause a revert in checkCollateral() when the division is not exact. An attacker could trigger this revert by providing parameters that cause precision loss, leading to a denial of service for legitimate users.

Frankencoin

Medium
Business logic

Auctions fail to account for network and market conditions

The auction mechanism for challenged positions accepts the highest bid even if it is near zero, so under extreme network congestion or market panic, an attacker could win valuable collateral for almost nothing. The report also notes that without any bids, the protocol treats the collateral as worthless and fails to liquidate.

Frankencoin

Medium
Race condition

notifyLoss can be frontrun by redeem

The notifyLoss function transfers reserve funds out, reducing the value per share. A depositor who has passed the cooldown can frontrun the loss by redeeming before notifyLoss is called, then re-depositing at the lower share price to profit.

Frankencoin

Medium
Smart contracts

Function restructureCapTable() in Equity.sol not functioning as expected

The restructureCapTable function in Equity.sol always reads the first element of the addressesToWipe array inside its loop instead of the current index. As a result only the first address's tokens are burned, and the call reverts once that address has a zero balance while other addresses remain.

Frankencoin

Medium
Business logic

Unable to adjust position in some cases

The adjust function in Position.sol reverts when the new price is higher than the current price and the caller tries to reduce collateral or increase minted amount, because a cooldown is set that blocks those operations. An attacker could not exploit this; it is a usability bug that prevents legitimate position adjustments.

Frankencoin

Medium
Business logic

anchorTime() will not work properly on Optimism due to use of block.number

The contract uses block.number to compute a time anchor, which is unreliable on Optimism because block numbers do not correspond to constant time intervals. This could cause the holding duration for votes to deviate from the intended 90-day minimum, affecting redeem().

Frankencoin

Medium
Smart contracts

POSITION LIMIT COULD BE FULLY REDUCED TO ZERO BY CLONES

A newly opened position's limit could be fully reduced to zero by a cloner, leaving the original owner unable to mint any Frankencoin. This happens because the clone reduction calculation can allocate the entire remaining limit to the cloner.

Frankencoin

Medium
Race condition

Re-org attack in factory

The createClone function deploys a clone contract using create, so the address depends only on the PositionFactory nonce. An attacker could exploit a chain re-org to deploy a clone at the same address where a victim had already sent funds, potentially stealing those funds.

Frankencoin

Medium