ZeframLou / create3-factory

270 stars 36 forks source link

Document factory deployment (with foundry) #3

Open fmnxl opened 2 years ago

fmnxl commented 2 years ago

Document how the CREATE3Factory itself should be deployed on different chains so that it deploys contracts to the same addresses.

e.g. for foundry scripts

function run() public {
  vm.startBroadcast();

  // Keep the same salt across different chains
  CREATE3Factory factory = new CREATE3Factory{salt: "MY_CREATE3_FACTORY"}();

  factory.deploy(...);
  ...

I believe the deployed address of the factory itself matters? Correct me if I'm wrong.