Bond
A custom ERC20 token that can be used to issue bonds.The contract handles issuance, payment, conversion, and redemption.
Last updated
A custom ERC20 token that can be used to issue bonds.The contract handles issuance, payment, conversion, and redemption.
Last updated
Emitted when collateral is withdrawn.
Emitted when bond shares are converted by a Bond holder.
Emitted when payment over the required amount is withdrawn.
Emitted when a portion of the Bond's principal is paid.
Emitted when a bond share is redeemed.
Emitted when a token is swept by the contract owner.
Bond redemption is impossible because the grace period has not yet passed and the bond has not been fully paid.
Operation restricted because the Bond has matured.
Attempted to withdraw with no excess payment in the contract.
Attempted to withdraw more collateral than available.
Attempted to pay after payment was met.
Attempted to sweep a token used in the contract.
Attempted to perform an action that would do nothing.
The amount of paymentTokens required to fully pay the contract.
The external balance of the ERC20 collateral token.
The number of collateralTokens per Bond.
The ERC20 token used as collateral backing the bond.
For convertible Bonds (ones with a convertibilityRatio > 0), the Bond holder may convert their bond to underlying collateral at the convertibleRatio. The bond must also have not past maturity for this to be possible.
The number of convertibleTokens the bonds will convert into.
One week after the maturity date. Bond collateral can be redeemed after this date.
This one-time setup initiated by the BondFactory initializes the Bond with the given configuration.
Checks if the maturity timestamp has passed.
A date set at Bond creation when the Bond will mature.
Allows the owner to pay the bond by depositing paymentTokens.
Gets the external balance of the ERC20 paymentToken.
This is the token the borrower deposits into the contract and what the Bond holders will receive when redeemed.
Before maturity, if the given bonds are converted, this would be the number of collateralTokens received. This function rounds down the number of returned collateral.
At maturity, if the given bond shares are redeemed, this would be the number of collateralTokens and paymentTokens received by the bond holder. The number of paymentTokens to receive is rounded down.
The number of collateralTokens that the owner would be able to withdraw from the contract. This does not take into account an amount of payment like previewWithdrawExcessCollateralAfterPayment
does. See that function for more information.
The number of collateralTokens that the owner would be able to withdraw from the contract. This function rounds up the number of collateralTokens required in the contract and therefore may round down the amount received.
The number of excess paymentTokens that the owner would be able to withdraw from the contract.
The Bond holder can burn bond shares in return for their portion of paymentTokens and collateralTokens backing the Bonds. These portions of tokens depends on the number of paymentTokens deposited. When the Bond is fully paid, redemption will result in all paymentTokens. If the Bond has reached maturity without being fully paid, a portion of the collateralTokens will be available.
Sends ERC20 tokens to the owner that are in this contract.
The Owner may withdraw excess collateral from the Bond contract. The number of collateralTokens remaining in the contract must be enough to cover the total supply of Bonds in accordance to both the collateralRatio and convertibleRatio.
The owner can withdraw any excess paymentToken in the contract.
address | from |
---|---|
address | owner |
---|---|
address | spender |
---|---|
address | account |
---|---|
address | spender |
---|---|
address | spender |
---|---|
string | bondName | Passed into the ERC20 token to define the name. |
---|---|---|
uint256 | The number of paymentTokens that the bond shares would be redeemed for. |
---|---|
contract IERC20Metadata | sweepingToken | The ERC20 token to sweep and send to the receiver. |
---|---|---|
address | to |
---|---|
address | from |
---|---|
uint256 | amount | The number of collateralTokens to withdraw. Reverts if the amount is greater than available in the contract. |
---|---|---|
address indexed
owner
address indexed
spender
uint256
value
address indexed
from
address indexed
receiver
address indexed
token
uint256
amount
address indexed
from
address indexed
collateralToken
uint256
amountOfBondsConverted
uint256
amountOfCollateralTokens
address indexed
from
address indexed
receiver
address indexed
token
uint256
amount
address indexed
previousOwner
address indexed
newOwner
address indexed
from
uint256
amount
address indexed
from
address indexed
paymentToken
address indexed
collateralToken
uint256
amountOfBondsRedeemed
uint256
amountOfPaymentTokensReceived
uint256
amountOfCollateralTokens
address indexed
receiver
contract IERC20Metadata
token
uint256
amount
address indexed
from
address indexed
to
uint256
value
address
spender
uint256
amount
uint256
amount
uint256
subtractedValue
uint256
addedValue
string
bondSymbol
Passed into the ERC20 token to define the symbol.
address
bondOwner
Ownership of the created Bond is transferred to this address by way of _transferOwnership and also the address that tokens are minted to. See `initialize` in `Bond`.
uint256
_maturity
The timestamp at which the Bond will mature.
address
_paymentToken
The ERC20 token address the Bond is redeemable for.
address
_collateralToken
The ERC20 token address the Bond is backed by.
uint256
_collateralRatio
The amount of collateral tokens per bond.
uint256
_convertibleRatio
The amount of convertible tokens per bond.
uint256
maxSupply
The amount of Bonds given to the owner during the one- time mint during this initialization.
uint256
The number of collateralTokens that would be redeemed for.
address
receiver
The address that is transferred the swept token.
uint256
amount
address
to
uint256
amount
address
receiver
The address transferred the excess collateralTokens.