Fractional v2 contest - mektigboy'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: 71/141

Findings: 2

Award: $101.04

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Fractional Gas Optimizations

Gas Optimizations

Use a more recent version of Solidity

Every contract file is using an older version of Solidity. Replace it with the latest, 0.8.15.

++i costs less gas than i++, especially when it’s used in for-loops (--i/i-- too)

Recommendation: Replace i++ with ++i in the following instances:

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

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

<array>.length should not be looked up in every loop of a for-loop

Caching the array length outside a loop saves reading it on each iteration, as long as the array's length is not changed during the loop.

Recommendation:

Insead of:

for (uint256 i = 0; i < array.length; ++i) {
    // Invariant: array's length is not changed.
}

Cache the array length outside the for-loop:

uint256 arrayLength = array.length;
for (uint256 i = 0; i < arrayLength; ++i) {
    // Invariant: array's length is not changed.
}

In the following instances:

https://github.com/code-423n4/2022-07-fractional/blob/e2c5a962a94106f9495eb96769d7f60f7d5b14c9/src/modules/protoforms/BaseVault.sol#L64

https://github.com/code-423n4/2022-07-fractional/blob/e2c5a962a94106f9495eb96769d7f60f7d5b14c9/src/modules/protoforms/BaseVault.sol#L83

https://github.com/code-423n4/2022-07-fractional/blob/e2c5a962a94106f9495eb96769d7f60f7d5b14c9/src/modules/protoforms/BaseVault.sol#L107

https://github.com/code-423n4/2022-07-fractional/blob/e2c5a962a94106f9495eb96769d7f60f7d5b14c9/src/modules/protoforms/BaseVault.sol#L130

https://github.com/code-423n4/2022-07-fractional/blob/e2c5a962a94106f9495eb96769d7f60f7d5b14c9/src/modules/protoforms/BaseVault.sol#L132

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