Fractional v2 contest - pedr02b2's results

A collective ownership platform for NFTs on Ethereum.

General Information

Platform: Code4rena

Start Date: 07/07/2022

Pot Size: $75,000 USDC

Total HM: 32

Participants: 141

Period: 7 days

Judge: HardlyDifficult

Total Solo HM: 4

Id: 144

League: ETH

Fractional

Findings Distribution

Researcher Performance

Rank: 85/141

Findings: 2

Award: $99.41

🌟 Selected for report: 0

🚀 Solo Findings: 0

Open comments within source files

MerkleBase.sol lines 24-25 have the devs TODO comments left in the file, advisory to remove these types of comments before deployment

assembly { // TODO: This can be aesthetically simplified with a switch. Not sure it will // save much gas but there are other optimizations to be had in here. if or(lt(_left, _right), eq(_left, _right)) { mstore(0x0, _left) mstore(0x20, _right) } if gt(_left, _right) { mstore(0x0, _right) mstore(0x20, _left) } data := keccak256(0x0, 0x40) } }

https://github.com/code-423n4/2022-07-fractional/blob/8f2697ae727c60c93ea47276f8fa128369abfe51/src/utils/MerkleBase.sol#L24 https://github.com/code-423n4/2022-07-fractional/blob/8f2697ae727c60c93ea47276f8fa128369abfe51/src/utils/MerkleBase.sol#L25

Gas Optimisations

Use ++i instead of i++

In Vault.sol use ++i instead of i++ as has been employed in merklebase.sol and multicall.sol iterations. Each iteration costs up to 5 gas. ++i costs less gas compared to i++ or i += 1 for unsigned integers. This is because the pre-increment operation is cheaper (about 5 GAS per iteration).

https://github.com/code-423n4/2022-07-fractional/blob/8f2697ae727c60c93ea47276f8fa128369abfe51/src/Vault.sol#L78

https://github.com/code-423n4/2022-07-fractional/blob/8f2697ae727c60c93ea47276f8fa128369abfe51/src/Vault.sol#L104

Use custom errors instead of revert strings

In MerkleBase.sol use custom errors instead of using revert strings, Custom errors reduce the cost to deploy and call a function on a contract. Errors also provide parameterization which gives the error much more context of the reasons why the error occurred and sometimes what to do to mitigate the error code.

https://github.com/code-423n4/2022-07-fractional/blob/8f2697ae727c60c93ea47276f8fa128369abfe51/src/utils/MerkleBase.sol#L62

https://github.com/code-423n4/2022-07-fractional/blob/8f2697ae727c60c93ea47276f8fa128369abfe51/src/utils/MerkleBase.sol#L78

FERC1155.sol

https://github.com/code-423n4/2022-07-fractional/blob/8f2697ae727c60c93ea47276f8fa128369abfe51/src/FERC1155.sol#L267

https://github.com/code-423n4/2022-07-fractional/blob/8f2697ae727c60c93ea47276f8fa128369abfe51/src/FERC1155.sol#L285

https://github.com/code-423n4/2022-07-fractional/blob/8f2697ae727c60c93ea47276f8fa128369abfe51/src/FERC1155.sol#L297

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