From 732fcfa002d0fd8a1f9807df3d9ad7e57e2a8b25 Mon Sep 17 00:00:00 2001 From: 0age <37939117+0age@users.noreply.github.com> Date: Wed, 24 Jul 2019 15:33:43 -0400 Subject: [PATCH] Add revert message to reverts in ProxyFactory Revert messages can be retrieved from the return buffer and passed along in a few locations. --- .../lib/contracts/upgradeability/ProxyFactory.sol | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/lib/contracts/upgradeability/ProxyFactory.sol b/packages/lib/contracts/upgradeability/ProxyFactory.sol index 5e7504c96..f377b5dc2 100644 --- a/packages/lib/contracts/upgradeability/ProxyFactory.sol +++ b/packages/lib/contracts/upgradeability/ProxyFactory.sol @@ -30,7 +30,13 @@ contract ProxyFactory { if(_data.length > 0) { (bool success,) = proxy.call(_data); - require(success); + if (!success) { + // revert and provide the revert message. + assembly { + returndatacopy(0, 0, returndatasize) + revert(0, returndatasize) + } + } } } @@ -86,7 +92,9 @@ contract ProxyFactory { assembly { addr := create2(0, add(code, 0x20), mload(code), salt) if iszero(extcodesize(addr)) { - revert(0, 0) + // revert and provide the revert message. + returndatacopy(0, 0, returndatasize) + revert(0, returndatasize) } }