Skip to content

Commit

Permalink
Refactor deployment script to use determinist address (#22)
Browse files Browse the repository at this point in the history
Co-authored-by: mfw78 <[email protected]>
  • Loading branch information
yvesfracari and mfw78 authored Aug 15, 2024
1 parent c484e39 commit 4800711
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pragma solidity ^0.8.25;

import { Script } from "forge-std/Script.sol";
import { COWShedFactory, COWShed } from "src/COWShedFactory.sol";
import { LibString } from "solady/utils/LibString.sol";
Expand All @@ -8,14 +10,15 @@ contract DeployScript is Script {
bytes32 bNode = vm.ensNamehash(baseEns);

vm.startBroadcast();
COWShed cowshed = new COWShed();
COWShedFactory factory = new COWShedFactory(address(cowshed), bName, bNode);
COWShed cowshed = new COWShed{salt: ""}();
COWShedFactory factory = new COWShedFactory{salt: ""}(address(cowshed), bName, bNode);
bytes memory initCode = vm.getCode("src/COWShedProxy.sol:COWShedProxy");

string memory addrJson = "deploymentAddresses.json";
vm.serializeAddress(addrJson, "factory", address(factory));
vm.serializeBytes(addrJson, "proxyInitCode", initCode);
string memory serialized = vm.serializeAddress(addrJson, "implementation", address(cowshed));
vm.writeJson(serialized, "deploymentAddresses.json");
vm.stopBroadcast();
}
}

0 comments on commit 4800711

Please sign in to comment.