Skip to content

Commit

Permalink
ON-466: fix revokeRole
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Lima committed Sep 4, 2023
1 parent e3fa3d1 commit d74426b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions contracts/ImmutableVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,13 @@ contract ImmutableVault is AccessControl {
address _tokenAddress,
uint256 _tokenId
) external onlyRole(MARKETPLACE_ROLE) {
address _tokenOwner = nftInfo[_tokenAddress][_tokenId].owner;
RoleAssignment[] memory _roleAssignments = nftInfo[_tokenOwner][_tokenId].roleAssignments;
RoleAssignment[] memory _roleAssignments = nftInfo[_tokenAddress][_tokenId].roleAssignments;

for (uint256 i = 0; i < _roleAssignments.length; i++) {
_revokeRole(_roleAssignments[i].role, _tokenAddress, _tokenId, _roleAssignments[i].grantee);
}

delete nftInfo[_tokenOwner][_tokenId].roleAssignments; // free storage and refund gas
delete nftInfo[_tokenAddress][_tokenId].roleAssignments; // free storage and refund gas
delete nftInfo[_tokenAddress][_tokenId].expirationDate; // free storage and refund gas
}

Expand Down

0 comments on commit d74426b

Please sign in to comment.