Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERC20 import #364

Open
code423n4 opened this issue Dec 1, 2021 · 2 comments
Open

ERC20 import #364

code423n4 opened this issue Dec 1, 2021 · 2 comments
Labels
bug Something isn't working G (Gas Optimization)

Comments

@code423n4
Copy link
Contributor

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.

@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Dec 1, 2021
code423n4 added a commit that referenced this issue Dec 1, 2021
@0xScotch 0xScotch added the duplicate This issue or pull request already exists label Dec 8, 2021
@0xScotch
Copy link
Collaborator

0xScotch commented Dec 8, 2021

#242

@0xScotch 0xScotch closed this as completed Dec 8, 2021
@GalloDaSballo
Copy link
Collaborator

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

@GalloDaSballo GalloDaSballo removed the duplicate This issue or pull request already exists label Dec 31, 2021
@CloudEllie CloudEllie reopened this Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working G (Gas Optimization)
Projects
None yet
Development

No branches or pull requests

4 participants