> For the complete documentation index, see [llms.txt](https://dev.bondprotocol.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.bondprotocol.finance/smart-contracts/bond-system/teller/fixed-expiry-teller.md).

# Fixed-Expiry Teller

The [Fixed Expiry Teller](https://github.com/Bond-Protocol/bond-contracts/blob/master/src/BondFixedExpiryTeller.sol) is an implementation of the [Base Teller](/smart-contracts/bond-system/teller/base-teller.md) contract specific to handling user bond transactions and tokenizing bond markets where all purchases vest at the same timestamp as ERC20 tokens. It implements the functions required by the [Fixed-Expiry Teller Interface](/smart-contracts/bond-system/teller/teller-interfaces.md#fixed-expiry-teller-interface).&#x20;

Specifically, it implements the `_handlePayout` function to mint ERC20 tokens to the user to represent their bond position during a purchase.&#x20;

Additionally, it implements the `deploy` (deploys new ERC20 token contract if one does not exist for a combination of underlying token and the maturity date), `create` (allows anyone to mint Bond Tokens for a combination of an underlying token and maturity date by paying a fee to the protocol), and `redeem` (redeems ERC20 Bond Tokens that have vested for the underlying token).&#x20;

By design, the tokenization of the Teller is not permissioned. This allows other participants to use the same ERC20 Bond Tokens that Bond Protocol is issuing to create a standard in the market and drive additional liquidity.

## Methods

This section only includes methods not inherited from [Base Teller](/smart-contracts/bond-system/teller/base-teller.md).

### bondTokenImplementation

```solidity
function bondTokenImplementation() external view returns (contract ERC20BondToken)
```

ERC20BondToken reference implementation (deployed on creation to clone from)

#### Returns

| Name      | Type                    | Description                                                                          |
| --------- | ----------------------- | ------------------------------------------------------------------------------------ |
| reference | contract ERC20BondToken | reference address that each ERC20 bond token proxies to (using a Clone architecture) |

### bondTokens

```solidity
function bondTokens(contract ERC20, uint48) external view returns (contract ERC20BondToken)
```

ERC20 bond tokens (unique to a underlying and expiry)

#### Parameters

| Name       | Type           | Description                           |
| ---------- | -------------- | ------------------------------------- |
| underlying | contract ERC20 | Address of the underlying ERC20 token |
| expiry     | uint48         | Expiry of the bond token              |

#### Returns

| Name      | Type                    | Description                     |
| --------- | ----------------------- | ------------------------------- |
| bondToken | contract ERC20BondToken | Address of the ERC20 bond token |

### create

```solidity
function create(contract ERC20 underlying_, uint48 expiry_, uint256 amount_) external nonpayable returns (contract ERC20BondToken, uint256)
```

Deposit an ERC20 token and mint a future-dated ERC20 bond token

#### Parameters

| Name         | Type           | Description                                                                |
| ------------ | -------------- | -------------------------------------------------------------------------- |
| underlying\_ | contract ERC20 | ERC20 token redeemable when the bond token vests                           |
| expiry\_     | uint48         | Timestamp at which the bond token can be redeemed for the underlying token |
| amount\_     | uint256        | Amount of underlying tokens to deposit                                     |

#### Returns

| Name      | Type                    | Description                              |
| --------- | ----------------------- | ---------------------------------------- |
| bondToken | contract ERC20BondToken | Address of the ERC20 bond token received |
| amountOut | uint256                 | Amount of the ERC20 bond token received  |

### deploy

```solidity
function deploy(contract ERC20 underlying_, uint48 expiry_) external nonpayable returns (contract ERC20BondToken)
```

Deploy a new ERC20 bond token for an (underlying, expiry) pair and return its address

*ERC20 used for fixed-expiryIf a bond token exists for the (underlying, expiry) pair, it returns that address*

#### Parameters

| Name         | Type           | Description                                                                |
| ------------ | -------------- | -------------------------------------------------------------------------- |
| underlying\_ | contract ERC20 | ERC20 token redeemable when the bond token vests                           |
| expiry\_     | uint48         | Timestamp at which the bond token can be redeemed for the underlying token |

#### Returns

| Name      | Type                    | Description                                   |
| --------- | ----------------------- | --------------------------------------------- |
| bondToken | contract ERC20BondToken | Address of the ERC20 bond token being created |

### getBondTokenForMarket

```solidity
function getBondTokenForMarket(uint256 id_) external view returns (contract ERC20BondToken)
```

Get the OlympusERC20BondToken contract corresponding to a market

#### Parameters

| Name | Type    | Description      |
| ---- | ------- | ---------------- |
| id\_ | uint256 | ID of the market |

#### Returns

| Name      | Type                    | Description                     |
| --------- | ----------------------- | ------------------------------- |
| bondToken | contract ERC20BondToken | ERC20BondToken contract address |

### redeem

```solidity
function redeem(contract ERC20BondToken token_, uint256 amount_) external nonpayable
```

Redeem a fixed-expiry bond token for the underlying token (bond token must have matured)

#### Parameters

| Name     | Type                    | Description      |
| -------- | ----------------------- | ---------------- |
| token\_  | contract ERC20BondToken | Token to redeem  |
| amount\_ | uint256                 | Amount to redeem |

## Events

### ERC20BondTokenCreated

```solidity
event ERC20BondTokenCreated(contract ERC20BondToken bondToken, contract ERC20 indexed underlying, uint48 indexed expiry)
```

#### Parameters

| Name                 | Type                    | Description                                                            |
| -------------------- | ----------------------- | ---------------------------------------------------------------------- |
| bondToken            | contract ERC20BondToken | Address of the bond token                                              |
| underlying `indexed` | contract ERC20          | Address of the underlying ERC20 token                                  |
| expiry `indexed`     | uint48                  | Timestamp when the bond token can be redeemed for the underlying token |
