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

Refactor: Replace deprecated Address.isContract() with dest_.code.length > 0 #743

Closed
wants to merge 1 commit into from

Conversation

0xScratch
Copy link
Contributor

While working on the Good Samaritan challenge, I encountered an error in Visual Studio Code indicating that the .isContract() function is no longer available in the Address library.

Screenshot 2024-07-15 143548

Found this pull request in the OpenZeppelin repository, which details the removal of the .isContract() function. The recommended approach is to use address(...).code.length > 0 instead...

Thanks!

…gth > 0

Updated the transfer function in Coin contract to use dest_.code.length > 0 instead of Address.isContract() as the latter is deprecated in OpenZeppelin.
@GianfrancoBazzani
Copy link
Member

Hey @0xScratch , you are right. Nonetheless, this level currently uses OpenZeppelin contracts fixed at version 4.7.3, where the isContract method is still available.

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.

2 participants