@@ -54,7 +54,7 @@ contract DeployFeeDiamond is Script {
5454 * @notice Deploy to a specific network
5555 * @param network Network name for logging
5656 */
57- function deployToNetwork (string memory network ) public returns (address ) {
57+ function deployToNetwork (string memory network , bytes32 create2Salt ) public returns (address ) {
5858 // Get private key from environment variable
5959 uint256 deployerPrivateKey = vm.envUint ("VINCENT_DEPLOYER_PRIVATE_KEY " );
6060 if (deployerPrivateKey == 0 ) {
@@ -71,23 +71,25 @@ contract DeployFeeDiamond is Script {
7171 IDiamondCut.FacetCut[] memory cuts = new IDiamondCut.FacetCut [](6 );
7272
7373 // core diamond lib facets
74- DiamondLoupeFacet diamondLoupeFacet = new DiamondLoupeFacet ();
74+ DiamondLoupeFacet diamondLoupeFacet = new DiamondLoupeFacet {salt: create2Salt} ();
7575 cuts[0 ] = contractToFacetCutAdd ("DiamondLoupeFacet " , address (diamondLoupeFacet));
76- OwnershipFacet ownershipFacet = new OwnershipFacet ();
76+ OwnershipFacet ownershipFacet = new OwnershipFacet {salt: create2Salt} ();
7777 cuts[1 ] = contractToFacetCutAdd ("OwnershipFacet " , address (ownershipFacet));
7878
7979 // fee facets
80- FeeViewsFacet feeViewsFacet = new FeeViewsFacet ();
80+ FeeViewsFacet feeViewsFacet = new FeeViewsFacet {salt: create2Salt} ();
8181 cuts[2 ] = contractToFacetCutAdd ("FeeViewsFacet " , address (feeViewsFacet));
82- FeeAdminFacet feeAdminFacet = new FeeAdminFacet ();
82+ FeeAdminFacet feeAdminFacet = new FeeAdminFacet {salt: create2Salt} ();
8383 cuts[3 ] = contractToFacetCutAdd ("FeeAdminFacet " , address (feeAdminFacet));
84- MorphoPerfFeeFacet morphoPerfFeeFacet = new MorphoPerfFeeFacet ();
84+ MorphoPerfFeeFacet morphoPerfFeeFacet = new MorphoPerfFeeFacet {salt: create2Salt} ();
8585 cuts[4 ] = contractToFacetCutAdd ("MorphoPerfFeeFacet " , address (morphoPerfFeeFacet));
86- AavePerfFeeFacet aavePerfFeeFacet = new AavePerfFeeFacet ();
86+ AavePerfFeeFacet aavePerfFeeFacet = new AavePerfFeeFacet {salt: create2Salt} ();
8787 cuts[5 ] = contractToFacetCutAdd ("AavePerfFeeFacet " , address (aavePerfFeeFacet));
8888
8989 // Deploy the Diamond with the diamondCut facet and all other facets in one transaction
90- Fee diamond = new Fee (cuts, FeeArgs ({owner: deployerAddress, init: address (0 ), initCalldata: bytes ("" )}));
90+ Fee diamond = new Fee {
91+ salt: create2Salt
92+ }(cuts, FeeArgs ({owner: deployerAddress, init: address (0 ), initCalldata: bytes ("" )}));
9193
9294 // Stop broadcasting transactions
9395 vm.stopBroadcast ();
@@ -108,7 +110,7 @@ contract DeployFeeDiamond is Script {
108110 * @notice Deploy to Datil network
109111 */
110112 function deployToDatil () public returns (address ) {
111- return deployToNetwork ("Datil " );
113+ return deployToNetwork ("Datil " , keccak256 ( " DatilSalt " ) );
112114 }
113115
114116 /**
0 commit comments