mirror of
https://github.com/Instadapp/yield-contract.git
synced 2024-07-29 21:47:29 +00:00
Added logic address for salt
This commit is contained in:
parent
584042b318
commit
166629406f
|
@ -10,7 +10,7 @@ contract Deployer {
|
||||||
// deploy create2 + minimal proxy
|
// deploy create2 + minimal proxy
|
||||||
function deployLogic(address owner, address logic) public returns (address proxy) {
|
function deployLogic(address owner, address logic) public returns (address proxy) {
|
||||||
require(!(isFlusherDeployed(getAddress(owner, logic))), "flusher-already-deployed");
|
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);
|
bytes20 targetBytes = bytes20(logic);
|
||||||
// solium-disable-next-line security/no-inline-assembly
|
// solium-disable-next-line security/no-inline-assembly
|
||||||
assembly {
|
assembly {
|
||||||
|
@ -41,7 +41,7 @@ contract Deployer {
|
||||||
// compute create2 + minimal proxy address
|
// compute create2 + minimal proxy address
|
||||||
function getAddress(address owner, address logic) public view returns (address) {
|
function getAddress(address owner, address logic) public view returns (address) {
|
||||||
bytes32 codeHash = keccak256(getCreationCode(logic));
|
bytes32 codeHash = keccak256(getCreationCode(logic));
|
||||||
bytes32 salt = keccak256(abi.encodePacked(owner));
|
bytes32 salt = keccak256(abi.encodePacked(owner, logic));
|
||||||
bytes32 rawAddress = keccak256(
|
bytes32 rawAddress = keccak256(
|
||||||
abi.encodePacked(
|
abi.encodePacked(
|
||||||
bytes1(0xff),
|
bytes1(0xff),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user