Skip to main content

SablierV2Comptroller

Git Source

Inherits: ISablierV2Comptroller, Adminable

See the documentation in ISablierV2Comptroller.

State Variables

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.
UD60x18 public override flashFee;

isFlashAsset

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

mapping(IERC20 asset => bool supported) public override isFlashAsset;

protocolFees

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

mapping(IERC20 asset => UD60x18 fee) public override protocolFees;

Functions

constructor

Emits a {TransferAdmin} event.

constructor(address initialAdmin);

Parameters

NameTypeDescription
initialAdminaddressThe address of the initial contract admin.

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 override onlyAdmin;

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 override onlyAdmin;

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 override onlyAdmin;

Parameters

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