feat(contracts): Refactor dependency routing to ensure seamless usability from importer contract repos #1163
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.
Why are these changes needed?
To Ensures contracts can be publicly hosted in a way that's cross compatible with foundry and hardhat projects when imported. Currently this was tested/validating using nitro-contracts. Also to Introduce some level of release mgmt to our contracts.
Changes
remappings.txt
to not alias submodule dependencieseigenlayer-middleware
importing@open-zeppelin/ERC20
)test-contracts
CItest-contracts
CI job to install JS/yarn dependencies as prequisite before running testsFollow up todo(s):
Methodology
Played around with hosting the contracts via npm directly from the monorepo. The main issue that was causing dependency conflicts in rollup contract repos that utilize hybrid foundry x hardhat was that foundry uses a
remapping.txt
to provide shortcut aliasing for dependency contract paths. Hardhat doesn't acknowledge this however unless you use the hardhat x foundry plugin which requires careful re-articulation of each rollup contract repo's yarn dependency graph. This isn't particular pretty but it does remove the need to manually manage https://github.com/Layr-Labs/eigenda-utils/ while providing some level of version management for our contracts. Opening for discussion if this is something we'd wanna pursue and if so will continue to clean up. We should ideally be cutting release for our contracts in-accordance to when we perform on-chain upgrades or make key updates to the verification utils / blob verifier. The new npm library can be found here with reference usage here innitro-contracts
.Checks