GM Lending Pool Factory
This Factory contract deploys Lending Pool contracts and creates and stores a pool ID for future lookup. The Factory inherits from Solmate's Auth contract. The functions are:
constructor
The constructor assigns the owner and Authority roles (both hereafter referred to as Admin) to the addresses that the deployer passes in as arguments.
Parameters:
_owner
address
The owner of the Factory
_authority
Authority
The Authority of the Factory
deployLendingPool
Uses the name provided, a poolNumber
counter, as well as the CREATE2 opcode, to deploy a Lending Pool contract with a unique combination of pool ID and name. Upon success, the call emits a PoolDeployed
event with the pool ID, the LendingPool contract, and the caller's address.
Parameters:
name
string memory
The deployer-defined name of the Lending Pool
Returns:
pool
LendingPool
The Lending Pool contract instance
index
uint256
The ID of the deployed pool contract
getPoolFromNumber
Uses the user-provided pool ID to retrieve the associated pool contract, by converting the CREATE2 hash into a contract instance.
Parameters:
id
uint256
The ID of a Lending Pool contract
Returns:
pool
LendingPool
The Lending Pool contract instance
Last updated