diff --git a/contracts/helpers/navigator/lib/ExecutionsHelper.sol b/contracts/helpers/navigator/lib/ExecutionsHelper.sol index 83669e2de..cdfc88413 100644 --- a/contracts/helpers/navigator/lib/ExecutionsHelper.sol +++ b/contracts/helpers/navigator/lib/ExecutionsHelper.sol @@ -12,7 +12,7 @@ contract ExecutionsHelper is HelperInterface { function prepare( NavigatorContext memory context - ) public view returns (NavigatorContext memory) { + ) public pure returns (NavigatorContext memory) { return context.withExecutions(); } } diff --git a/lib/seaport-sol b/lib/seaport-sol index 0a17c0e88..880e58c80 160000 --- a/lib/seaport-sol +++ b/lib/seaport-sol @@ -1 +1 @@ -Subproject commit 0a17c0e882544a092b5e5ce353b2c6a7c49ba0f2 +Subproject commit 880e58c80b5a31b6abaea7e7ede6bb26fa07f9e6 diff --git a/script/NavigatorDeployer.s.sol b/script/NavigatorDeployer.s.sol index 38a3a1cef..3246a97b1 100644 --- a/script/NavigatorDeployer.s.sol +++ b/script/NavigatorDeployer.s.sol @@ -63,53 +63,20 @@ contract NavigatorDeployer is Script { address private constant CONDUIT_CONTROLLER = 0x00000000F9490004C11Cef243f5400493c00Ad63; - bytes32 private constant SALT = bytes32(uint256(0x1)); - - function deploy( - string memory name, - bytes memory initCode - ) internal returns (address) { - bytes32 initCodeHash = keccak256(initCode); - address deploymentAddress = address( - uint160( - uint256( - keccak256( - abi.encodePacked( - hex"ff", - address(IMMUTABLE_CREATE2_FACTORY), - SALT, - initCodeHash - ) - ) - ) - ) - ); - bool deployed; - if (!IMMUTABLE_CREATE2_FACTORY.hasBeenDeployed(deploymentAddress)) { - deploymentAddress = IMMUTABLE_CREATE2_FACTORY.safeCreate2( - SALT, - initCode - ); - deployed = true; - } - console.log( - _pad(deployed ? "Deploying" : "Found", 10), - _pad(name, 23), - _pad(LibString.toHexString(deploymentAddress), 43), - LibString.toHexString(uint256(initCodeHash)) - ); - return deploymentAddress; - } + bytes32 private constant DEFAULT_SALT = bytes32(uint256(0x1)); + bytes32 private constant SEAPORT_VALIDATOR_SALT = + bytes32(uint256(0x459b42ee5b5e5000d96491ce)); + bytes32 private constant SEAPORT_NAVIGATOR_SALT = + bytes32(uint256(0x9237ec96f90d12013e58e484)); function run() public { - vm.startBroadcast(); console.log( - _pad("State", 10), - _pad("Name", 23), - _pad("Address", 43), + pad("State", 10), + pad("Name", 23), + pad("Address", 43), "Initcode hash" ); - + vm.startBroadcast(); address seaportValidatorHelper = deploy( "SeaportValidatorHelper", type(SeaportValidatorHelper).creationCode @@ -120,6 +87,7 @@ contract NavigatorDeployer is Script { ); deploy( "SeaportValidator", + SEAPORT_VALIDATOR_SALT, bytes.concat( type(SeaportValidator).creationCode, abi.encode( @@ -161,6 +129,7 @@ contract NavigatorDeployer is Script { deploy( "SeaportNavigator", + SEAPORT_NAVIGATOR_SALT, bytes.concat( type(SeaportNavigator).creationCode, abi.encode( @@ -176,7 +145,51 @@ contract NavigatorDeployer is Script { ); } - function _pad( + function deploy( + string memory name, + bytes memory initCode + ) internal returns (address) { + return deploy(name, DEFAULT_SALT, initCode); + } + + function deploy( + string memory name, + bytes32 salt, + bytes memory initCode + ) internal returns (address) { + bytes32 initCodeHash = keccak256(initCode); + address deploymentAddress = address( + uint160( + uint256( + keccak256( + abi.encodePacked( + hex"ff", + address(IMMUTABLE_CREATE2_FACTORY), + salt, + initCodeHash + ) + ) + ) + ) + ); + bool deploying; + if (!IMMUTABLE_CREATE2_FACTORY.hasBeenDeployed(deploymentAddress)) { + deploymentAddress = IMMUTABLE_CREATE2_FACTORY.safeCreate2( + salt, + initCode + ); + deploying = true; + } + console.log( + pad(deploying ? "Deploying" : "Found", 10), + pad(name, 23), + pad(LibString.toHexString(deploymentAddress), 43), + LibString.toHexString(uint256(initCodeHash)) + ); + return deploymentAddress; + } + + function pad( string memory name, uint256 n ) internal pure returns (string memory) {