RiskFund

RiskFundV2

Contract with basic features to track/hold different assets for different Comptrollers.

Solidity API

sweepToken

Function to sweep baseAsset for pool; Tokens are sent to address(to)

function sweepToken(address tokenAddress, address to, uint256 amount) external

Parameters

NameTypeDescription

tokenAddress

address

Address of the asset(token)

to

address

Address to which assets will be transferred

amount

uint256

Amount need to sweep for the pool

📅 Events

  • Emits SweepToken event on success

⛔️ Access Requirements

  • Only Governance

❌ Errors

  • ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero

  • ZeroValueNotAllowed is thrown when amount is zero


sweepTokenFromPool

Function to sweep token from pool

function sweepTokenFromPool(address tokenAddress, address comptroller, uint256 amount) external

Parameters

NameTypeDescription

tokenAddress

address

Address of the asset(token)

comptroller

address

Pool address to which assets will be transferred

amount

uint256

Amount need to sweep from the pool

📅 Events

  • Emits sweepTokenFromPool event on success

⛔️ Access Requirements

  • Only Governance

❌ Errors

  • ZeroAddressNotAllowed is thrown when tokenAddress/comptroller address is zero

  • ZeroValueNotAllowed is thrown when amount is zero


getPoolsBaseAssetReserves

Get the Amount of the Base asset in the risk fund for the specific pool.

function getPoolsBaseAssetReserves(address comptroller) external view returns (uint256)

Parameters

NameTypeDescription

comptroller

address

Comptroller address(pool).

Return Values

NameTypeDescription

[0]

uint256

Base Asset's reserve in risk fund.


Last updated