Variable Token and Variable Balance
If it is impossible to complete the exchange for the desired token on the destination chain, the user is credited with the variable balance, according to which the user will be able to receive a stablecoin or variable token in a quantity equal to the amount of the exchange.
Variable balances are stored in the VariableBalanceRecords contract and can be retrieved through the main contract (ActionExecutor).
Receiving stablecoin by variable token balance is done through ActionExecutor by calling the convertVariableBalanceToVaultAsset function. At the same time, the ActionExecutor requests the required amount from the Vault contract.
To allow the user to receive a Variable Token based on their Variable Balance, the function claimVariableToken is used in the ActionExecutor contract. At the same time, a Variable Token is minted.
To exchange Variable Token for a stablecoin, the function redeemVariableToken is used in the Vault contract. At the same time, the Variable Token is burned.
The support of Variable Token in the system can be enabled or disabled by the Manager through the function setVariableToken in the Vault contract. If a zero address is set, the token is disabled.
The Variable Balance is accrued on the destination chain.
If the swap fails on the origin network, the transaction will fail and the user will receive back his asset.
Last updated