GM Lending Pool Factory
Last updated
Last updated
This Factory contract deploys contracts and creates and stores a pool ID for future lookup. The Factory inherits from Solmate's Auth contract. The functions are:
The constructor assigns the owner and Authority roles (both hereafter referred to as Admin) to the addresses that the deployer passes in as arguments.
_owner
address
The owner of the Factory
_authority
Authority
The Authority of the Factory
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.
name
string memory
The deployer-defined name of the Lending Pool
pool
LendingPool
The Lending Pool contract instance
index
uint256
The ID of the deployed pool contract
Uses the user-provided pool ID to retrieve the associated pool contract, by converting the CREATE2 hash into a contract instance.
id
uint256
The ID of a Lending Pool contract
pool
LendingPool
The Lending Pool contract instance