LendingFactoryCore ​
Inherits:LendingFactoryVariables, Events
Functions ​
validAddress ​
validates that an address is not the zero address
modifier validAddress(address value_) ;onlyAuths ​
validates that msg.sender is auth or owner
modifier onlyAuths() ;onlyDeployers ​
validates that msg.sender is deployer or owner
modifier onlyDeployers() ;isAuth ​
Returns true if auth_ is an allowed auth or the owner.
function isAuth(address auth_) public view returns (bool);isDeployer ​
Returns true if deployer_ is an allowed deployer or the owner.
function isDeployer(address deployer_) public view returns (bool);setAuth ​
Sets whether auth_ is allowed as an auth.
function setAuth(address auth_, bool allowed_) external onlyOwner validAddress(auth_);setDeployer ​
Sets whether deployer_ is allowed to deploy fTokens.
function setDeployer(address deployer_, bool allowed_) external onlyOwner validAddress(deployer_);computeToken ​
Computes the deterministic fToken address for asset_ and fTokenType_ (CREATE3).
Same salt as createToken. Address is factory-specific because CREATE3 mixes in address(this).
function computeToken(address asset_, string calldata fTokenType_) public view returns (address token_);_getFTokenCreationCodePointer ​
returns the SSTORE2 pointer for fTokenType_ creation code.
function _getFTokenCreationCodePointer(string calldata fTokenType_) internal view returns (address);_getSalt ​
gets the CREATE3 salt for asset_ and fTokenType_
function _getSalt(address asset_, string calldata fTokenType_) internal pure returns (bytes32);_requireTokenNotDeployed ​
reverts if a token is already deployed for salt_, returning its deterministic address otherwise.
function _requireTokenNotDeployed(bytes32 salt_) internal view returns (address token_);_getLiquiditySlotAsset ​
returns the asset address used for Liquidity slot lookups.
function _getLiquiditySlotAsset(address asset_, bool isNativeUnderlying_) internal pure returns (address);_requireLiquidityConfigured ​
reverts if fToken has not been configured at Liquidity contract yet.
function _requireLiquidityConfigured(address asset_, bool isNativeUnderlying_)
internal
view
returns (bytes32 liquidityExchangePricesSlot_);_deployToken ​
deploys creationCode_ with CREATE3 using salt_.
function _deployToken(bytes32 salt_, bytes memory creationCode_) internal returns (address token_);_registerToken ​
stores the token in allTokens and emits its creation event.
function _registerToken(address token_, address asset_, string calldata fTokenType_) internal;