refactor: add isTokenController and move _clearTokenControllers to FleekAccessControl contract
This commit is contained in:
parent
12a7a2cdf9
commit
45118cb930
|
|
@ -40,10 +40,21 @@ abstract contract FleekAccessControl is AccessControl {
|
|||
_;
|
||||
}
|
||||
|
||||
function isTokenController(
|
||||
uint256 tokenId,
|
||||
address account
|
||||
) public view returns (bool) {
|
||||
return hasRole(_tokenRole(tokenId, "CONTROLLER"), account);
|
||||
}
|
||||
|
||||
function _tokenRole(
|
||||
uint256 tokenId,
|
||||
string memory role
|
||||
) internal pure returns (bytes32) {
|
||||
return keccak256(abi.encodePacked("TOKEN_", role, tokenId));
|
||||
}
|
||||
|
||||
function _clearTokenControllers(uint256 tokenId) internal {
|
||||
// TODO: Remove token controllers from AccessControl
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -231,8 +231,4 @@ contract FleekERC721 is ERC721, FleekAccessControl {
|
|||
delete _apps[tokenId];
|
||||
}
|
||||
}
|
||||
|
||||
function _clearTokenControllers(uint256 tokenId) internal {
|
||||
// TODO: Remove token controllers from AccessControl
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue