From ed5c3e89695e4bb4b2b1ff358e072479808a54cd Mon Sep 17 00:00:00 2001 From: Jay Paik Date: Fri, 22 Nov 2024 14:57:23 -0500 Subject: [PATCH] fix: [S4] disable renounce ownership (#297) --- src/factory/AccountFactory.sol | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/factory/AccountFactory.sol b/src/factory/AccountFactory.sol index 29b13228..8ebfd0f6 100644 --- a/src/factory/AccountFactory.sol +++ b/src/factory/AccountFactory.sol @@ -29,6 +29,7 @@ contract AccountFactory is Ownable2Step { address indexed account, uint256 indexed ownerX, uint256 indexed ownerY, uint256 salt ); + error InvalidAction(); error TransferFailed(); constructor( @@ -186,7 +187,7 @@ contract AccountFactory is Ownable2Step { /// @param owner The owner of the account. /// @param salt The salt to use for the account creation. /// @return The address of the account. - function getAddressSemiModular(address owner, uint256 salt) public view returns (address) { + function getAddressSemiModular(address owner, uint256 salt) external view returns (address) { bytes32 fullSalt = getSalt(owner, salt, type(uint32).max); bytes memory immutables = _getImmutableArgs(owner); return _getAddressSemiModular(immutables, fullSalt); @@ -200,7 +201,7 @@ contract AccountFactory is Ownable2Step { /// @param entityId The entity ID to use for the account creation. /// @return The address of the account. function getAddressWebAuthn(uint256 ownerX, uint256 ownerY, uint256 salt, uint32 entityId) - public + external view returns (address) { @@ -209,6 +210,11 @@ contract AccountFactory is Ownable2Step { ); } + /// @notice Disable renouncing ownership. + function renounceOwnership() public view override onlyOwner { + revert InvalidAction(); + } + /// @notice Get the full salt used for account creation. /// @dev To get the full salt used in createSemiModularAccount, use type(uint32).max for entityId. /// @param owner The owner of the account.