Skip to content

Commit 5411649

Browse files
committed
fmt
1 parent adcc953 commit 5411649

1 file changed

Lines changed: 6 additions & 21 deletions

File tree

contracts/script/DeployFeeVault.s.sol

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,8 @@ contract DeployFeeVault is Script {
6464

6565
/// @notice Compute the CREATE2 address for FeeVault deployment
6666
function computeAddress(bytes32 salt, address owner) public view returns (address) {
67-
bytes32 bytecodeHash = keccak256(
68-
abi.encodePacked(type(FeeVault).creationCode, abi.encode(owner))
69-
);
70-
return address(
71-
uint160(
72-
uint256(
73-
keccak256(abi.encodePacked(bytes1(0xff), address(this), salt, bytecodeHash))
74-
)
75-
)
76-
);
67+
bytes32 bytecodeHash = keccak256(abi.encodePacked(type(FeeVault).creationCode, abi.encode(owner)));
68+
return address(uint160(uint256(keccak256(abi.encodePacked(bytes1(0xff), address(this), salt, bytecodeHash)))));
7769
}
7870
}
7971

@@ -84,17 +76,10 @@ contract ComputeFeeVaultAddress is Script {
8476
bytes32 salt = vm.envOr("SALT", bytes32(0));
8577
address deployer = vm.envAddress("DEPLOYER");
8678

87-
bytes32 bytecodeHash = keccak256(
88-
abi.encodePacked(type(FeeVault).creationCode, abi.encode(owner))
89-
);
90-
91-
address predicted = address(
92-
uint160(
93-
uint256(
94-
keccak256(abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash))
95-
)
96-
)
97-
);
79+
bytes32 bytecodeHash = keccak256(abi.encodePacked(type(FeeVault).creationCode, abi.encode(owner)));
80+
81+
address predicted =
82+
address(uint160(uint256(keccak256(abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)))));
9883

9984
console.log("========== FeeVault Address Computation ==========");
10085
console.log("Owner:", owner);

0 commit comments

Comments
 (0)