# TermRepoRolloverManager.sol

## TermRepoRolloverManager

This contract accepts and carries out borrower Term Repo rollover instructions

*This contract belongs to the Term Servicer group of contracts and is specific to a Term Repo deployment*

### ADMIN\_ROLE

```solidity
bytes32 ADMIN_ROLE
```

### DEVOPS\_ROLE

```solidity
bytes32 DEVOPS_ROLE
```

### INITIALIZER\_ROLE

```solidity
bytes32 INITIALIZER_ROLE
```

### ROLLOVER\_BID\_FULFILLER\_ROLE

```solidity
bytes32 ROLLOVER_BID_FULFILLER_ROLE
```

### termRepoId

```solidity
bytes32 termRepoId
```

### termRepoCollateralManager

```solidity
contract ITermRepoCollateralManager termRepoCollateralManager
```

### termRepoServicer

```solidity
contract ITermRepoServicer termRepoServicer
```

### termController

```solidity
contract ITermController termController
```

### emitter

```solidity
contract ITermEventEmitter emitter
```

### approvedRolloverAuctions

```solidity
mapping(address => bool) approvedRolloverAuctions
```

### rolloverElections

```solidity
mapping(address => struct TermRepoRolloverElection) rolloverElections
```

### termContractPaired

```solidity
bool termContractPaired
```

### whileNotMatured

```solidity
modifier whileNotMatured()
```

### notTermContractPaired

```solidity
modifier notTermContractPaired()
```

### constructor

```solidity
constructor() public
```

### initialize

```solidity
function initialize(string termRepoId_, contract ITermRepoServicer termRepoServicer_, contract ITermRepoCollateralManager termRepoCollateralManager_, contract ITermController termController_, address termInitializer_) external
```

### pairTermContracts

```solidity
function pairTermContracts(address termRepoServicer_, contract ITermEventEmitter emitter_, address devopsMultisig_, address adminWallet_) external
```

### electRollover

```solidity
function electRollover(struct TermRepoRolloverElectionSubmission termRepoRolloverElectionSubmission) external
```

An external function that accepted Term Repo rollover instructions

#### Parameters

| Name                               | Type                                      | Description                                        |
| ---------------------------------- | ----------------------------------------- | -------------------------------------------------- |
| termRepoRolloverElectionSubmission | struct TermRepoRolloverElectionSubmission | A struct containing borrower rollover instructions |

### getRolloverInstructions

```solidity
function getRolloverInstructions(address borrower) external view returns (struct TermRepoRolloverElection)
```

A view function that returns borrower rollover instructions

#### Parameters

| Name     | Type    | Description                 |
| -------- | ------- | --------------------------- |
| borrower | address | The address of the borrower |

#### Return Values

| Name | Type                            | Description                                        |
| ---- | ------------------------------- | -------------------------------------------------- |
| \[0] | struct TermRepoRolloverElection | A struct containing borrower rollover instructions |

### cancelRollover

```solidity
function cancelRollover() external
```

An external function to cancel previously submitted rollover instructions

### fulfillRollover

```solidity
function fulfillRollover(address borrower) external
```

An external function called by repo servicer to mark rollover as fulfilled

#### Parameters

| Name     | Type    | Description                 |
| -------- | ------- | --------------------------- |
| borrower | address | The address of the borrower |

### approveRolloverAuction

```solidity
function approveRolloverAuction(contract ITermAuctionBidLocker auctionBidLocker, address termAuction) external
```

#### Parameters

| Name             | Type                           | Description                                                          |
| ---------------- | ------------------------------ | -------------------------------------------------------------------- |
| auctionBidLocker | contract ITermAuctionBidLocker | The ABI for ITermAuctionBidLocker interface                          |
| termAuction      | address                        | The address of TermAuction contract to mark as eligible for rollover |

### revokeRolloverApproval

```solidity
function revokeRolloverApproval(contract ITermAuctionBidLocker auctionBidLocker) external
```

#### Parameters

| Name             | Type                           | Description                                 |
| ---------------- | ------------------------------ | ------------------------------------------- |
| auctionBidLocker | contract ITermAuctionBidLocker | The ABI for ITermAuctionBidLocker interface |

### \_processRollover

```solidity
function _processRollover(address borrowerToRollover) internal
```

### \_authorizeUpgrade

```solidity
function _authorizeUpgrade(address impl) internal
```

*required override by the OpenZeppelin UUPS module*

#### Parameters

| Name | Type    | Description                        |
| ---- | ------- | ---------------------------------- |
| impl | address | new impl address for proxy upgrade |
