Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Lima committed Sep 6, 2023
1 parent 6a1b96e commit f1457dd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions contracts/RolesRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ contract RolesRegistry is IERC7432 {
}

function revokeRole(bytes32 _role, address _tokenAddress, uint256 _tokenId, address _grantee) external {
require(msg.sender == IERC721(_tokenAddress).ownerOf(_tokenId), "RolesRegistry: sender must be owner");
delete roleAssignments[_grantee][_tokenAddress][_tokenId][_role];
delete lastRoleAssignment[_tokenAddress][_tokenId][_role];
emit RoleRevoked(msg.sender, _role, _tokenAddress, _tokenId, _grantee);
Expand All @@ -50,7 +51,7 @@ contract RolesRegistry is IERC7432 {
bytes32 _role,
address _tokenAddress,
uint256 _tokenId,
address _grantor,
address _grantor, // TODO: not being used. Remove?
address _grantee
) external view returns (bool) {
return roleAssignments[_grantee][_tokenAddress][_tokenId][_role].expirationDate > block.timestamp;
Expand All @@ -60,7 +61,7 @@ contract RolesRegistry is IERC7432 {
bytes32 _role,
address _tokenAddress,
uint256 _tokenId,
address _grantor,
address _grantor, // TODO: not being used. Remove?
address _grantee
) external view returns (bool) {
bool isValid = roleAssignments[_grantee][_tokenAddress][_tokenId][_role].expirationDate >
Expand All @@ -73,7 +74,7 @@ contract RolesRegistry is IERC7432 {
bytes32 _role,
address _tokenAddress,
uint256 _tokenId,
address _grantor,
address _grantor, // TODO: not being used. Remove?
address _grantee
) external view returns (bytes memory data_) {
RoleData memory _roleData = roleAssignments[_grantee][_tokenAddress][_tokenId][_role];
Expand All @@ -84,7 +85,7 @@ contract RolesRegistry is IERC7432 {
bytes32 _role,
address _tokenAddress,
uint256 _tokenId,
address _grantor,
address _grantor,// TODO: not being used. Remove?
address _grantee
) external view returns (uint64 expirationDate_){
RoleData memory _roleData = roleAssignments[_grantee][_tokenAddress][_tokenId][_role];
Expand Down

0 comments on commit f1457dd

Please sign in to comment.