Skip to content

Commit

Permalink
fix granRoleUser
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Lima committed Jul 10, 2023
1 parent 844c311 commit 637d658
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions contracts/ERC721RolesRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,8 @@ contract ERC721RolesRegistry is IERC721RolesRegistry {
uint64 _expirationDate,
bytes calldata _data
) external onlyOwner(_nftAddress, _tokenId) validExpirationDate(_expirationDate) {
address _currentUser = roleUserAssignments[msg.sender][_nftAddress][_tokenId][_role];

if(_currentUser != address(0)){
delete roleAssignments[msg.sender][_currentUser][_nftAddress][_tokenId][_role];
emit RoleRevoked(_role, _account, _nftAddress, _tokenId);
}

roleAssignments[msg.sender][_account][_nftAddress][_tokenId][_role] = RoleData(_expirationDate, _data);
roleUserAssignments[msg.sender][_nftAddress][_tokenId][_role] = _account;
emit RoleGranted(_role, _account, _expirationDate, _nftAddress, _tokenId, _data);
}

Expand Down

0 comments on commit 637d658

Please sign in to comment.