cassc / etherscan-contract-crawler

Retrieve verified contracts source code from etherscan
75 stars 24 forks source link

Change `import` to the modified file names #9

Closed thanhtoantnt closed 1 year ago

thanhtoantnt commented 1 year ago

Currently, when a project is crawled, the file name is changed, e.g., 07_09_Zapper.sol. However, the import files are not updated accordingly, e.g., it is still import "openzeppelin-contracts/token/ERC20/extensions/IERC20Metadata.sol";, even the file IERC20Metada.sol is crawled in the repository.

If I remember correctly, this problem does not exist in the older version.

Command to reproduce: python contract_crawler.py --url https://etherscan.io/address/0xD248B30A3207A766d318C7A87F5Cf334A439446D#code and check the import in the files.

cassc commented 1 year ago

The perfix, eg., 07_09_ is added to allow contracts with same file names. You can use the script to fix the imported files to make the solidity project compilable.

thanhtoantnt commented 1 year ago

thank you, @cl2089. I am clear now.