Skip to content

Commit

Permalink
remove salt create 2 on mock (#1886)
Browse files Browse the repository at this point in the history
  • Loading branch information
giuseppecrj authored Dec 19, 2024
1 parent ef278e8 commit 96e7cb5
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions contracts/scripts/deployments/utils/DeployMockERC721A.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,10 @@ contract DeployMockERC721A is Deployer, FacetHelper {
}

function __deploy(address deployer) public override returns (address) {
bytes32 salt = bytes32(uint256(uint160(deployer))); // create a salt from address

bytes32 initCodeHash = hashInitCode(type(MockERC721A).creationCode);
address predeterminedAddress = vm.computeCreate2Address(salt, initCodeHash);

vm.startBroadcast(deployer);
MockERC721A deployment = new MockERC721A{salt: salt}();
MockERC721A deployment = new MockERC721A();
vm.stopBroadcast();

require(predeterminedAddress == address(deployment));

return address(deployment);
}
}

0 comments on commit 96e7cb5

Please sign in to comment.