Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(forge): clone verified contracts as a foundry project (#7576)
* feat:support forge clone * feat: update configuration based on metadate from EtherScan 👷 * doc: update the documenation for * add dump_sources function * fix: add existing remapping into remappings.txt * apply remapping on libraries * add tests * feat: update remappings in config file * add two more test cases * fix library remapping bug * test: add e2e test cases for forge clone * test: fix rate limit issue for forge clone tests * feat: disable git by default for forge clone * dump clone.toml metadata in cloned projects * add storage layout to the clone metadata * dump clone metadata in a hidden, readonly, compact json file * add constructor arguments in clone metadata * fix: typo field name * fix: bug in remapping * fix: remapping disorder for verified foundry contracts * fix clippy and fmt warnings * fmt in the foundry way * chore: restore files to be consistent with foundry fmt style * cherry pick bug fixes from tweak branch * fix: remove the dependency of Etherscan in tests * chore: move mockall to dev dependency, only mock in test build * feat: use camelCase in .clone.meta * doc: add comments to explain forge clone * fix: import file not found error * chore: remove uncessary dependency fix: fix a foundry config bug regarding generating project_paths * chore: refactor the test code a bit * Update crates/forge/bin/cmd/clone.rs Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com> * Update crates/forge/bin/cmd/clone.rs Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com> * chore: change string as address in CloneArg * test: add one basic forgetest for clone * feat: dump remappings into remappings.txt by default chore: break a large function into multiple small one to improve readability * feat: improve UX and make --quiet true quiet * test: add one more forgetest! for clone * fix minor issues suggested in code review * fix: incorrect assertion for project paths * test: add default etherscan api keys and remove sleep in tests * test: add more etherscan api keys * fix: revoke the unnecessary changes in config.rs * feat: bump foundry-compilers to 0.3.16 * chore: refactor code and clean some comments * fix: path disorder on windows * touchups --------- Co-authored-by: Zhuo Zhang <zhan3299@purdue.edu> Co-authored-by: Zhuo Zhang <14835483+ZhangZhuoSJTU@users.noreply.github.com> Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
- Loading branch information