ethereum-attestation-service / eas-contracts

Ethereum Attestation Service https://attest.org
MIT License
251 stars 78 forks source link

EAS Should deploy to the same address across different chains #60

Closed Chomtana closed 1 year ago

Chomtana commented 1 year ago

I am a developer with Opti.Domains. I am writing to discuss an important matter related to the deployment of EAS across different chains to the same contract address.

Opti.Domains is proud to be among the first organizations to have utilized the new EAS on Optimism Goerli (please see: https://optimism-goerli.easscan.org/ with the address starting at 0x88811). In the course of our work, however, we have observed that the current deployment strategy of the EAS contract across multiple chains may be subject to potential optimization.

As it stands, EAS is currently deployed to different addresses for each chain. Moreover, a more critical case is the deployment on ETH Goerli (goerli:0x1a5650d0ecbca349dd84bafa85790e3e6955eb84) which shares the same address as Optimism (optimism-goerli:0x1a5650d0ecbca349dd84bafa85790e3e6955eb84), but, interestingly, does not appear to have an identical implementation. This discrepancy is impacting the functionality of our Opti.domains smart contracts.

To address these challenges, we propose using the Seaport Immutable Create2 Factory for deploying the EAS contract across different chains, all sharing the same address.

This can be done effectively using the method we've outlined in our guide:

https://github.com/Opti-domains/eas-deployment

For your convenience, please find below a tabulation of successful contract deployments we have achieved:

EAS SchemaRegistry
Optimism Goerli 0x0000000000eF4a4904F35dA8B65D1fB39D451Fbd 0x0000000000b15ee366c4fe5a24c50dda4cda8660
Base Goerli 0x0000000000eF4a4904F35dA8B65D1fB39D451Fbd 0x0000000000b15ee366c4fe5a24c50dda4cda8660
Goerli 0x0000000000eF4a4904F35dA8B65D1fB39D451Fbd 0x0000000000b15ee366c4fe5a24c50dda4cda8660
Sepolia 0x0000000000eF4a4904F35dA8B65D1fB39D451Fbd 0x0000000000b15ee366c4fe5a24c50dda4cda8660

This improved deployment method can offer the following advantages:

  1. EAS can be deployed to the same address across different chains.
  2. The same address will always have the same implementation.
  3. The deployment process can be undertaken by anyone, promoting a more decentralized approach.
  4. This approach is compatible with every OP Stack based chain and nearly every EVM based chain.
  5. A contract address with 10 leading zeros could potentially reduce gas usage.
  6. EAS can be more easily integrated by interoperable protocols as the need to define the EAS contract address on each chain is eliminated.

With the imminent deployment of EAS on the Optimism mainnet following the successful Bedrock merge, we respectfully ask you to consider this method to improve the future performance and compatibility of EAS.

We eagerly look forward to your thoughts and feedback on this matter.

lbeder commented 1 year ago

Hi @Chomtana,

These are all solid suggestions, but we have considered deterministic deployment in the past and decided against it, since we believe that having the same contract addresses on multiple chains causes more user mistakes and accidents and would rather support fetching the correct address via the artifacts of this package and our SDK.

In addition, please note that EAS we haven't been promoting testing EAS on Goerli (but rather on Sepolia and Optimism Goerli, and Base Goerli), and therefore we didn't publish it nor added its deployment artifacts to the package.