Skip to main content

BaseCompoundStrategy

BaseCompoundStrategy

supportsAsset

function supportsAsset(address _asset) public view returns (bool)

Retuns bool indicating whether asset is supported by strategy

Parameters

NameTypeDescription
_assetaddressAddress of the asset

_getCTokenFor

function _getCTokenFor(address _asset) internal view returns (contract ICERC20)

Get the cToken wrapped in the ICERC20 interface for this asset. Fails if the pToken doesn't exist in our mappings.

Parameters

NameTypeDescription
_assetaddressAddress of the asset

Return Values

NameTypeDescription
[0]contract ICERC20Corresponding cToken to this asset

_convertUnderlyingToCToken

function _convertUnderlyingToCToken(contract ICERC20 _cToken, uint256 _underlying) internal view returns (uint256 amount)

Converts an underlying amount into cToken amount cTokenAmt = (underlying * 1e18) / exchangeRate

Parameters

NameTypeDescription
_cTokencontract ICERC20cToken for which to change
_underlyinguint256Amount of underlying to convert

Return Values

NameTypeDescription
amountuint256Equivalent amount of cTokens