Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
revert on create2 failure in ProxyFactory proxy creation methods. Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeshultz committed Sep 20, 2019
1 parent 3867b3b commit 674b1ce
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/contracts/contracts/proxy/ProxyFactory.s
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ contract ProxyFactory {
assembly {
proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)
}

// create2 failed
if (proxy == address(0)) {
revert("proxy-deploy-failed");
}

if (initializer.length > 0)
// solium-disable-next-line security/no-inline-assembly
assembly {
Expand All @@ -73,6 +79,12 @@ contract ProxyFactory {
assembly {
proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)
}

// create2 failed
if (proxy == address(0)) {
revert("proxy-deploy-failed");
}

if (initializer.length > 0) {
uint256 value = msg.value;
// solium-disable-next-line security/no-inline-assembly
Expand Down

0 comments on commit 674b1ce

Please sign in to comment.