Submodule Structure for Forks
Currently, the contracts monorepo doesn't contain contracts which have been forked from upstream repositories (e.g. https://github.com/immutable/wallet-contracts and https://github.com/immutable/seaport). This is to enable us to merge with any future upstream changes in the parent repositories. These contracts are stored separately and published to different npm packages e.g. @imtbl/wallet-contracts, most of which are difficult for developers to discover. This introduces a number of challenges for integrating developers, who expect to find these contracts in @imtbl/contracts. Additionally, this makes it more challenging for us to maintain a clear record of the latest versions of all Immutable contracts, and to monitor all contract changes in one place (the general goals of the monorepo)
Goals:
- Allow integrating developers to reference forked contracts directly, e.g.
Seaportcan be imported as@imtbl/contracts/seaport/Seaport.sol,Factorycan be imported as@imtbl/contracts/passport/Factory.sol. - Allow developers to inspect the latest code of the Immutable contracts they are integrating with
- Allow us to continue to merge with upstream in these forked repositories
Solution:
- Create a
forksdirectory with git submodules for all forked repositories - Create a
forks.jsonwhich is interpreted byscripts/build.ts(run viayarn build) to define how these forks should be incorporated into the main codebase - All smart contracts are copied out of the fork repos and into the primary codebase (along with their dependencies), e.g.
forks/seaport/contracts-->contracts/seaport - In future, developers will be able to update the git submodule, update
forks.jsonif necessary, then runyarn.buildto commit the new structure to git - Decision taken to include the copied contracts in git to allow people browsing the repository to discover them easily
Submodule Structure for Forks
Generated at commit: feb982483c34f73fd3def6a73cca3d94e23a8c33
🚨 Report Summary
| Severity Level | Results | |
|---|---|---|
| Contracts | Critical High Medium Low Note Total | 1 1 0 14 35 51 |
| Dependencies | Critical High Medium Low Note Total | 0 0 0 0 0 0 |
For more details view the full report in OpenZeppelin Code Inspector
@alex-connolly , this PR has interesting ideas. However, this PR is stale. Are you still actively working on this? Should this PR be abandoned? My suggestion is that the branch stay open, but the PR is closed. In this way, we have the option to come back to this at a later point if we decide that this capability is adequately useful to dedicate effort to.