Skip to content

SetterFacet

This facet contract contains all the configurational setter functions

Alias to _setPriceOracle to support the Isolated Lending Comptroller Interface

function setPriceOracle(contract ResilientOracleInterface newOracle) external returns (uint256)
NameTypeDescription
newOraclecontract ResilientOracleInterfaceThe new price oracle to set
NameTypeDescription
[0]uint256uint256 0=success, otherwise a failure (see ErrorReporter.sol for details)

Sets a new price oracle for the comptroller

function _setPriceOracle(contract ResilientOracleInterface newOracle) external returns (uint256)
NameTypeDescription
newOraclecontract ResilientOracleInterfaceThe new price oracle to set
NameTypeDescription
[0]uint256uint256 0=success, otherwise a failure (see ErrorReporter.sol for details)

Alias to _setCloseFactor to support the Isolated Lending Comptroller Interface

function setCloseFactor(uint256 newCloseFactorMantissa) external returns (uint256)
NameTypeDescription
newCloseFactorMantissauint256New close factor, scaled by 1e18
NameTypeDescription
[0]uint256uint256 0=success, otherwise will revert

Sets the closeFactor used when liquidating borrows

function _setCloseFactor(uint256 newCloseFactorMantissa) external returns (uint256)
NameTypeDescription
newCloseFactorMantissauint256New close factor, scaled by 1e18
NameTypeDescription
[0]uint256uint256 0=success, otherwise will revert

Sets the address of the access control of this contract

function _setAccessControl(address newAccessControlAddress) external returns (uint256)
NameTypeDescription
newAccessControlAddressaddressNew address for the access control
NameTypeDescription
[0]uint256uint256 0=success, otherwise will revert

Sets the collateral factor and liquidation threshold for a market in the Core Pool only.

function setCollateralFactor(contract VToken vToken, uint256 newCollateralFactorMantissa, uint256 newLiquidationThresholdMantissa) external returns (uint256)
NameTypeDescription
vTokencontract VTokenThe market to set the factor on
newCollateralFactorMantissauint256The new collateral factor, scaled by 1e18
newLiquidationThresholdMantissauint256The new liquidation threshold, scaled by 1e18
NameTypeDescription
[0]uint256uint256 0=success, otherwise a failure. (See ErrorReporter for details)

Sets the liquidation incentive for a market in the Core Pool only.

function setLiquidationIncentive(address vToken, uint256 newLiquidationIncentiveMantissa) external returns (uint256)
NameTypeDescription
vTokenaddressThe market to set the liquidationIncentive for
newLiquidationIncentiveMantissauint256New liquidationIncentive scaled by 1e18
NameTypeDescription
[0]uint256uint256 0=success, otherwise a failure. (See ErrorReporter for details)

Sets the collateral factor and liquidation threshold for a market in the specified pool.

function setCollateralFactor(uint96 poolId, contract VToken vToken, uint256 newCollateralFactorMantissa, uint256 newLiquidationThresholdMantissa) external returns (uint256)
NameTypeDescription
poolIduint96The ID of the pool.
vTokencontract VTokenThe market to set the factor on
newCollateralFactorMantissauint256The new collateral factor, scaled by 1e18
newLiquidationThresholdMantissauint256The new liquidation threshold, scaled by 1e18
NameTypeDescription
[0]uint256uint256 0=success, otherwise a failure. (See ErrorReporter for details)

Sets the liquidation incentive for a market in the specified pool.

function setLiquidationIncentive(uint96 poolId, address vToken, uint256 newLiquidationIncentiveMantissa) external returns (uint256)
NameTypeDescription
poolIduint96The ID of the pool.
vTokenaddressThe market to set the liquidationIncentive for
newLiquidationIncentiveMantissauint256New liquidationIncentive scaled by 1e18
NameTypeDescription
[0]uint256uint256 0=success, otherwise a failure. (See ErrorReporter for details)

Update the address of the liquidator contract

function _setLiquidatorContract(address newLiquidatorContract_) external
NameTypeDescription
newLiquidatorContract_addressThe new address of the liquidator contract

Admin function to change the Pause Guardian

