Settings
The settings directory contains facets and libraries that pull necessary information needed from multiple assets, platform and modifiers.
assets
assetsAsset settings are stored using the Cache Lib, so they don't have their own library. Each asset used as a lending token has a set of settings assigned to them which are used in various functions.
libraries
The libraries directory contains information about multiple assets, including:
aTokenfound inAssetATokenLibcTokenfound inAssetCTokenLibyVaultfound inAssetYVaultLibpPoolfound inAssetPPoolLib
The information pulled from these assets relate to their MaxDebtRatio, MaxLoanAmount and
MaxTVLLib, which are all in their respective solidity files.
**AssetSettingsDataFacet**
The Data Facet uses the libraries to pull necessary information (MaxTVL & MaxLoanAmount) of different assets.
**AssetSettingsFacet**
Perhaps the most used file in the entire directory, the Asset Settings Facet contains functions that do the following:
isAssetSettingsInitializeddigs in theCacheLibto check if it's respective asset settings existsgetMaxTVLAmountgets the max total value locked of an assetcreateAssetSettingcreates settings for an asset in theCacheLibupdateAssetSettingupdates an asset with the given parameter
pausable
pausableContains files that help pause and un-pause facets
PausableModsHas the modifier
pausedwhich is used by multiple files in the protocol to check if a facet is paused or not
PausableFacetHas the function
pause, which is required to be called by thePAUSERrole. It pauses the entire facet when passed true, un-pauses the asset when passed false
platform
platformContains files to modify the platform settings. All the platform settings are stored in the AppStorageLib
PlatformSettingsLibcontains functions that retrieve the percentage value for submissions, maximum tolerance value, safety interval value, response expiry length and morePlatformSettingsFacetcontains functions that create, update and get platform settings valuenames.solcontains all the variables of platform settings names that are hashed
SettingsFacet
SettingsFacetContains multiple functions that:
addAuthorizedAddressadds a wallet address to the list of authorized walletsaddAuthorizedAddressListadds a list of wallet addresses to the list of authorized walletsremoveAuthorizedAddressrevokes the role of a wallet address from the list of authorized wallets by removing ithasAuthorizationchecks whether an account has authorization by checking if it has theAUTHORIZEDrolesetNFTLiquidationControllersets a new address to which NFTs should be sent to when liquidating an NFTgetNFTLiquidationControllergets the new address where the NFTs are sent to be liquidated
Last updated
Was this helpful?