ICurrencyConverter
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
Name | Type | Description |
---|---|---|
usdAmount | uint256 | the amount of USD received |
Returns
Name | Type | Description |
---|---|---|
wonAmount | uint256 | the amount of WON to give |
convertToUSD
constructor guarantees 18 = won decimals >= usd decimals
function convertToUSD(uint256 wonAmount) external view returns (uint256 usdAmount);
Parameters
Name | Type | Description |
---|---|---|
wonAmount | uint256 | the amount of WON received |
Returns
Name | Type | Description |
---|---|---|
usdAmount | uint256 | the amount of USD to give |
Errors
InvalidTargetDecimals
error InvalidTargetDecimals();