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
Rank: 170/199
Findings: 2
Award: $21.10
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: decade
Also found by: 0x3b, 0xDACA, 0xWaitress, 0xWeiss, 0xkaju, Arz, Aymen0909, BPZ, EloiManuel, HaCk0, J4de, Jerry0x, Jiamin, John, Juntao, Kek, Lalanda, MiloTruck, Mukund, PNS, RedTiger, Ruhum, Satyam_Sharma, ToonVH, Tricko, Udsen, ak1, anodaram, bin2chen, carrotsmuggler, cccz, circlelooper, deadrxsezzz, giovannidisiena, jasonxiale, joestakey, juancito, karanctf, kenta, kodyvim, ladboy233, lil_eth, lukino, markus_ether, marwen, mrpathfindr, nobody2018, parlayan_yildizlar_takimi, peakbolt, ravikiranweb3, rbserver, rvierdiiev, silviaxyz, volodya, zhuXKET, zzebra83
0.0748 USDC - $0.07
https://github.com/code-423n4/2023-04-frankencoin/blob/main/contracts/Equity.sol#L313
Address to wipeout will never be called instead only 0 index address will be called again and again, since the address index will not called ever address will remain their forever and never get deleted.
Equity.restructureCapTable is using only one address to wipeout from addressesToWipe array instead it should use variable i that fetches address for each index under addressesToWipe arrat to wipe out.
https://github.com/code-423n4/2023-04-frankencoin/blob/main/contracts/Equity.sol#L313
address current = addressesToWipe[0];
Use variable i instead hardedcoded index.
#0 - c4-pre-sort
2023-04-20T14:16:32Z
0xA5DF marked the issue as duplicate of #941
#1 - c4-judge
2023-05-18T14:23:23Z
hansfriese marked the issue as satisfactory
🌟 Selected for report: c3phas
Also found by: 0xDACA, 0xRB, 0xSmartContract, 0xhacksmithh, 0xnev, Aymen0909, BenRai, Breeje, DishWasher, Erko, EvanW, JCN, MohammedRizwan, NoamYakov, Polaris_tow, Proxy, Rageur, Raihan, RaymondFam, ReyAdmirado, SAAJ, Sathish9098, Satyam_Sharma, Udsen, __141345__, aria, codeslide, decade, fatherOfBlocks, hunter_w3b, karanctf, matrix_0wl, nadin, naman1778, niser93, pavankv, petrichor, pfapostol, sebghatullah, slvDev, trysam2003, xmxanuel
21.0255 USDC - $21.03
under bid function expectedSize should be used instead using challenge.size which saves gas , since using challenge.size directly from storage is expensive and since it checks whether expectedSize equals to challenge.size then only it proceeds to the below code therefore we can use expectedSize instead challenge.size.
https://github.com/code-423n4/2023-04-frankencoin/blob/main/contracts/MintingHub.sol#L208-L212
if (challenge.position.tryAvertChallenge(challenge.size, _bidAmountZCHF)) {//@audit using expectedSize instead challenge.size save us gas // bid was high enough, let bidder buy collateral from challenger zchf.transferFrom(msg.sender, challenge.challenger, _bidAmountZCHF); challenge.position.collateral().transfer(msg.sender, challenge.size);//@audit using expectedSize instead challenge.size save us gas emit ChallengeAverted(address(challenge.position), _challengeNumber); delete challenges[_challengeNumber];
Under frankencoin.suggestMinter totalsupply() is checked two times, which can be expensive as Every time totalSupply() is called, it requires a read operation from the blockchain state which consumes gas.
https://github.com/code-423n4/2023-04-frankencoin/blob/main/contracts/Frankencoin.sol#L84-L85
if (_applicationPeriod < MIN_APPLICATION_PERIOD && totalSupply() > 0) revert PeriodTooShort(); if (_applicationFee < MIN_FEE && totalSupply() > 0) revert FeeTooLow();
Check under one condition is sufficient since is uses && operator which only proceeds the code further if both the conditions are right.
#0 - c4-judge
2023-05-16T13:32:31Z
hansfriese marked the issue as grade-b