From ce8b9ab5f1704e05fc2e7910d23792a6ebe435e0 Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt Date: Wed, 20 Mar 2019 22:02:53 -0300 Subject: [PATCH] revert return data --- contracts/deploy/DelegatedCall.sol | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/contracts/deploy/DelegatedCall.sol b/contracts/deploy/DelegatedCall.sol index ff23f8c..ba6b281 100644 --- a/contracts/deploy/DelegatedCall.sol +++ b/contracts/deploy/DelegatedCall.sol @@ -22,12 +22,16 @@ contract DelegatedCall { _; //normal execution } else { (bool success, bytes memory returnData) = _target.delegatecall(msg.data); - require(success, "Delegated Call failed"); - - //exit-return delegatecall returnData - assembly { - return(add(returnData, 0x20), returnData) + if(success){ + assembly { + return(add(returnData, 0x20), returnData) + } + } else { + assembly { + revert(add(returnData, 0x20), returnData) + } } + } }