diff --git a/contracts/utils/Create2.sol b/contracts/utils/Create2.sol index d3aaa42dd09..a88ce25f643 100644 --- a/contracts/utils/Create2.sol +++ b/contracts/utils/Create2.sol @@ -46,8 +46,9 @@ library Create2 { addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt) // if no address was created, and returndata is not empty, bubble revert if and(iszero(addr), not(iszero(returndatasize()))) { - returndatacopy(0, 0, returndatasize()) - revert(0, returndatasize()) + let p := mload(0x40) + returndatacopy(p, 0, returndatasize()) + revert(p, returndatasize()) } } if (addr == address(0)) {