From fe4a10dfcded78901cdf305d3647a218f9f4b378 Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt <3esmit@gmail.com> Date: Thu, 22 Mar 2018 23:31:20 -0300 Subject: [PATCH] makes "call" more explicit --- contracts/identity/IdentityGasRelay.sol | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/contracts/identity/IdentityGasRelay.sol b/contracts/identity/IdentityGasRelay.sol index cd544d8..5254cee 100644 --- a/contracts/identity/IdentityGasRelay.sol +++ b/contracts/identity/IdentityGasRelay.sol @@ -57,16 +57,20 @@ contract IdentityGasRelay is Identity { ); //verify if signatures are valid and came from correct actors; - uint256 requiredKey = _to == address(this) ? MANAGEMENT_KEY : ACTION_KEY; - verifySignatures(requiredKey, signHash, _messageSignatures); + verifySignatures( + _to == address(this) ? MANAGEMENT_KEY : ACTION_KEY, + signHash, + _messageSignatures + ); //executes transaction nonce++; + bool success = _to.call.value(_value)(_data); emit ExecutedGasRelayed( signHash, - _to.call.value(_value)(_data) + success ); - + //refund gas used using contract held ERC20 tokens or ETH if (_gasPrice > 0) { uint256 _amount = 21000 + (startGas - gasleft());