ICurrencyConverter

Git Source

Functions

setExchangeRate

set the exchange rate between WON and USD

the caller is contract keeper

function setExchangeRate(uint256 _exchangeRate) external;

getExchangeRate

get the exchange rate between WON and USD

function getExchangeRate() external returns (uint256, uint256);

convertFromUSD

constructor guarantees 18 = won decimals >= usd decimals

function convertFromUSD(uint256 usdAmount) external view returns (uint256 wonAmount);

Parameters

NameTypeDescription
usdAmountuint256the amount of USD received

Returns

NameTypeDescription
wonAmountuint256the amount of WON to give

convertToUSD

constructor guarantees 18 = won decimals >= usd decimals

function convertToUSD(uint256 wonAmount) external view returns (uint256 usdAmount);

Parameters

NameTypeDescription
wonAmountuint256the amount of WON received

Returns

NameTypeDescription
usdAmountuint256the amount of USD to give

Errors

InvalidTargetDecimals

error InvalidTargetDecimals();