IBalanceFacet
The BalanceFacet contract interface
This contract allows for the management of certificate balances
Functions
Section titled “Functions”balanceOf
Section titled “balanceOf”Returns the balance of a certificate
function balanceOf(uint256 certificateId) external view returns (uint256 balance);Parameters
| Name | Type | Description |
|---|---|---|
certificateId | uint256 | The Certificate ID to get the balance for |
Returns
| Name | Type | Description |
|---|---|---|
balance | uint256 | The balance of the certificate |
deposit
Section titled “deposit”Deposits tokens in the pool to earn rewards
function deposit(uint256 certificateId, uint256 amount) external;Parameters
| Name | Type | Description |
|---|---|---|
certificateId | uint256 | The Certificate to deposit tokens for |
amount | uint256 | The amount of tokens to deposit |
deposit
Section titled “deposit”Deposits tokens in the pool to earn rewards
This function is only callable by the contract itself
function deposit( uint256 certificateId, uint256 amount, bool ignoreEarlyWithdrawal, bool ignoreTransferFrom) external;Parameters
| Name | Type | Description |
|---|---|---|
certificateId | uint256 | The Certificate to deposit tokens for |
amount | uint256 | The amount of tokens to deposit |
ignoreEarlyWithdrawal | bool | Whether to ignore the early withdrawal period |
ignoreTransferFrom | bool | Whether to ignore the transferFrom call |
depositFor
Section titled “depositFor”Deposits tokens in the pool to earn rewards in behalf of a user
This function is only callable by the project manager
function depositFor(uint256 certificateId, uint256 amount) external;Parameters
| Name | Type | Description |
|---|---|---|
certificateId | uint256 | The Certificate ID to deposit tokens for |
amount | uint256 | The amount of tokens to deposit |
withdraw
Section titled “withdraw”Withdraws tokens from the pool
function withdraw( uint256 certificateId, uint256 desiredAmount) external returns (uint256 withdrawAmount);Parameters
| Name | Type | Description |
|---|---|---|
certificateId | uint256 | The Certificate to withdraw tokens from |
desiredAmount | uint256 | The amount of tokens to withdraw |
Returns
| Name | Type | Description |
|---|---|---|
withdrawAmount | uint256 | The amount of tokens actually withdrawn after fees |
withdraw
Section titled “withdraw”Withdraws tokens from the pool
function withdraw( uint256 certificateId, uint256 amount, address overrideRecipient) external returns (uint256 withdrawAmount);Parameters
| Name | Type | Description |
|---|---|---|
certificateId | uint256 | The Certificate to withdraw tokens from |
amount | uint256 | The amount of tokens to withdraw |
overrideRecipient | address | The address to send the tokens to |
Returns
| Name | Type | Description |
|---|---|---|
withdrawAmount | uint256 | The amount of tokens actually withdrawn after fees |
enforceMinimumDeposit
Section titled “enforceMinimumDeposit”Enforces that the minimum deposit is reached for other facets
This function will revert if the minimum deposit is not reached
function enforceMinimumDeposit(uint256 certificateId, uint256 amount) external view;Parameters
| Name | Type | Description |
|---|---|---|
certificateId | uint256 | The Certificate ID to check the minimum deposit for |
amount | uint256 | The amount to check against the minimum deposit |