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

Contract Deploy - Check for exact path segment when extracting contract path in artifacts #643

Conversation

Corantin
Copy link
Contributor

@Corantin Corantin commented Dec 3, 2023

Description

Error

I ran into some problems when importing the open-zepline ERC721 contract.
Trying to import this:
image

Having this error when deploying at the moment it runs the 99_generateTsAbis.ts script:
image

Explication:

In these lines, it tried to look for ERC721 in available entries (sources), however, it found IERC721 before the actual ERC721.
So he resolved with the path of IERC721 instead.

Fix

Looking for the exact path segment using '/' as prefix for includes argument did the job:
E.g. Looking for /ERC721 in
[
"@openzeppelin/contracts/interfaces/IERC721.sol",
"@openzeppelin/contracts/token/ERC721.sol"
]

Only the second entry matched this time (expected one).

Additional Information

Your ENS/address: Gossman.eth

@Corantin Corantin changed the title Check for exact path segment Contract Deploy - Check for exact path segment when extracting contract path in artifacts Dec 3, 2023
@carletex
Copy link
Member

carletex commented Dec 4, 2023

Thanks for reporting this @Corantin!!

Weird that this hasn't happened before! In my case ERC721.sol seems to always be before IERC721.sol, but it's not something we can rely on.

@technophile-04
Copy link
Collaborator

Weird that this hasn't happened before! In my case ERC721.sol seems to always be before IERC721.sol, but it's not something we can rely on.

++, and also same for me ERC721 appears before IERC721

but Tysm @Corantin for reporting and tackling it, the solution looks fine to me 🙌

@technophile-04 technophile-04 merged commit 53e2082 into scaffold-eth:main Dec 4, 2023
1 check passed
@Corantin
Copy link
Contributor Author

Corantin commented Dec 4, 2023

Weird that this hasn't happened before! In my case ERC721.sol seems to always be before IERC721.sol, but it's not something we can rely on.

++, and also same for me ERC721 appears before IERC721

but Tysm @Corantin for reporting and tackling it, the solution looks fine to me 🙌

No problem, happy to have 1 line for this repo. Congrats for the amazing job <3

@Corantin Corantin deleted the fix/error-while-resolving-path-for-library branch December 5, 2023 00:11
@github-actions github-actions bot mentioned this pull request Dec 8, 2023
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.

None yet

3 participants