Skip to content

LendingFactoryCore ​

Git Source

Inherits:LendingFactoryVariables, Events

Functions ​

validAddress ​

validates that an address is not the zero address

solidity
modifier validAddress(address value_) ;

onlyAuths ​

validates that msg.sender is auth or owner

solidity
modifier onlyAuths() ;

onlyDeployers ​

validates that msg.sender is deployer or owner

solidity
modifier onlyDeployers() ;

isAuth ​

Returns true if auth_ is an allowed auth or the owner.

solidity
function isAuth(address auth_) public view returns (bool);

isDeployer ​

Returns true if deployer_ is an allowed deployer or the owner.

solidity
function isDeployer(address deployer_) public view returns (bool);

setAuth ​

Sets whether auth_ is allowed as an auth.

solidity
function setAuth(address auth_, bool allowed_) external onlyOwner validAddress(auth_);

setDeployer ​

Sets whether deployer_ is allowed to deploy fTokens.

solidity
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).

solidity
function computeToken(address asset_, string calldata fTokenType_) public view returns (address token_);

_getFTokenCreationCodePointer ​

returns the SSTORE2 pointer for fTokenType_ creation code.

solidity
function _getFTokenCreationCodePointer(string calldata fTokenType_) internal view returns (address);

_getSalt ​

gets the CREATE3 salt for asset_ and fTokenType_

solidity
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.

solidity
function _requireTokenNotDeployed(bytes32 salt_) internal view returns (address token_);

_getLiquiditySlotAsset ​

returns the asset address used for Liquidity slot lookups.

solidity
function _getLiquiditySlotAsset(address asset_, bool isNativeUnderlying_) internal pure returns (address);

_requireLiquidityConfigured ​

reverts if fToken has not been configured at Liquidity contract yet.

solidity
function _requireLiquidityConfigured(address asset_, bool isNativeUnderlying_)
    internal
    view
    returns (bytes32 liquidityExchangePricesSlot_);

_deployToken ​

deploys creationCode_ with CREATE3 using salt_.

solidity
function _deployToken(bytes32 salt_, bytes memory creationCode_) internal returns (address token_);

_registerToken ​

stores the token in allTokens and emits its creation event.

solidity
function _registerToken(address token_, address asset_, string calldata fTokenType_) internal;