code-423n4 / 2021-09-defiprotocol-findings

1 stars 0 forks source link

External visibility should be preferred #77

Closed code423n4 closed 2 years ago

code423n4 commented 3 years ago

Handle

WatchPug

Vulnerability details

Functions that are never called throughout the contract should be marked as external visibility instead of public visibility to avoid the unnecessary copying of data to memory.

This will effectively result in Gas Optimization.

Therefore, the following function must be marked as external:

Factory.sol

Basket.sol

Auction.sol

Recommended Mitigation Steps

The above-mentioned functions should be assigned external visibility, and the parameter storage location should be set as calldata rather than memory.

GalloDaSballo commented 2 years ago

Duplicate of #240