PrimaryLendingPlatformModerator
Overview
License: MIT
The PrimaryLendingPlatformModerator contract is the contract that provides the functionality for moderating the primary lending platform.
Contract for managing the moderators of the PrimaryLendingPlatform contract.
Events info
AddPrjToken
Emitted when a project token is added to the platform.
Parameters:
RemoveProjectToken
Emitted when a project token is removed from the platform.
Parameters:
AddLendingToken
Emitted when a lending token is added to the platform.
Parameters:
RemoveLendingToken
Emitted when a lending token is removed from the platform.
Parameters:
SetPausedProjectToken
Emitted when the deposit or withdraw functionality of a project token is paused or unpaused.
Parameters:
SetPausedLendingToken
Emitted when the borrow functionality of a lending token is paused or unpaused.
Parameters:
SetBorrowLimitPerCollateralAsset
Emitted when the borrow limit per collateral asset is set for a project token.
Parameters:
SetBorrowLimitPerLendingAsset
Emitted when the borrow limit per lending asset is set for a lending token.
Parameters:
LoanToValueRatioSet
Emitted when the loan-to-value ratio is set for a project token.
Parameters:
GrantModerator
Emitted when a moderator is granted access to the platform.
Parameters:
RevokeModerator
Emitted when a moderator's access to the platform is revoked.
Parameters:
SetPrimaryLendingPlatformLeverage
Emitted when the leverage of the PrimaryLendingPlatform contract is set.
Parameters:
SetPrimaryLendingPlatform
Emitted when the primary lending platform address is set.
Parameters:
SetPriceOracle
Emitted when the price oracle contract is set.
Parameters:
AddRelatedContracts
Emitted when a related contract is added to the platform.
Parameters:
RemoveRelatedContracts
Emitted when a related contract is removed from the platform.
Parameters:
Constants info
MODERATOR_ROLE (0x797669c9)
State variables info
primaryLendingPlatform (0x92641a7c)
Modifiers info
onlyAdmin
Modifier to check if the caller has the admin role.
onlyModerator
Modifier to check if the caller has the moderator role.
isProjectTokenListed
Modifier to check if a project token is listed on the platform.
Parameters:
isLendingTokenListed
Modifier to check if a lending token is listed on the platform.
Parameters:
Functions info
initialize (0xc4d66de8)
Initializes the contract by setting up the default admin role, the moderator role, and the primary index token.
Parameters:
grantModerator (0x6981c7ae)
Grants the moderator role to a new address.
Requirements:
Called by the admin role.
The new moderator address must not be the zero address.
Parameters:
revokeModerator (0x36445636)
Revokes the moderator role from an address.
Requirements:
Called by the admin role.
The moderator address must not be the zero address.
Parameters:
transferAdminRole (0xada8f919)
Transfers the admin role to a new address.
Requirements:
Called by the admin role.
The moderator address must not be the zero address.
Parameters:
transferAdminRoleForPIT (0x23e0f33e)
Transfers the admin role for the primary index token to a new address.
Requirements:
Called by the admin role.
The current admin address must not be the zero address.
The new admin address must not be the zero address.
Parameters:
setPrimaryLendingPlatform (0xe801734a)
Sets the address of the primary lending platform contract.
Requirements:
Only the moderator can call this function.
The new primary lending platform address cannot be the zero address.
Parameters:
addProjectToken (0xf8095cb9)
Adds a project token to the platform with the specified loan-to-value ratio.
Parameters:
Requirements:
The project token address must not be the zero address.
Only the admin can call this function.
Effects:
Adds the project token to the platform.
Sets the loan-to-value ratio for the project token.
Sets the pause status for deposit and withdrawal of the project token to false. |
removeProjectToken (0xcb69ae80)
Removes a project token from the primary lending platform.
Parameters:
Requirements:
The caller must be an admin.
The project token must be listed on the primary lending platform.
The total deposited project token amount must be zero. |
addLendingToken (0x1d0957e9)
Adds a new lending token to the platform.
Parameters:
Requirements:
The lending token address and bLending token address must not be zero.
Only the admin can call this function.
Effects:
Adds the lending token to the platform.
Sets the loan-to-value ratio for the lending token.
Sets the pause status for borrowing of the lending token. |
removeLendingToken (0xe032563a)
Removes a lending token from the primary lending platform.
Parameters:
Requirements:
The caller must have admin role.
The lending token must be listed in the primary lending platform.
There must be no borrow of the lending token in any project. |
setPrimaryLendingPlatformLeverage (0xa1ab5419)
Sets the address of the primary lending platform leverage contract.
Requirements:
Only the admin can call this function.
The new address must not be the zero address.
Parameters:
setPriceOracle (0x530e784f)
Sets the price oracle address for the primary lending platform.
Requirements:
Only the admin can call this function.
The new address must not be the zero address.
Parameters:
addRelatedContracts (0x83bb578d)
Adds an address to the list of related contracts.
Requirements:
Only the admin can call this function.
The new address must not be the zero address.
Parameters:
removeRelatedContracts (0x3b3e330b)
Removes an address from the list of related contracts.
Requirements:
Only the admin can call this function.
The new address must not be the zero address.
Parameters:
setProjectTokenInfo (0x4a5333bc)
Sets the project token information such as deposit and withdraw pause status, and loan-to-value ratio for a given project token.
Requirements:
The
loanToValueRatioNumerator
must be less than or equal toloanToValueRatioDenominator
.Only the moderator can call this function.
Parameters:
setLendingTokenInfo (0x821363a0)
Sets the lending token information for the primary lending platform.
Requirements:
The function can only be called by the moderator.
The underlying asset of the bLending token must be the same as the lending token.
Parameters:
setBorrowLimitPerCollateralAsset (0x8e85cdfa)
Sets the borrow limit per collateral for a given project token.
Requirements:
The function can only be called by the moderator.
The project token must be listed on the primary lending platform.
The borrow limit must be greater than zero.
The project token address must not be the zero address.
Parameters:
setBorrowLimitPerLendingAsset (0x92a39190)
Sets the borrow limit per lending asset for a given lending token.
Requirements:
The function can only be called by the moderator.
The lending token must be listed on the primary lending platform.
The borrow limit must be greater than zero.
The lendingToken token address must not be the zero address.
Parameters:
Last updated