Skip to content

Commit

Permalink
fix: [S4] disable renounce ownership (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaypaik authored Nov 22, 2024
1 parent b796c55 commit ed5c3e8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/factory/AccountFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ contract AccountFactory is Ownable2Step {
address indexed account, uint256 indexed ownerX, uint256 indexed ownerY, uint256 salt
);

error InvalidAction();
error TransferFailed();

constructor(
Expand Down Expand Up @@ -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);
Expand All @@ -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)
{
Expand All @@ -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.
Expand Down

0 comments on commit ed5c3e8

Please sign in to comment.