ExocoreNetwork / exocore-contracts

5 stars 5 forks source link

[Feature]: predetermined contract address for `ExocoreGateway` with `CREATE2` deployment #5

Open adu-web3 opened 5 months ago

adu-web3 commented 5 months ago

Description

Currently, ExocoreGatway is deployed in an ordinary manner:

ExocoreGateway exocoreGateway = new ExocoreGateway(endpoint)

And then the address of deployed contract would be registered into Exocore chain native module to be valid sender that forward requests from LayerZero endpoint to native modules. As the contract address of ExocoreGatway needs to be authorized, we'd better have a predetermined address so that we could hardcode it in the genesis of Exocore mainnet and thus no need to register it anymore.

MaxMustermann2 commented 5 months ago

We can use always_use_create_2_factory, like I had mentioned previously. A default factory will need to be deployed and then used. We can set that factory up within the genesis if needed.

adu-web3 commented 5 months ago

Sure, I see some EVM-compatible chains like ethereum L2s have system contracts like multi-call or create2 factory, maybe we could follow the same design and take it as system contract(pure contract with unique and dedicated address)