Platform: Code4rena
Start Date: 09/11/2021
Pot Size: $30,000 ETH
Total HM: 6
Participants: 17
Period: 3 days
Judge: pauliax
Total Solo HM: 3
Id: 50
League: ETH
Rank: 11/17
Findings: 2
Award: $180.85
🌟 Selected for report: 1
🚀 Solo Findings: 0
pants
These files has open TODOs:
ABC.sol
FSDNetwork.sol
Open TODOs can hint at programming or architectural errors that still need to be fixed.
Manual code review.
Resolve these TODOs and bubble up the errors.
#0 - YunChe404
2021-11-14T16:15:30Z
The TODO
comment in FSDNetwork.sol
appears to be a left-over.
#1 - pauliax
2021-11-17T15:02:15Z
A duplicate of #41
🌟 Selected for report: ye0lde
Also found by: WatchPug, elprofesor, pants
pants
Shortening revert strings to fit in 32 bytes will decrease deployment time gas and will decrease runtime gas when the revert condition has been met.
For example line 146, 150 of FairSideConviction.sol
look at https://github.com/code-423n4/2021-09-sushimiso-findings/issues/134
#0 - pauliax
2021-11-16T21:50:13Z
A duplicate of #43
pants
At FairSideDAO.sol lines 344, 508, 552 and TributeAccural.sol lines 83, 86 you use i++ instead of ++i to increase the loop index.
++i is more gas efficient and this improves every iteration and save gas. This is a relatively small and important change that we recommend to apply.
#0 - pauliax
2021-11-16T22:38:56Z
A duplicate of #89
0.007 ETH - $33.11
pants
At getActions - FairSideDAO.sol lines 272 you return using both named return and actual return statement. To save gas and improve code quality consider using only one of those.
function getActions(uint256 proposalId) public view returns ( address[] memory targets, uint256[] memory values, string[] memory signatures, bytes[] memory calldatas ) { Proposal storage p = proposals[proposalId]; return (p.targets, p.values, p.signatures, p.calldatas); }
#0 - pauliax
2021-11-16T23:03:26Z
Valid optimization. #40 mentions one more place where this suggestion can be applied.
pants
The following functions could be set external instead of public to save gas. FairSideDao.sol function cancel FairSideDao.sol function execute FairSideDao.sol function queue Migrations.sol function setCompleted
external
functions are cheaper than public
functions.
https://gus-tavo-guim.medium.com/public-vs-external-functions-in-solidity-b46bcf0ba3ac
Manual code review.
Define those functions as external
.
#0 - YunChe404
2021-11-14T16:06:40Z
Please remove any references to Migration.sol
.
#1 - pauliax
2021-11-17T10:29:07Z
A duplicate of #88