description |
---|
This factory contract issues new bond contracts. |
Emitted when a new bond is created.
address | newBond |
---|---|
string | name |
string | symbol |
address indexed |
owner |
uint256 | maturity |
address indexed |
paymentToken |
address indexed |
collateralToken |
uint256 | collateralTokenAmount |
uint256 | convertibleTokenAmount |
uint256 | bonds |
Emitted when the restriction of bond creation to allow-listed accounts is toggled on or off.
bytes32 indexed |
role |
---|---|
bytes32 indexed |
previousAdminRole |
bytes32 indexed |
newAdminRole |
bytes32 indexed |
role |
---|---|
address indexed |
account |
address indexed |
sender |
bytes32 indexed |
role |
---|---|
address indexed |
account |
address indexed |
sender |
Emitted when the restriction of collateralToken and paymentToken to allow-listed tokens is toggled on or off.
- There must be more collateralTokens than convertibleTokens.
- Fails if the collateralToken takes a fee.
- Maturity date is not valid.
- The paymentToken and collateralToken must be different.
- Decimals with more than 18 digits are not supported.
- Bonds must be minted during initialization.
function ALLOWED_TOKEN() external view returns (bytes32)
The role given to allowed tokens.
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
function ISSUER_ROLE() external view returns (bytes32)
The role required to issue bonds.
function createBond(string name, string symbol, uint256 maturity, address paymentToken, address collateralToken, uint256 collateralTokenAmount, uint256 convertibleTokenAmount, uint256 bonds) external nonpayable returns (address clone)
Creates a new Bond. The calculated ratios are rounded down.
string | name | Passed into the ERC20 token to define the name. |
---|---|---|
string | symbol | Passed into the ERC20 token to define the symbol. |
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 | collateralTokenAmount | The amount of collateral tokens per bond. |
uint256 | convertibleTokenAmount | The amount of convertible tokens per bond. |
uint256 | bonds | The amount of Bonds given to the owner during the one-time mint during the `Bond`'s `initialize`. |
function getRoleAdmin(bytes32 role) external view returns (bytes32)
function grantRole(bytes32 role, address account) external nonpayable
bytes32 | role |
---|---|
address | account |
function hasRole(bytes32 role, address account) external view returns (bool)
bytes32 | role |
---|---|
address | account |
function isBond(address) external view returns (bool)
Returns whether or not the given address key is a bond created by this Bond factory.
function isIssuerAllowListEnabled() external view returns (bool)
If enabled, issuance is restricted to those with ISSUER_ROLE.
function isTokenAllowListEnabled() external view returns (bool)
If enabled, tokens used as paymentToken and collateralToken are restricted to those with the ALLOWED_TOKEN role.
function renounceRole(bytes32 role, address account) external nonpayable
bytes32 | role |
---|---|
address | account |
function revokeRole(bytes32 role, address account) external nonpayable
bytes32 | role |
---|---|
address | account |
function setIsIssuerAllowListEnabled(bool _isIssuerAllowListEnabled) external nonpayable
Sets the state of bond restriction to allow-listed accounts.
function setIsTokenAllowListEnabled(bool _isTokenAllowListEnabled) external nonpayable
Sets the state of token restriction to the list of allowed tokens.
function supportsInterface(bytes4 interfaceId) external view returns (bool)
function tokenImplementation() external view returns (address)
Address where the bond implementation contract is stored.