The Fixed Term Teller is an implementation of the Bond Base Teller contract specific to handling user bond transactions and tokenizing bond markets where purchases vest in a fixed amount of time (rounded to the day) as ERC1155 tokens.It implements the functions required by the Fixed-Term Teller Interface and the Base Teller Abstract Contract.
It also inherits the ERC1155 standard and is itself the contract which provides information on the Bond Tokens it issues.
Specifically, it implements the _handlePayout
function to mint ERC1155 tokens to the user to represent their bond position during a purchase.
Additionally, it implements the deploy
(i.e. stores the metadata for a new ERC1155 token if one does not exist for a combination of underlying token and the maturity date), create
(allows anyone to mint ERC1155 Bond Tokens for a combination of an underlying token and maturity date by paying a fee to the protocol), and redeem
(redeems ERC1155 Bond Tokens that have vested for the underlying token).
By design, the tokenization of the Teller is not permissioned. This allows other market participants to use the same Bond Tokens that Bond Protocol is issuing to create a standard in the market and drive additional liquidity (less likely for ERC1155, but it is an option).
This section only includes methods not inherited from Base Teller or ERC1155.
Redeem multiple fixed-term bond tokens for the underlying tokens (bond tokens must have matured)
Name | Type | Description |
---|---|---|
Deposit an ERC20 token and mint a future-dated ERC1155 bond token
'Create' function fee discount. Amount standard fee is reduced by for partners who just want to use the 'create' function to issue bond tokens. Configurable by policy.
"Deploy" a new ERC1155 bond token for an (underlying, expiry) pair and return its ID.
Get token ID from token and expiry
Get the token name and symbol for a bond token
Redeem a fixed-term bond token for the underlying token (bond token must have matured)
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
tokenIds_
uint256[]
Array of bond token ids
amounts_
uint256[]
Array of amounts of bond tokens to redeem
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
tokenId
uint256
ID of the ERC1155 bond token received
amountOut
uint256
Amount of the ERC1155 bond token received
feeDiscount
uint48
undefined
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
tokenId
uint256
ID of the ERC1155 bond token being created
underlying_
contract ERC20
Address of the underlying token
expiry_
uint48
Expiry of the bond
tokenId
uint256
ID of the bond token
tokenId_
uint256
ID of the bond token
name
string
Bond token name
symbol
string
Bond token symbol
tokenId_
uint256
ID of the bond token to redeem
amount_
uint256
Amount of bond token to redeem
tokenId_
uint256
ID of the bond token
active
bool
Whether the bond token has been created
payoutToken
contract ERC20
Address of the underlying token
expiry
uint48
Timestamp when the bond token can be exchanged for the underlying token
supply
uint256
Total supply of the bond token
tokenId
uint256
ID of the ERC1155 bond token
payoutToken indexed
contract ERC20
Address of the underlying token
expiry indexed
uint48
Timestamp when the bond token can be redeemed for the underlying token