RegistryV2
Contract Overview
The RegistryV2
contract is designed to manage the deployment of vaults and loans, as well as the setting and withdrawal of fees. It interacts with various other contracts such as vaults, loans, and the registry to ensure the proper creation and management of these entities. The contract supports functionalities such as deploying vaults and loans, setting maker and taker fees, and withdrawing fees.
Read Methods
1. getMakerTakerFee
Returns
Name | Type | Description |
---|---|---|
_makerFee | uint256 | The current maker fee. |
_takerFee | uint256 | The current taker fee. |
Returns the current maker and taker fees.
Write Methods
1. deployVault
Parameters
Name | Type | Description |
---|---|---|
strategy | address | The address of the strategy contract. |
Returns
Name | Type | Description |
---|---|---|
vault | address | The address of the deployed vault. |
Deploys a new vault based on the provided strategy address. Emits a VaultAdded
event.
Notice:
- Reason: To allow the creation of new vaults, facilitating the management of lending strategies.
2. deployLoan
Parameters
Name | Type | Description |
---|---|---|
loanData | DataTypes.LoanData calldata | The loan data parameters. |
Returns
Name | Type | Description |
---|---|---|
loan | address | The address of the deployed loan. |
Deploys a new loan based on the provided loan data parameters. Emits a LoanAdded
event.
Notice:
- Reason: To allow the creation of new loans, facilitating the lending process.
3. setTakerFee
Parameters
Name | Type | Description |
---|---|---|
newTakerFee | uint256 | The new taker fee to be set. |
Sets the taker fee. Reverts if the new taker fee is greater than 100%.
Notice:
- Modifier: Only the contract owner can call this function.
- Reason: To ensure that only the owner can set the taker fee, maintaining control over the fee structure.
4. setMakerFee
Parameters
Name | Type | Description |
---|---|---|
newMakerFee | uint256 | The new maker fee to be set. |
Sets the maker fee. Reverts if the new maker fee is greater than 100%.
Notice:
- Modifier: Only the contract owner can call this function.
- Reason: To ensure that only the owner can set the maker fee, maintaining control over the fee structure.
5. withdrawFees
Parameters
Name | Type | Description |
---|---|---|
token | address | The address of the token to withdraw. |
amt | uint256 | The amount of tokens to withdraw. |
Allows the governance to withdraw fees. Reverts if the token address is zero or the amount is zero. Emits a WithdrawFees
event.
Notice:
- Modifier: Only the contract owner can call this function.
- Reason: To ensure that only the owner can withdraw fees, maintaining control over the contract's funds.
Constructor
Parameters
Name | Type | Description |
---|---|---|
_vaultImpl | address | The address of the vault implementation contract. |
_loanImpl | address | The address of the loan implementation contract. |
Initializes the contract with the provided vault and loan implementation addresses. Reverts if any of the addresses are zero.
Notice:
- Reason: To ensure that the contract is initialized with valid addresses, preventing misconfiguration.