# Auth2Step

**Inherits:** IAuth2Step, Auth

An extension of Auth.sol that supports two-step ownership transfer

## State Variables

### pendingOwner

Address of the pending owner

```solidity
address public pendingOwner;
```

## Functions

### onlyOwner

```solidity
modifier onlyOwner() virtual;
```

### constructor

```solidity
constructor(address newOwner_, Authority authority_) Auth(newOwner_, authority_);
```

### acceptOwnership

Accept ownership transfer

```solidity
function acceptOwnership() external virtual override;
```

### transferOwnership

Wrapper function for backward compatibility with legacy code expecting transferOwnership

*This function exists to maintain compatibility with contracts that were built against the previous version of Auth where ownership transfer was named `transferOwnership` The new Auth implementation renamed this to `setOwner` to better reflect the two-step ownership transfer process. This wrapper ensures existing code like BaseVault continues to work without modification Previous version: <https://github.com/transmissions11/solmate/blob/89365b880c4f3c786bdd453d4b8e8fe410344a69/src/auth/Auth.sol> New version: <https://github.com/transmissions11/solmate/blob/eaa7041378f9a6c12f943de08a6c41b31a9870fc/src/auth/Auth.sol>*

```solidity
function transferOwnership(address newOwner) public virtual onlyOwner;
```

**Parameters**

| Name       | Type      | Description                                        |
| ---------- | --------- | -------------------------------------------------- |
| `newOwner` | `address` | Address to start the ownership transfer process to |

### setOwner

Start the ownership transfer of the contract to a new account

*Replaces the pending transfer if there is one*

*Overrides the `Auth` contract's `transferOwnership` function*

*Zero check is not needed because pendingOwner can always be overwritten*

```solidity
function setOwner(address newOwner) public virtual override onlyOwner;
```

**Parameters**

| Name       | Type      | Description                      |
| ---------- | --------- | -------------------------------- |
| `newOwner` | `address` | Address to transfer ownership to |
