Skip to content
Closed
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions src/ERC173/ERC173.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,17 @@ contract ERC173Facet {

emit OwnershipTransferred(previousOwner, _newOwner);
}

/// @notice Renounce ownership of the contract
/// @dev Sets the owner to address(0), disabling all functions restricted to the owner.
function renounceOwnership() external {
ERC173Storage storage s = getStorage();
if (msg.sender != s.owner) revert OwnableUnauthorizedAccount();

address previousOwner = s.owner;
s.owner = address(0);

emit OwnershipTransferred(previousOwner, address(0));
}

}
12 changes: 12 additions & 0 deletions src/ERC173/libraries/LibERC173.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,16 @@ library LibERC173 {

emit OwnershipTransferred(previousOwner, _newOwner);
}

/// @notice Renounce ownership of the contract
/// @dev Sets the owner to address(0), disabling all functions restricted to the owner
function renounceOwnership() internal {
ERC173Storage storage s = getStorage();
if (s.owner == address(0)) revert OwnableAlreadyRenounced();

address previousOwner = s.owner;
s.owner = address(0);

emit OwnershipTransferred(previousOwner, address(0));
}
}
2 changes: 1 addition & 1 deletion src/ERC721/ERC721/ERC721Facet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ contract ERC721Facet {
/// From openzeppelin/contracts/utils/Strings.sol
/// @dev Converts a `uint256` to its ASCII `string` decimal representation.
function toString(uint256 value) internal pure returns (string memory) {
bytes16 _SYMBOLS = "0123456789abcdef";
bytes16 _SYMBOLS = "0123456789";
unchecked {
uint256 length = log10(value) + 1;
string memory buffer = new string(length);
Expand Down