sherlock-audit / 2024-02-optimism-2024-judging

6 stars 4 forks source link

No need of both `fallback` & `receive` if calldata is not used #239

Closed sherlock-admin2 closed 7 months ago

sherlock-admin2 commented 7 months ago

No need of both fallback & receive if calldata is not used

Low/Info issue submitted by Shield

Summary

No need of both fallback & receive if calldata is not used

Vulnerability Detail

In FaultDisputeGame there are both fallback & receive present and fallback does not take any calldata param as input hence the code size can be reduced by removing either of the two methods

Impact

having a large codesize increases deployment costs

Code Snippet

https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/dispute/FaultDisputeGame.sol#L132-L135

Tool used

Manual Review

Recommendation

removing either the fallback or receive method