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

Use of SafeERC20 for known tokens used extra gas unnecessarily #7

Open
code423n4 opened this issue Nov 9, 2021 · 0 comments
Open
Labels
bug Something isn't working G (Gas Optimization) sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons USDV Vader

Comments

@code423n4
Copy link
Contributor

Handle

TomFrench

Vulnerability details

Impact

Increased gas costs

Proof of Concept

In a number of places we use the SafeERC20 library to transfer tokens which are fixed to a known implementation e.g Vader in the Converter.

https://github.com/code-423n4/2021-11-vader/blob/3a43059e33d549f03b021d6b417b7eeba66cf62e/contracts/tokens/converter/Converter.sol#L124

If we know that these tokens are properly implemented then we can do away with the extra cost from SafeERC20 and only use it when interacting with unknown tokens.

Recommended Mitigation Steps

Remove use of SafeERC20 for known good tokens.

@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Nov 9, 2021
code423n4 added a commit that referenced this issue Nov 9, 2021
@SamSteinGG SamSteinGG added the sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons label Nov 27, 2021
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) sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons USDV Vader
Projects
None yet
Development

No branches or pull requests

3 participants