From 0636efd8a72ce58562f273c5c0145448ac8cba42 Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt <3esmit@gmail.com> Date: Wed, 25 Apr 2018 09:45:27 -0300 Subject: [PATCH] add execution failed event --- contracts/identity/ERC725.sol | 1 + contracts/identity/Identity.sol | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/contracts/identity/ERC725.sol b/contracts/identity/ERC725.sol index 696d50d..6b4dbe5 100644 --- a/contracts/identity/ERC725.sol +++ b/contracts/identity/ERC725.sol @@ -11,6 +11,7 @@ contract ERC725 { event KeyRemoved(bytes32 indexed key, uint256 indexed purpose, uint256 indexed keyType); event ExecutionRequested(uint256 indexed executionId, address indexed to, uint256 indexed value, bytes data); event Executed(uint256 indexed executionId, address indexed to, uint256 indexed value, bytes data); + event ExecutionFailed(uint256 indexed executionId, address indexed to, uint256 indexed value, bytes data); event Approved(uint256 indexed executionId, bool approved); struct Key { diff --git a/contracts/identity/Identity.sol b/contracts/identity/Identity.sol index c6f8d58..cf65a68 100644 --- a/contracts/identity/Identity.sol +++ b/contracts/identity/Identity.sol @@ -499,8 +499,11 @@ contract Identity is ERC725, ERC735 { delete txx[_id]; //(?) success should be included in event? success = address(trx.to).call.value(trx.value)(trx.data); - emit Executed(_id, trx.to, trx.value, trx.data); - + if(success){ + emit Executed(_id, trx.to, trx.value, trx.data); + } else { + emit ExecutionFailed(_id, trx.to, trx.value, trx.data)); + } } }