FeeConverter
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
Name | Type | Description |
---|---|---|
exchangeHelper | address | exchange helper address |
getTreasury
get the treasury address and treasuryShare
function getTreasury() external view returns (address treasury, UD60x18 treasuryShare);
Returns
Name | Type | Description |
---|---|---|
treasury | address | treasury address |
treasuryShare | UD60x18 | treasury 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
Name | Type | Description |
---|---|---|
account | address | The account for which to set new authorization status |
isAuthorized | bool | Whether 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
Name | Type | Description |
---|---|---|
sourceToken | address | address of token to convert |
callee | address | exchange address to call to execute the trade. |
allowanceTarget | address | address for which to set allowance for the trade |
data | bytes | calldata 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
Name | Type | Description |
---|---|---|
vault | address | address of the ERC4626 vault to redeem from |
shareAmount | uint256 | quantity of shares to redeem |
Returns
Name | Type | Description |
---|---|---|
assetAmount | uint256 | quantity of assets received |