Skip to content

IBalanceFacet

The BalanceFacet contract interface

This contract allows for the management of certificate balances

Returns the balance of a certificate

function balanceOf(uint256 certificateId) external view returns (uint256 balance);

Parameters

NameTypeDescription
certificateIduint256The Certificate ID to get the balance for

Returns

NameTypeDescription
balanceuint256The balance of the certificate

Deposits tokens in the pool to earn rewards

function deposit(uint256 certificateId, uint256 amount) external;

Parameters

NameTypeDescription
certificateIduint256The Certificate to deposit tokens for
amountuint256The amount of tokens to 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

NameTypeDescription
certificateIduint256The Certificate to deposit tokens for
amountuint256The amount of tokens to deposit
ignoreEarlyWithdrawalboolWhether to ignore the early withdrawal period
ignoreTransferFromboolWhether to ignore the transferFrom call

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

NameTypeDescription
certificateIduint256The Certificate ID to deposit tokens for
amountuint256The amount of tokens to deposit

Withdraws tokens from the pool

function withdraw(
uint256 certificateId,
uint256 desiredAmount
)
external
returns (uint256 withdrawAmount);

Parameters

NameTypeDescription
certificateIduint256The Certificate to withdraw tokens from
desiredAmountuint256The amount of tokens to withdraw

Returns

NameTypeDescription
withdrawAmountuint256The amount of tokens actually withdrawn after fees

Withdraws tokens from the pool

function withdraw(
uint256 certificateId,
uint256 amount,
address overrideRecipient
)
external
returns (uint256 withdrawAmount);

Parameters

NameTypeDescription
certificateIduint256The Certificate to withdraw tokens from
amountuint256The amount of tokens to withdraw
overrideRecipientaddressThe address to send the tokens to

Returns

NameTypeDescription
withdrawAmountuint256The amount of tokens actually withdrawn after fees

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

NameTypeDescription
certificateIduint256The Certificate ID to check the minimum deposit for
amountuint256The amount to check against the minimum deposit