From 166629406f66251d8712f3b839aacc1646a52817 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Sat, 12 Sep 2020 01:46:55 +0530 Subject: [PATCH] Added logic address for salt --- contracts/deployer.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/deployer.sol b/contracts/deployer.sol index c1b2cab..f57bc22 100644 --- a/contracts/deployer.sol +++ b/contracts/deployer.sol @@ -10,7 +10,7 @@ contract Deployer { // deploy create2 + minimal proxy function deployLogic(address owner, address logic) public returns (address proxy) { require(!(isFlusherDeployed(getAddress(owner, logic))), "flusher-already-deployed"); - bytes32 salt = keccak256(abi.encodePacked(owner)); + bytes32 salt = keccak256(abi.encodePacked(owner, proxy)); bytes20 targetBytes = bytes20(logic); // solium-disable-next-line security/no-inline-assembly assembly { @@ -41,7 +41,7 @@ contract Deployer { // compute create2 + minimal proxy address function getAddress(address owner, address logic) public view returns (address) { bytes32 codeHash = keccak256(getCreationCode(logic)); - bytes32 salt = keccak256(abi.encodePacked(owner)); + bytes32 salt = keccak256(abi.encodePacked(owner, logic)); bytes32 rawAddress = keccak256( abi.encodePacked( bytes1(0xff),