Contract Deploy - Check for exact path segment when extracting contract path in artifacts #643
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Error
I ran into some problems when importing the open-zepline ERC721 contract.
![image](https://private-user-images.githubusercontent.com/13890618/287552898-f86eb50c-d9fa-4410-ad08-17644a78cd08.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUzNDcwNTEsIm5iZiI6MTcyNTM0Njc1MSwicGF0aCI6Ii8xMzg5MDYxOC8yODc1NTI4OTgtZjg2ZWI1MGMtZDlmYS00NDEwLWFkMDgtMTc2NDRhNzhjZDA4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTAzVDA2NTkxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE5NTgyOTE2NmEzZTYzYTc4YzIwNzFkNTI5OTA5M2VlZWQ1MmVmM2MyZDMxMTc5N2ZhMTE1YWQxZDMwNjhjMmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.q47lhf09h8O2eBwDKCrIdmlUGnIK3wS5sCmwVv6Q0zQ)
Trying to import this:
Having this error when deploying at the moment it runs the 99_generateTsAbis.ts script:
![image](https://private-user-images.githubusercontent.com/13890618/287552834-c069844e-7291-4029-9419-7a994cd82535.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUzNDcwNTEsIm5iZiI6MTcyNTM0Njc1MSwicGF0aCI6Ii8xMzg5MDYxOC8yODc1NTI4MzQtYzA2OTg0NGUtNzI5MS00MDI5LTk0MTktN2E5OTRjZDgyNTM1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTAzVDA2NTkxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlmMTdlZDEwOTRiZDY4MGJlYjY5M2ZhY2RiMDIxOTUwNmU2NTE2N2UyYzFiYmIwNTk5YzcxNDI3ODEwNmNhN2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.i8T7a982wDqxUz0dL67Oo1oEEEUbp6VfWjoOdx2PuJo)
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