FeeConverter

Git Source

Inherits: IFeeConverter, OwnableInternal, ReentrancyGuard

Author: Premia

State Variables

EXCHANGE_HELPER

address private immutable EXCHANGE_HELPER;

USDC

address private immutable USDC;

VX_PREMIA

address private immutable VX_PREMIA;

Functions

onlyAuthorized

modifier onlyAuthorized();

isInitialized

modifier isInitialized();

constructor

constructor(address exchangeHelper, address usdc, address vxPremia);

receive

receive() external payable;

getExchangeHelper

get the exchange helper address

function getExchangeHelper() external view returns (address exchangeHelper);

Returns

NameTypeDescription
exchangeHelperaddressexchange helper address

getTreasury

get the treasury address and treasuryShare

function getTreasury() external view returns (address treasury, UD60x18 treasuryShare);

Returns

NameTypeDescription
treasuryaddresstreasury address
treasuryShareUD60x18treasury share (The % of funds allocated to the treasury address)

setAuthorized

Set authorization for address to use the convert function

function setAuthorized(address account, bool isAuthorized) external onlyOwner;

Parameters

NameTypeDescription
accountaddressThe account for which to set new authorization status
isAuthorizedboolWhether the account is authorized or not

setTreasury

Set a new treasury address, and its share (The % of funds allocated to the treasury address)

function setTreasury(address newTreasury, UD60x18 newTreasuryShare) external onlyOwner;

convert

convert held tokens to USDC and distribute as rewards

function convert(address sourceToken, address callee, address allowanceTarget, bytes calldata data)
    external
    isInitialized
    nonReentrant
    onlyAuthorized;

Parameters

NameTypeDescription
sourceTokenaddressaddress of token to convert
calleeaddressexchange address to call to execute the trade.
allowanceTargetaddressaddress for which to set allowance for the trade
databytescalldata to execute the trade

redeem

Redeem shares from an ERC4626 vault

function redeem(address vault, uint256 shareAmount)
    external
    isInitialized
    nonReentrant
    onlyAuthorized
    returns (uint256 assetAmount);

Parameters

NameTypeDescription
vaultaddressaddress of the ERC4626 vault to redeem from
shareAmountuint256quantity of shares to redeem

Returns

NameTypeDescription
assetAmountuint256quantity of assets received