code-423n4 / 2021-11-malt-findings

0 stars 0 forks source link

ERC20 import #364

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

pauliax

Vulnerability details

Impact

You don't need to import the implementation to interact with the contract, you can import only an interface, e.g. here:

 ERC20 public collateralToken;

Consider replacing ERC20 with IERC20 to reduce deployment costs.

0xScotch commented 2 years ago

242

GalloDaSballo commented 2 years ago

This is not a duplicate of #242, whereas 242 is about Best Practices, this finding is saying that using ERC20 instead of IERC20 will increase the cost of the deployment.

I believe the optimizer will make the bytecode the same, but will mark this finding as valid because IERC20 would guarantee less work