From a154220026d95d23dbf1576aa2df51209f1b7d40 Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt <3esmit@gmail.com> Date: Wed, 9 May 2018 01:37:38 -0300 Subject: [PATCH] improve naming of modifier --- contracts/identity/Identity.sol | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/identity/Identity.sol b/contracts/identity/Identity.sol index 65948c4..d3f4f9c 100644 --- a/contracts/identity/Identity.sol +++ b/contracts/identity/Identity.sol @@ -29,7 +29,7 @@ contract Identity is ERC725, ERC735, MessageSigned { mapping(bytes32 => bool) approvals; } - modifier msgSenderKey(uint256 keyPurpose) { + modifier selfOrSenderKey(uint256 keyPurpose) { if(msg.sender == address(this)) { _; } else { @@ -162,7 +162,7 @@ contract Identity is ERC725, ERC735, MessageSigned { uint256 _type ) public - msgSenderKey(MANAGEMENT_KEY) + selfOrSenderKey(MANAGEMENT_KEY) returns (bool success) { _addKey(_key, _purpose, _type); @@ -175,7 +175,7 @@ contract Identity is ERC725, ERC735, MessageSigned { uint256 _newType ) public - msgSenderKey(MANAGEMENT_KEY) + selfOrSenderKey(MANAGEMENT_KEY) returns (bool success) { uint256 purpose = keys[_oldKey].purpose; @@ -189,7 +189,7 @@ contract Identity is ERC725, ERC735, MessageSigned { uint256 _purpose ) public - msgSenderKey(MANAGEMENT_KEY) + selfOrSenderKey(MANAGEMENT_KEY) returns (bool success) { _removeKey(_key, _purpose); @@ -201,7 +201,7 @@ contract Identity is ERC725, ERC735, MessageSigned { uint256 _minimumApprovals ) public - msgSenderKey(MANAGEMENT_KEY) + selfOrSenderKey(MANAGEMENT_KEY) { require(_minimumApprovals > 0); require(_minimumApprovals <= keysByPurpose[_purpose].length); @@ -210,7 +210,7 @@ contract Identity is ERC725, ERC735, MessageSigned { function setupRecovery(address _recoveryContract) public - msgSenderKey(MANAGEMENT_KEY) + selfOrSenderKey(MANAGEMENT_KEY) { require(recoveryContract == address(0)); recoveryContract = _recoveryContract;