Exchange Agent

Exchange Agent contract contains all the information and functions for which enables CoverCompared to take payment in multiple currencies even though our partners may take payments in limited forms.

Get Token Amount For USDC

To enable payments using an ERC20 token the getTokenAmountForUSDC function is called to know the amount of tokens required against USDC to enable payment.

  function getTokenAmountForUSDC(address _token, uint256 _desiredAmount)

Input variables :

  • _token : refers to the ERC20 token being accepted as payment

  • _desiredAmount : desired USDC amount

Get Token Amount for ETH

To enable payments using an ERC20 token the getTokenAmountForETH function is called to know the amount of tokens required against ETH to enable payment.

 function getTokenAmountForETH(address _token, uint256 _desiredAmount)

Input variables :

  • _token : refers to the ERC20 token being accepted as payment

  • _desiredAmount : desired ETH amount

Last updated