function _setPauseGuardian(address newPauseGuardian) external returns (uint256)
NameTypeDescription
newPauseGuardianaddressThe address of the new Pause Guardian
NameTypeDescription
[0]uint256uint256 0=success, otherwise a failure. (See enum Error for details)

Alias to _setMarketBorrowCaps to support the Isolated Lending Comptroller Interface

function setMarketBorrowCaps(contract VToken[] vTokens, uint256[] newBorrowCaps) external
NameTypeDescription
vTokenscontract VToken[]The addresses of the markets (tokens) to change the borrow caps for
newBorrowCapsuint256[]The new borrow cap values in underlying to be set. A value of 0 corresponds to Borrow not allowed

Set the given borrow caps for the given vToken market Borrowing that brings total borrows to or above borrow cap will revert

function _setMarketBorrowCaps(contract VToken[] vTokens, uint256[] newBorrowCaps) external
NameTypeDescription
vTokenscontract VToken[]The addresses of the markets (tokens) to change the borrow caps for
newBorrowCapsuint256[]The new borrow cap values in underlying to be set. A value of 0 corresponds to Borrow not allowed

Alias to _setMarketSupplyCaps to support the Isolated Lending Comptroller Interface

function setMarketSupplyCaps(contract VToken[] vTokens, uint256[] newSupplyCaps) external
NameTypeDescription
vTokenscontract VToken[]The addresses of the markets (tokens) to change the supply caps for
newSupplyCapsuint256[]The new supply cap values in underlying to be set. A value of 0 corresponds to Minting NotAllowed

Set the given supply caps for the given vToken market Supply that brings total Supply to or above supply cap will revert

function _setMarketSupplyCaps(contract VToken[] vTokens, uint256[] newSupplyCaps) external
NameTypeDescription
vTokenscontract VToken[]The addresses of the markets (tokens) to change the supply caps for
newSupplyCapsuint256[]The new supply cap values in underlying to be set. A value of 0 corresponds to Minting NotAllowed

Set whole protocol pause/unpause state

function _setProtocolPaused(bool state) external returns (bool)
NameTypeDescription
stateboolThe new state (true=paused, false=unpaused)
NameTypeDescription
[0]boolbool The updated state of the protocol

Alias to _setActionsPaused to support the Isolated Lending Comptroller Interface

function setActionsPaused(address[] markets_, enum Action[] actions_, bool paused_) external
NameTypeDescription
markets_address[]Markets to pause/unpause the actions on
actions_enum Action[]List of action ids to pause/unpause
paused_boolThe new paused state (true=paused, false=unpaused)

Pause/unpause certain actions

function _setActionsPaused(address[] markets_, enum Action[] actions_, bool paused_) external
NameTypeDescription
markets_address[]Markets to pause/unpause the actions on
actions_enum Action[]List of action ids to pause/unpause
paused_boolThe new paused state (true=paused, false=unpaused)

Sets a new VAI controller

function _setVAIController(contract VAIControllerInterface vaiController_) external returns (uint256)
NameTypeDescription
[0]uint256uint256 0=success, otherwise a failure (see ErrorReporter.sol for details)

Set the VAI mint rate

function _setVAIMintRate(uint256 newVAIMintRate) external returns (uint256)
NameTypeDescription
newVAIMintRateuint256The new VAI mint rate to be set
NameTypeDescription
[0]uint256uint256 0=success, otherwise a failure (see ErrorReporter.sol for details)

Set the minted VAI amount of the owner

function setMintedVAIOf(address owner, uint256 amount) external returns (uint256)
NameTypeDescription
owneraddressThe address of the account to set
amountuint256The amount of VAI to set to the account
NameTypeDescription
[0]uint256The number of minted VAI by owner

Set the treasury data.

function _setTreasuryData(address newTreasuryGuardian, address newTreasuryAddress, uint256 newTreasuryPercent) external returns (uint256)
NameTypeDescription
newTreasuryGuardianaddressThe new address of the treasury guardian to be set
newTreasuryAddressaddressThe new address of the treasury to be set
newTreasuryPercentuint256The new treasury percent to be set
NameTypeDescription
[0]uint256uint256 0=success, otherwise a failure (see ErrorReporter.sol for details)

