LendingFactoryAdmin ​
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 ​
reads if a certain auth_ address is an allowed auth or not. Owner is auth by default.
function isAuth(address auth_) public view returns (bool);isDeployer ​
reads if a certain deployer_ address is an allowed deployer or not. Owner is deployer by default.
function isDeployer(address deployer_) public view returns (bool);setAuth ​
Sets an address as allowed auth or not. Only callable by owner.
function setAuth(address auth_, bool allowed_) external onlyOwner validAddress(auth_);Parameters
| Name | Type | Description |
|---|---|---|
auth_ | address | address to set auth value for |
allowed_ | bool | bool flag for whether address is allowed as auth or not |
setDeployer ​
Sets an address as allowed deployer or not. Only callable by owner.
function setDeployer(address deployer_, bool allowed_) external onlyOwner validAddress(deployer_);Parameters
| Name | Type | Description |
|---|---|---|
deployer_ | address | address to set deployer value for |
allowed_ | bool | bool flag for whether address is allowed as deployer or not |
setFTokenCreationCode ​
Sets the creationCode_ bytecode for a certain fTokenType_. Only callable by auths.
function setFTokenCreationCode(string memory fTokenType_, bytes calldata creationCode_) external onlyAuths;Parameters
| Name | Type | Description |
|---|---|---|
fTokenType_ | string | the fToken Type used to refer the creation code |
creationCode_ | bytes | contract creation code. can be set to bytes(0) to remove a previously available fTokenType_ |
createToken ​
creates token for asset_ for a lending protocol with interest. Only callable by deployers.
function createToken(address asset_, string calldata fTokenType_, bool isNativeUnderlying_)
external
validAddress(asset_)
onlyDeployers
returns (address token_);Parameters
| Name | Type | Description |
|---|---|---|
asset_ | address | address of the asset |
fTokenType_ | string | type of fToken: - if it's the native token, it should use NativeUnderlying - otherwise it should use fToken - could be more types available, check fTokenTypes() |
isNativeUnderlying_ | bool | flag to signal fToken type that uses native underlying at Liquidity |
Returns
| Name | Type | Description |
|---|---|---|
token_ | address | address of the created token |
_getSalt ​
gets the CREATE3 salt for asset_ and fTokenType_
function _getSalt(address asset_, string calldata fTokenType_) internal pure returns (bytes32);
