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:
Name | Type | Description |
---|---|---|
| address | The owner of the Factory |
| 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 | Type | Description |
---|---|---|
| string memory | The deployer-defined name of the Lending Pool |
Returns:
Name | Type | Description |
---|---|---|
| LendingPool | The Lending Pool contract instance |
| 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:
Name | Type | Description |
---|---|---|
| uint256 | The ID of a Lending Pool contract |
Returns:
Name | Type | Description |
---|---|---|
| LendingPool | The Lending Pool contract instance |
Last updated