Skip to main content

CapitalAssets

CapitalAssets​

InvalidAsset​

error InvalidAsset(address assetAddress)

Thrown when an asset has been requested that does not exist

InvalidAssetWithId​

error InvalidAssetWithId(address assetAddress, uint256 assetTokenId)

Thrown when an asset has been requested that does not exist

getSupportedType​

function getSupportedType(contract Context context, address assetAddress) internal view returns (enum CapitalAssetType)

Check if a specific assetAddress has a corresponding capital asset implementation and returns the asset type. Returns INVALID if no such asset exists.

Parameters​

NameTypeDescription
contextcontract Contextgoldfinch context for routing
assetAddressaddressthe address of the asset's contract

Return Values​

NameTypeDescription
[0]enum CapitalAssetTypetype of the asset

isValid​

function isValid(contract Context context, address assetAddress, uint256 assetTokenId) internal view returns (bool)

Check if a specific token for a supported asset is valid or not. Returns false if the asset is not supported or the token is invalid

Parameters​

NameTypeDescription
contextcontract Contextgoldfinch context for routing
assetAddressaddressthe address of the asset's contract
assetTokenIduint256the token id

Return Values​

NameTypeDescription
[0]boolwhether or not a specific token id of asset address is supported

getUsdcEquivalent​

function getUsdcEquivalent(contract Context context, contract IERC721Upgradeable asset, uint256 assetTokenId) internal view returns (uint256)

Get the point-in-time USDC equivalent value of the ERC721 asset. This specifically attempts to return the "principle" or "at-risk" USDC value of the asset and does not include rewards, interest, or other benefits.

Parameters​

NameTypeDescription
contextcontract Contextgoldfinch context for routing
assetcontract IERC721UpgradeableERC721 to evaluate
assetTokenIduint256id of the token to evaluate

Return Values​

NameTypeDescription
[0]uint256USDC equivalent value

harvest​

function harvest(contract Context context, address owner, contract IERC721Upgradeable asset, uint256 assetTokenId) internal

Harvests the associated rewards, interest, and other accrued assets associated with the asset token. For example, if given a PoolToken asset, this will collect the GFI rewards (if available), redeemable interest, and redeemable principal, and send that to the owner.

Parameters​

NameTypeDescription
contextcontract Contextgoldfinch context for routing
owneraddressaddress to send the harvested assets to
assetcontract IERC721UpgradeableERC721 to harvest
assetTokenIduint256id of the token to harvest