BaseCurrency
This contract is an abstraction for any ERC20 token to convert any value to a USDC equivalency for market calculations.
erc20
constructor
Constructor sets the address for the ERC20 token.
Parameters
_erc20
address
The address of the ERC20 token to be used as the currency.
getERC20
Returns the ERC20 token that is being used as the currency.
Return Values
[0]
contract IERC20
The ERC20 token being used as the currency.
supportsInterface
Checks if the contract implements an interface.
Parameters
_interfaceId
bytes4
The ID of the interface.
Return Values
[0]
bool
True if the contract implements the interface, false otherwise.
getEstimatedUSDCValue
Returns the estimated value in USDC of an amount of the currency.
This function is virtual and must be implemented in child contracts.
Parameters
_amount
uint256
The amount of currency to estimate the value of.
Return Values
[0]
uint256
The estimated value in USDC of the specified amount of currency.
Last updated