Creating a shared repository and establish a library of EVM precompiled contracts

Background

Hey everyone!
I know a lot of parachains are using the EVM pallet and introducing custom precompiled contracts that interact with their pallets, either custom or those that are part of Substrate FRAME. And in the case of the latter, I see that most projects share a similar logic (XC20 by Moonbeam, for example), but there is no central location for us to reference the list of precompiled contracts for standard pallets.

This became an issue when we considered working on EVM precompiled for the batch function in the utility pallet. But we noticed that Moonbeam already had an implementation of this. However, we worry that if we use Moonbeam’s implementation and later find an unknown security issue, our chain will have to rely on Moonbeam, or we will have to fork their implementation and fix it. This is also not to mention that the communication will only happen between Astar and Moonbeam in this case. I feel like this will make the ecosystem more closed, and it is difficult for new or small projects to know what is already available and what issues are happening.

Proposal

I was thinking maybe we can create something similar to the ink chain extension registry repo (GitHub - paritytech/chainextension-registry: Registry of ChainExtensions for pallet-contracts), but for the EVM pallet precompiled contracts that interact with the standard pallets.

This way, we have a single point of reference for the entire ecosystem to refer to. So new projects will not have to reinvent the wheel, and any security upgrades can be referenced from a single location.
We can make it similar to the ink chain extension registry, where we have a JSON file and a link to the source code with the id (the contract address), or we could make it into a mono-repo-like library or precompiled contracts with direct implementations. I prefer the former for ease of maintenance.

Let me know what others think about this idea.

2 Likes