Set the amount of XVS distributed per block to VAI Vault

function _setVenusVAIVaultRate(uint256 venusVAIVaultRate_) external
NameTypeDescription
venusVAIVaultRate_uint256The amount of XVS wei per block to distribute to VAI Vault

Set the VAI Vault infos

function _setVAIVaultInfo(address vault_, uint256 releaseStartBlock_, uint256 minReleaseAmount_) external
NameTypeDescription
vault_addressThe address of the VAI Vault
releaseStartBlock_uint256The start block of release to VAI Vault
minReleaseAmount_uint256The minimum release amount to VAI Vault

Alias to _setPrimeToken to support the Isolated Lending Comptroller Interface

function setPrimeToken(contract IPrime _prime) external returns (uint256)
NameTypeDescription
_primecontract IPrimeThe new prime token contract to be set
NameTypeDescription
[0]uint256uint 0=success, otherwise a failure (see ErrorReporter.sol for details)

Sets the prime token contract for the comptroller

function _setPrimeToken(contract IPrime _prime) external returns (uint256)
NameTypeDescription
_primecontract IPrimeThe new prime token contract to be set
NameTypeDescription
[0]uint256uint 0=success, otherwise a failure (see ErrorReporter.sol for details)

Alias to _setForcedLiquidation to support the Isolated Lending Comptroller Interface

function setForcedLiquidation(address vTokenBorrowed, bool enable) external
NameTypeDescription
vTokenBorrowedaddressBorrowed vToken
enableboolWhether to enable forced liquidations

Enables forced liquidations for a market. If forced liquidation is enabled, borrows in the market may be liquidated regardless of the account liquidity

function _setForcedLiquidation(address vTokenBorrowed, bool enable) external
NameTypeDescription
vTokenBorrowedaddressBorrowed vToken
enableboolWhether to enable forced liquidations

Enables forced liquidations for user’s borrows in a certain market. If forced liquidation is enabled, user’s borrows in the market may be liquidated regardless of the account liquidity. Forced liquidation may be enabled for a user even if it is not enabled for the entire market.

function _setForcedLiquidationForUser(address borrower, address vTokenBorrowed, bool enable) external
NameTypeDescription
borroweraddressThe address of the borrower
vTokenBorrowedaddressBorrowed vToken
enableboolWhether to enable forced liquidations

function setWhiteListFlashLoanAccount(address account, bool _isWhiteListed) external

Explanation:
This function grants or revokes an account’s permission to use the protocol’s flash loan feature, enforcing access control and address validation.

NameTypeDescription
accountaddressThe account to whitelist or remove
_isWhiteListedboolTrue to whitelist, false to remove
NameTypeDescription
None

Set the address of the XVS token

function _setXVSToken(address xvs_) external
NameTypeDescription
xvs_addressThe address of the XVS token

Set the address of the XVS vToken

function _setXVSVToken(address xvsVToken_) external
NameTypeDescription
xvsVToken_addressThe address of the XVS vToken

updates active status for a specific pool (excluding the Core Pool)

function setPoolActive(uint96 poolId, bool active) external
NameTypeDescription
poolIduint96id of the pool to update
activebooltrue to enable, false to disable
  • PoolActiveStatusUpdated Emitted after the pool active status is updated.
  • InvalidOperationForCorePool Reverts when attempting to call pool-specific methods on the Core Pool.
  • PoolDoesNotExist Reverts if the target pool ID does not exist.

Updates the isBorrowAllowed flag for a market in a pool.

function setIsBorrowAllowed(uint96 poolId, address vToken, bool borrowAllowed) external
NameTypeDescription
poolIduint96The ID of the pool.
vTokenaddressThe address of the market (vToken).
borrowAllowedboolThe new borrow allowed status.
  • BorrowAllowedUpdated Emitted after the borrow permission for a market is updated.
  • PoolDoesNotExist Reverts if the pool ID is invalid.
  • MarketConfigNotFound Reverts if the market is not listed in the pool.