Skip to main content

ISablierV2Comptroller

Git Source

Inherits: IAdminable

This contract is in charge of the Sablier V2 protocol configuration, handling such values as the protocol fees.

Functions

flashFee

Retrieves the global flash fee, denoted as a fixed-point number where 1e18 is 100%.

Notes:

  • This fee represents a percentage, not an amount. Do not confuse it with {IERC3156FlashLender.flashFee}, which calculates the fee amount for a specified flash loan amount.
  • Unlike the protocol fee, this is a global fee applied to all flash loans, not a per-asset fee.
function flashFee() external view returns (UD60x18 fee);

isFlashAsset

Retrieves a flag indicating whether the provided ERC-20 asset can be flash loaned.

function isFlashAsset(IERC20 token) external view returns (bool result);

Parameters

NameTypeDescription
tokenIERC20The contract address of the ERC-20 asset to check.

protocolFees

Retrieves the protocol fee for all streams created with the provided ERC-20 asset.

function protocolFees(IERC20 asset) external view returns (UD60x18 fee);

Parameters

NameTypeDescription
assetIERC20The contract address of the ERC-20 asset to query.

Returns

NameTypeDescription
feeUD60x18The protocol fee denoted as a fixed-point number where 1e18 is 100%.

setFlashFee

Updates the flash fee charged on all flash loans made with any ERC-20 asset.

Emits a {SetFlashFee} event. Notes:

  • Does not revert if the fee is the same. Requirements:
  • msg.sender must be the contract admin.
function setFlashFee(UD60x18 newFlashFee) external;

Parameters

NameTypeDescription
newFlashFeeUD60x18The new flash fee to set, denoted as a fixed-point number where 1e18 is 100%.

setProtocolFee

Sets a new protocol fee that will be charged on all streams created with the provided ERC-20 asset.

Emits a {SetProtocolFee} event. Notes:

  • The fee is not denoted in units of the asset's decimals; it is a fixed-point number. Refer to the PRBMath documentation for more detail on the logic of UD60x18.
  • Does not revert if the fee is the same. Requirements:
  • msg.sender must be the contract admin.
function setProtocolFee(IERC20 asset, UD60x18 newProtocolFee) external;

Parameters

NameTypeDescription
assetIERC20The contract address of the ERC-20 asset to update the fee for.
newProtocolFeeUD60x18The new protocol fee, denoted as a fixed-point number where 1e18 is 100%.

toggleFlashAsset

Toggles the flash loanability of an ERC-20 asset.

Emits a {ToggleFlashAsset} event. Requirements:

  • msg.sender must be the admin.
function toggleFlashAsset(IERC20 asset) external;

Parameters

NameTypeDescription
assetIERC20The address of the ERC-20 asset to toggle.

Events

SetFlashFee

Emitted when the admin sets a new flash fee.

event SetFlashFee(address indexed admin, UD60x18 oldFlashFee, UD60x18 newFlashFee);

SetProtocolFee

Emitted when the admin sets a new protocol fee for the provided ERC-20 asset.

event SetProtocolFee(address indexed admin, IERC20 indexed asset, UD60x18 oldProtocolFee, UD60x18 newProtocolFee);

ToggleFlashAsset

Emitted when the admin enables or disables an ERC-20 asset for flash loaning.

event ToggleFlashAsset(address indexed admin, IERC20 indexed asset, bool newFlag);