Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dyedm1 committed Oct 7, 2023
1 parent dd7a899 commit 261f62f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/Create4Factory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ contract Create4Factory {
(0x0000000000000000000000000000000000000000) // MSG.SENDER, FILLED DYNAMICALLY (appended for frontrunning protection)
Right-padded with 0s to 32 bytes
*/
bytes32 internal constant BOOTSTRAP_CODE = hex"3636363636335af13d36363e3d36f30000000000000000000000000000000000";

bytes32 internal constant BOOTSTRAP_CODE = hex"3636363636335af13d36363e3d36f30000000000000000000000000000000000";

uint256 internal constant UINT256_MAX = 2 ** 256 - 1;

Expand Down
8 changes: 2 additions & 6 deletions test/Create4Factory.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ import {Test, console2} from "forge-std/Test.sol";
import {Create4Factory} from "src/Create4Factory.sol";

contract TestCreate4Factory is Test {
bytes15 internal constant BOOTSTRAP_CODE = hex"3636363636335af13d36363e3d36f3";
bytes15 internal constant BOOTSTRAP_CODE = hex"3636363636335af13d36363e3d36f3";
address internal constant EIP_1153_MAGIC = address(0x4549502d31313533);

Create4Factory internal C4F;

function expectedAddress(address deployer, bytes32 salt) internal view returns (address) {
bytes32 bootstrapCodeHash = keccak256(
abi.encodePacked(
BOOTSTRAP_CODE, bytes20(address(deployer))
)
);
bytes32 bootstrapCodeHash = keccak256(abi.encodePacked(BOOTSTRAP_CODE, bytes20(address(deployer))));

return
address(uint160(uint256(keccak256(abi.encodePacked(bytes1(0xff), address(C4F), salt, bootstrapCodeHash)))));
Expand Down

0 comments on commit 261f62f

Please sign in to comment.