From 22c36942e1ef7c7f59f7a90e18b539225965db1d Mon Sep 17 00:00:00 2001 From: Kristen Pire Date: Thu, 16 May 2024 12:24:46 +0200 Subject: [PATCH] feat(SystemRole): Override renounceOwnership to prevent renouncing ownership --- src/SystemRoleUpgradeable.sol | 11 ++++++++--- src/Token.sol | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/SystemRoleUpgradeable.sol b/src/SystemRoleUpgradeable.sol index 69a8d6d..e5cb1e4 100644 --- a/src/SystemRoleUpgradeable.sol +++ b/src/SystemRoleUpgradeable.sol @@ -64,9 +64,9 @@ abstract contract SystemRoleUpgradeable is _; } - /** - * @dev modifier to restrict access to admin account. - */ + /** + * @dev modifier to restrict access to admin account. + */ modifier onlyAdminAccount(address account) { require( hasRole(ADMIN_ROLE, account), @@ -139,4 +139,9 @@ abstract contract SystemRoleUpgradeable is revokeRole(ADMIN_ROLE, account); emit AdminAccountRemoved(account); } + + // Override renounceOwnership to prevent renouncing ownership + function renounceOwnership() public override onlyOwner { + revert("Ownership cannot be renounced"); + } } diff --git a/src/Token.sol b/src/Token.sol index b73c55e..1bf4ec5 100644 --- a/src/Token.sol +++ b/src/Token.sol @@ -177,6 +177,7 @@ contract Token is ); } + } contract EURe is Token {