Skip to content

Commit

Permalink
ON-490: refactor rolesRegistry to defaultRolesRegistry
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Lima committed Oct 2, 2023
1 parent 3b88116 commit 914c1ef
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions contracts/OriumMarketplace.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ contract OriumMarketplace is Initializable, OwnableUpgradeable, PausableUpgradea
/** ######### Global Variables ########### **/

/// @dev rolesRegistry is a ERC-7432 contract
address public rolesRegistry;
address public defaultRolesRegistry;

/// @dev tokenAddress => rolesRegistry
mapping(address => address) public tokenRolesRegistry;

Expand Down Expand Up @@ -191,15 +192,15 @@ contract OriumMarketplace is Initializable, OwnableUpgradeable, PausableUpgradea
/**
* @notice Initializes the contract.
* @dev The owner of the contract will be the owner of the protocol.
* @param _owner the owner of the protocol.
* @param _rolesRegistry the address of the roles registry.
* @param _maxDeadline the maximum deadline.
* @param _owner The owner of the protocol.
* @param _defaultRolesRegistry The address of the roles registry.
* @param _maxDeadline The maximum deadline.
*/
function initialize(address _owner, address _rolesRegistry, uint256 _maxDeadline) public initializer {
function initialize(address _owner, address _defaultRolesRegistry, uint256 _maxDeadline) public initializer {
__Pausable_init();
__Ownable_init();

rolesRegistry = _rolesRegistry;
defaultRolesRegistry = _defaultRolesRegistry;
maxDeadline = _maxDeadline;

transferOwnership(_owner);
Expand Down Expand Up @@ -660,6 +661,7 @@ contract OriumMarketplace is Initializable, OwnableUpgradeable, PausableUpgradea
* @param _tokenAddress The NFT address.
*/
function rolesRegistryOf(address _tokenAddress) public view returns (address) {
return tokenRolesRegistry[_tokenAddress] == address(0) ? rolesRegistry : tokenRolesRegistry[_tokenAddress];
return
tokenRolesRegistry[_tokenAddress] == address(0) ? defaultRolesRegistry : tokenRolesRegistry[_tokenAddress];
}
}

0 comments on commit 914c1ef

Please sign in to comment.