Functionality
General Functions
Functions List
Function Name
Description
Read Functions
getCollateralToken(...)
Gets a collateral token’s enabled
status when provided with a token address.
getAccountCollateralBalance(...)
Gets the token available and reserved balances of an account when provided with an account address and a token address.
getCollateralReservation(...)
Gets details of a collateral reservation when provided with the reservation id.
getClaimableAmount(...)
Gets the claimable amount when provided with a collateral reservation id.
getCollateralizableTokenAllowance(...)
Gets the token allowance when provided with an account address, a Collateralizable Contract address, and a token address.
getWithdrawalFeeBasisPoints(...)
Gets the current protocol withdrawal fee in basis points.
Note: Collateral reservations may be subject to a different previously captured withdrawal fee value from the time of creation.
supportsInterface(...)
Gets whether the Collateral Vault supports an interface given the interface id.
Write Functions
claimCollateral(...)
Claims some or all of the collateral of a reservation to a provided address. Used by pool claimants and LOC beneficiaries.
depositAndApprove(...)
Allows a Collateralizable Contract to handle both token allowance approval and depositToAccount(...)
steps in the same call since they are both necessary to accomplish a deposit.
depositFromAccount(...)
Used by Time Based Collateral Pool for its depositAndStake(...)
function whereby the pool can have a users’ collateral transferred into its vault account and then added to a collateral reservation for staking provided it has user authorization.
depositToAccount(...)
Allows users to deposit collateral into the vault as well as allows for other calling vaults to transfer user collateral via the ICollateralDepositTarget interface in the case of vault upgrades.
modifyCollateralizableTokenAllowance(...)
Used by Collateralizable Contracts to modify the contracts token allowance from the user provided the contract address, token address, and the amount (positive or negative) by which the allowance will be modified.
modifyCollateralizableTokenAllowanceWithSignature(...)
Same as modifyCollateralizableTokenAllowance(...)
above but more explicit whereby the user signs the data to process the allowance change including the Collateralizable Contract address which the allowance modification is targeting. This is used by Letter Of Credit and Time Based Collateral Pool.
modifyCollateralReservation(...)
Allows a Collateralizable Contract to modify a collateral reservation when provided with the reservation id and the (positive or negative) amount to change. This function is utilized by Letter Of Credit when a user modifies their LOC’s collateral and by Time Based Collateral Pool for staking and unstaking.
poolCollateral(...)
Called by Time Based Collateral Pool when a user stakes collateral from their vault account into a pool instance. This transfers the provided token and amount from the users account to the pool instance’s account within the vault.
releaseAllCollateral(...)
Collateralizable Contracts call this function to remove a collateral reservation and adjust the account’s available and reserved balances accordingly. This is utilized by Letter Of Credit when a LOC is canceled and by Time Based Collateral Pool when a pool instance is reset.
reserveClaimableCollateral(...)
reserveCollateral(...)
Similar to reserveClaimableCollateral(...)
. Creates a collateral reservation when provided with the reserving account, token, and the total amount to be reserved. The function will calculate the claimable amount after deducting the fee.
transferCollateral(...)
Transfers available collateral from one vault account to another when provided with the origin address, destination address, token and amount. This transfer will not incur a fee. This function is also leveraged by Time Based Collateral Pool when moving a pool participant’s funds into the pool instance account for the purpose of staking.
upgradeAccount(...)
Moves the user’s collateral from the current vault to a new approved collateral vault (see: Permitted Collateral Upgrade Contracts) that has implemented the ICollateralDepositTarget interface. Accepts multiple pairings of tokens and their amounts to be moved. Can only be done by the account sender.
withdraw(...)
Withdraws sender’s funds from the vault to an external address when provided with the token, amount, and destination. The current protocol withdrawal fee will be subtracted from the withdrawal amount.
Governance
These are functions that can only be performed via the execution of a successful Governance proposal (see: Proposal Process). They are decorated in the published contract code with the onlyOwner
modifier.
Function List
Function Name
Description
upsertCollateralizableContractApprovals(...)
Updates the approval status of one or more Collateralizable Contracts. Used when upgrading contracts, expanding the protocol, adding new Time Based Collateral Pool instances (proxies), and removing support for existing contracts.
upsertCollateralTokens(...)
Updates the status of collateral tokens that are approved for use. Used when adding new token support and removing support for existing tokens.
upsertCollateralUpgradeContractApproval(...)
Updates the approval status of a ICollateralDepositTarget contract that may be sent an account's available collateral upon the account’s request. Used when upgrading to a new Collateral Vault contract.
withdrawFromProtocolBalance(...)
Withdraws unaccounted for token balances to a desired address. Used to send amassed protocol fees and errant token transfers to the destination of Governance’s choice.
Interfaces
ICollateral
Functionality to be used by approved Collateralizable Contracts when interacting on users’ behalf. These functions deal with reading vault settings, performing CRUD operations on collateral reservations, and modifying token allowances.
Supported Functions
Read Functions
getCollateralToken(...)
getAccountCollateralBalance(...)
getCollateralReservation(...)
getClaimableAmount(...)
getCollateralizableTokenAllowance(...)
getWithdrawalFeeBasisPoints(...)
Write Functions
claimCollateral(...)
depositFromAccount(...)
modifyCollateralizableTokenAllowance(...)
modifyCollateralizableTokenAllowanceWithSignature(...)
modifyCollateralReservation(...)
poolCollateral(...)
releaseAllCollateral(...)
reserveClaimableCollateral(...)
reserveCollateral(...)
transferCollateral(...)
withdraw(...)
ICollateralDepositTarget
Interface with only one function allowing the deposit of assets into a new ICollateral contract for benefit of a specified account.
Supported Functions
depositToAccount(...)
Last updated