Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(nameRegistry): remove restriction only registered address can regist… #61

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading