Skip to content

Code4rena

prePO contest

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

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

Disclosed reports

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

Business logic

A whale user is able to cause freeze of funds of other users by bypassing withdraw limit

The withdraw limit in the WithdrawHook contract could be bypassed by the first withdrawal in each period because the reset branch did not enforce the limit. A large user could withdraw the entire collateral reserve, leaving other users unable to withdraw their funds until the contract was replenished.

prePO contest

High
Business logic

Bypass userWithdrawLimitPerPeriod check

The per-account withdrawal limit could be bypassed by transferring the token balance to a second account, which then had its own fresh limit. An attacker could therefore withdraw more than the intended maximum in a single period.

prePO contest

Medium
Access control

PrePO NFT holders will not be able to redeem collateral

The redeem function in PrePOMarket checks an account list that only includes certain users, so NFT holders who deposited funds cannot redeem their collateral and withdraw profits. This could lead to a loss of funds for those users.

prePO contest

Medium
Access control

Frontrunning for unallowed minting of Short and Long tokens

The mint function of PrePOMarket allowed anyone to mint Short and Long tokens until the governance set a mint hook. An attacker could front-run the setMintHook transaction to mint tokens before access control was enforced.

prePO contest

Medium
Business logic

PrePOMarket.setFinalLongPayout() shouldn’t be called twice.

The contract's setFinalLongPayout function could be called more than once, letting an admin change the final payout after users had already redeemed tokens. If the payout was lowered after some redemptions, the market could hold too little collateral to pay remaining token holders.

prePO contest

Medium
Business logic

griefing / blocking / delaying users to withdraw

The WithdrawHook contract resets the per-user withdrawal limit only for the first user to interact in a new epoch, leaving other users' limits unchanged. A user who has reached their limit in a previous epoch must be the first to withdraw in the next epoch or wait another full epoch, causing a delay in accessing funds.

prePO contest

High
Race condition

TokenShop: purchase function should add _purchasePrices parameter

The TokenShop purchase function read the NFT price from storage at execution time, so an owner price change mined ahead of a user's purchase could make the user pay more than expected. An attacker (the owner) could front-run a purchase in the same block and force the buyer to pay the higher price.

prePO contest

Medium
Smart contracts

Token transfers do not verify that the tokens were successfully transferred

The smart contracts call ERC20 transfer and transferFrom without checking the boolean return value, so tokens that signal failure by returning false instead of reverting are treated as a successful payment. An attacker using such a token could buy sale tokens or NFTs without spending anything, and a user claiming vested tokens could lose them.

prePO contest

Medium
Smart contracts

No storage gap for upgradeable contracts

The upgradeable abstract contracts SafeAccessControlEnumerableUpgradeable and SafeOwnableUpgradeable lack a storage gap, so if they later add new variables, those variables could overwrite storage in inheriting contracts. An attacker could not directly exploit this, but it could cause storage collisions and unexpected behaviour in upgraded contracts.

prePO contest

Medium
Access control

SafeAccessControlEnumerableCaller and SafeOwnableCaller contracts lack access control

Two abstract helper contracts exposed privileged write functions without any access control, relying on inheriting contracts to override them. If an inheriting contract failed to override every write function, anyone could call the unoverridden privileged functions on the deployed contract.

prePO contest

Medium
Smart contracts

First depositor can break minting of shares

The first depositor can inflate the share price by making a large donation to the strategy controller, causing subsequent depositors to receive zero shares for their deposits. This allows the attacker to steal the deposits of later users.

prePO contest

High
Business logic

Withdrawal delay can be circumvented

The withdrawal delay in the Collateral contract can be bypassed because tokens can still be transferred after initiating a withdrawal. An attacker can use multiple accounts to always have one account in a valid withdrawal window, allowing them to withdraw funds at any time, even immediately after purchase.

prePO contest

High
Business logic

Market expiry behaviour differs in implementation and documentation

The documentation stated that an unsettled market would automatically settle at the lower bound of its valuation range after expiry, but the smart contract ignored the expiry date and settled at a 1:1 ratio. Users who relied on the documentation could make trades expecting a different settlement, leading to unexpected swap fees and potential losses.

prePO contest

Medium
Business logic

getSharesForAmount returns wrong value when totalAssets == 0

The getSharesForAmount function returns zero when totalAssets is zero, but the deposit function mints shares equal to the deposit amount when totalSupply is zero. Contracts or frontends using this function to estimate deposits will get an incorrect value.

prePO contest

Medium
Business logic

Wrong formula of getSharesForAmount() can potentially cause fund loss when being used to calculate the shares to be used in withdraw()

The getter functions getAmountForShares() and getSharesForAmount() use totalAssets(), which includes the contract's base token balance, instead of the strategy controller's total value. An attacker using these functions to calculate shares for a withdrawal could receive less base token than expected, causing fund loss.

prePO contest

Medium