diff --git a/src/ERC173/ERC173.sol b/src/ERC173/ERC173.sol index 7a998401..b0d67d85 100644 --- a/src/ERC173/ERC173.sol +++ b/src/ERC173/ERC173.sol @@ -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)); + } + } diff --git a/src/ERC173/libraries/LibERC173.sol b/src/ERC173/libraries/LibERC173.sol index 1587a51b..714cb712 100644 --- a/src/ERC173/libraries/LibERC173.sol +++ b/src/ERC173/libraries/LibERC173.sol @@ -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)); + } } diff --git a/src/ERC721/ERC721/ERC721Facet.sol b/src/ERC721/ERC721/ERC721Facet.sol index 8ae9f1d5..55f2049e 100644 --- a/src/ERC721/ERC721/ERC721Facet.sol +++ b/src/ERC721/ERC721/ERC721Facet.sol @@ -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);