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

Deprecated safeApprove detector #1552

Closed
wants to merge 6 commits into from

Conversation

aviggiano
Copy link

@aviggiano aviggiano commented Jan 5, 2023

Description

This pull request creates a new detector for deprecated safeApprove usage.

Motivation

Although safeApprove has been deprecated, many projects still use the SafeERC extension with that function, instead of using the recommended safeIncreaseAllowance and safeDecreaseAllowance, as we can see on reference issues from Code4rena findings on the OpenZeppelin tread.

@CLAassistant
Copy link

CLAassistant commented Jan 5, 2023

CLA assistant check
All committers have signed the CLA.

@0xalpharush
Copy link
Contributor

We're working to identify OpenZeppelin libs by their hash. Perhaps when that is done we can match on the hash, too, so that we don't have false positives

@0xalpharush
Copy link
Contributor

0xalpharush commented Feb 14, 2023

I think we should build a tool like #1598 to check for outdated dependencies or deprecated functions instead of implementing a detector for each one. This is a really good idea and a direction we should work towards @aviggiano!

@aviggiano
Copy link
Author

By the way @0xalpharush, I was also thinking about creating a detector for ChainLink's deprecated APIs, as many projects fall into that trap. See here

code-423n4/2021-06-gro-findings#106

Could we use the same method for those too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants