Frankencoin - BPZ's results

A decentralized and fully collateralized stablecoin.

General Information

Platform: Code4rena

Start Date: 12/04/2023

Pot Size: $60,500 USDC

Total HM: 21

Participants: 199

Period: 7 days

Judge: hansfriese

Total Solo HM: 5

Id: 231

League: ETH

Frankencoin

Findings Distribution

Researcher Performance

Rank: 199/199

Findings: 1

Award: $0.07

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2023-04-frankencoin/blob/main/contracts/Equity.sol#L313

Vulnerability details

Not burning tokens from the all the address in a array due to hardcoded value

It's hard coded to the 0th element in the addressesToWipe array in the restructureCapTable function. So it skips burning the tokens from the rest of the address in the array. So the function does not work as expected.

Proof of Concept

309 function restructureCapTable(address[] calldata helpers, address[] calldata addressesToWipe) public { 310 require(zchf.equity() < MINIMUM_EQUITY); 311 checkQualified(msg.sender, helpers); 312 for (uint256 i = 0; i<addressesToWipe.length; i++){ 313 address current = addressesToWipe[0]; 314 _burn(current, balanceOf(current)); 315 } 316 }

https://github.com/code-423n4/2023-04-frankencoin/blob/main/contracts/Equity.sol#L313

Here you can see its hardcorded to 0th element in the for loop(line 313) .

Tools Used

Manual Auditing

313 address current = addressesToWipe[i];

Use i instead of 0 so that its burned tokens from addresses which are in the addressesToWipe array.

#0 - c4-pre-sort

2023-04-20T14:16:50Z

0xA5DF marked the issue as duplicate of #941

#1 - c4-judge

2023-05-18T14:24:33Z

hansfriese marked the issue as satisfactory

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