Skip to content

Commit

Permalink
(nameRegistry): remove restriction only registered address can regist…
Browse files Browse the repository at this point in the history
…er short name
  • Loading branch information
benjaminbollen committed Oct 1, 2024
1 parent 74a6435 commit ae3e110
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/names/NameRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ contract NameRegistry is Base58Converter, INameRegistry, INameRegistryErrors, IC

// Modifiers

modifier mustBeRegistered(address _avatar, uint8 _code) {
if (hub.avatars(_avatar) == address(0)) {
revert CirclesAvatarMustBeRegistered(_avatar, _code);
}
_;
}

modifier onlyHub(uint8 _code) {
if (msg.sender != address(hub)) {
revert CirclesInvalidFunctionCaller(msg.sender, address(hub), _code);
Expand All @@ -92,23 +85,23 @@ contract NameRegistry is Base58Converter, INameRegistry, INameRegistryErrors, IC
/**
* @notice Register a short name for the avatar
*/
function registerShortName() external mustBeRegistered(msg.sender, 0) {
function registerShortName() external {
_registerShortName();
}

/**
* Registers a short name for the avatar using a specific nonce if the short name is available
* @param _nonce nonce to be used in the calculation
*/
function registerShortNameWithNonce(uint256 _nonce) external mustBeRegistered(msg.sender, 1) {
function registerShortNameWithNonce(uint256 _nonce) external {
_registerShortNameWithNonce(_nonce);
}

function setMetadataDigest(address _avatar, bytes32 _metadataDigest) external onlyHub(0) {
_setMetadataDigest(_avatar, _metadataDigest);
}

function updateMetadataDigest(bytes32 _metadataDigest) external mustBeRegistered(msg.sender, 2) {
function updateMetadataDigest(bytes32 _metadataDigest) external {
_setMetadataDigest(msg.sender, _metadataDigest);
}

Expand All @@ -134,7 +127,7 @@ contract NameRegistry is Base58Converter, INameRegistry, INameRegistryErrors, IC
customSymbols[_avatar] = _symbol;
}

function name(address _avatar) external view mustBeRegistered(_avatar, 3) returns (string memory) {
function name(address _avatar) external view returns (string memory) {
if (!hub.isHuman(_avatar)) {
// groups and organizations can have set a custom name
string memory customName = customNames[_avatar];
Expand All @@ -148,7 +141,7 @@ contract NameRegistry is Base58Converter, INameRegistry, INameRegistryErrors, IC
return _getShortOrLongName(_avatar);
}

function symbol(address _avatar) external view mustBeRegistered(_avatar, 4) returns (string memory) {
function symbol(address _avatar) external view returns (string memory) {
if (hub.isOrganization(_avatar)) {
revert CirclesNamesOrganizationHasNoSymbol(_avatar, 0);
}
Expand Down

0 comments on commit ae3e110

Please sign in to comment.