prePO contest - Englave's results

Decentralized Exchange for Pre-IPO Stocks & Pre-IDO Tokens.

General Information

Platform: Code4rena

Start Date: 09/12/2022

Pot Size: $36,500 USDC

Total HM: 9

Participants: 69

Period: 3 days

Judge: Picodes

Total Solo HM: 2

Id: 190

League: ETH

prePO

Findings Distribution

Researcher Performance

Rank: 40/69

Findings: 2

Award: $53.17

QA:
grade-b
Gas:
grade-b

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Awards

28.124 USDC - $28.12

Labels

bug
grade-b
QA (Quality Assurance)
sponsor disputed
Q-13

External Links

Highly permissive role access

The owner of PrePOMarket contract can change at any point in time mint and redeem hooks, which could lead to unexpected behavior. The same is applicable for Collateral contract. WithdrawHook can update collateral, depositRecord contracts implementations. DepositHook can update collateral and depositRecord contract implementations. It’s recommended to set the implementations once and not allow further modifications, to keep contract predictability and stability.

Path: ./contract/PrePOMarket.sol; ./contract/Collateral.sol

#0 - c4-judge

2022-12-19T14:17:10Z

Picodes marked the issue as grade-c

#1 - c4-judge

2022-12-19T14:17:21Z

Picodes marked the issue as grade-b

#2 - ramenforbreakfast

2022-12-22T00:18:27Z

This result should be disregarded, it is just a short statement about the high amount of embedded trust in our architecture and should not be considered for assessment.

#3 - c4-sponsor

2022-12-22T00:18:31Z

ramenforbreakfast marked the issue as sponsor disputed

Awards

25.0472 USDC - $25.05

Labels

bug
G (Gas Optimization)
grade-b
sponsor disputed
G-11

External Links

Redundant nonReentrant modifier

nonReentrant modifier could be removed after functions execution order changes to save Gas. PrePOMarket.mint interacts with contracts, owned by the client, except collateral. collateral.transferFrom(msg.sender, address(this), _amount) should be moved to the last line before emit Mint, to prevent potential reentrancy. PrePOMarket.redeem Collateral.managerWithdraw interacts with managerWithdrawHook, owned by the client, so external call to baseToken would cause no problems. Collateral.withdraw interacts with baseToken after state changes, so reentrancy not dangerous. Collateral.deposit interacts with baseToken before state changes, but it’s safe to move this block after _mint and before emit Deposit to prevent any damage from reentrancy:

baseToken.transferFrom(msg.sender, address(this), _amount); if (address(depositHook) != address(0)) { baseToken.approve(address(depositHook), _fee); depositHook.hook(_recipient, _amount, _amountAfterFee); baseToken.approve(address(depositHook), 0); }

#0 - c4-judge

2022-12-19T13:19:25Z

Picodes marked the issue as grade-b

#1 - c4-sponsor

2022-12-22T10:18:37Z

davidprepo marked the issue as sponsor disputed

#2 - ghost

2022-12-22T10:18:56Z

I think we'd rather keep the non reentrancy modifier for readability.

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax Β© 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter