Compound III is a decentralized protocol that is governed by holders and delegates of COMP. Governance allows the community to propose, vote, and implement changes through the administrative smart contract functions of the Compound III protocol. For more information on the Governor and Timelock see the original governance section.
All instances of Compound III are controlled by the Timelock contract which is the same administrator of the Compound v2 protocol. The governance system has control over each proxy, the Configurator implementation, the Comet factory, and the Comet implementation.
Each time an immutable parameter is set via governance proposal, a new Comet implementation must be deployed by the Comet factory. If the proposal is approved by the community, the proxy will point to the new implementation upon execution.
To set specific protocol parameters in a proposal, the Timelock must call all of the relevant set methods on the Configurator contract, followed by deployAndUpgradeTo
on the CometProxyAdmin contract.
The Compound III protocol can be deployed on any EVM chain. The deployment must have access to on-chain asset prices and governance messages passed from Ethereum Mainnet. The Timelock on Mainnet is the administrator of all community sanctioned instances of Compound III.
Each deployment outside of Mainnet needs to have a Bridge Receiver and Local Timelock contract on its chain. Governance proposals executed on Mainnet must be read by the chain’s bridge and published to the Bridge Receiver. Local Timelocks have an additional delay before Comet admin functions can be called via proposal execution.
Compound III instance initializations are logged on-chain using the ENS text record system. The text record can only be modified by a Governance proposal. It can be viewed at v3-additional-grants.compound-community-licenses.eth when the browser network is set to Ethereum Mainnet.
This function sets the official contract address of the Comet factory. The only acceptable caller is the Governor.
function setFactory(address cometProxy, address newFactory) external
cometProxy
: The address of the Comet proxy to set the configuration for.newFactory
: The address of the new Comet contract factory.RETURN
: No return, reverts on error.This function sets the official contract address of the Compound III protocol Governor for subsequent proposals.
function setGovernor(address cometProxy, address newGovernor) external
cometProxy
: The address of the Comet proxy to set the configuration for.newGovernor
: The address of the new Compound III Governor.RETURN
: No return, reverts on error.This function sets the official contract address of the Compound III protocol pause guardian. This address has the power to pause supply, transfer, withdraw, absorb, and buy collateral operations within Compound III.
COMP token-holders designate the Pause Guardian address, which is held by the Community Multi-Sig.
function setPauseGuardian(address cometProxy, address newPauseGuardian) external
cometProxy
: The address of the Comet proxy to set the configuration for.newPauseGuardian
: The address of the new pause guardian.RETURN
: No return, reverts on error.This function pauses the specified protocol functionality in the event of an unforeseen vulnerability. The only addresses that are allowed to call this function are the Governor and the Pause Guardian.
function pause(
bool supplyPaused,
bool transferPaused,
bool withdrawPaused,
bool absorbPaused,
bool buyPaused
) override external
supplyPaused
: Enables or disables all accounts’ ability to supply assets to the protocol.transferPaused
: Enables or disables all account’s ability to transfer assets within the protocol.withdrawPaused
: Enables or disables all account’s ability to withdraw assets from the protocol.absorbPaused
: Enables or disables protocol absorptions.buyPaused
: Enables or disables the protocol’s ability to sell absorbed collateral.RETURN
: No return, reverts on error.This function returns a boolean indicating whether or not the protocol supply functionality is presently paused.
function isSupplyPaused() override public view returns (bool)
RETURN
: A boolean value of whether or not the protocol functionality is presently paused.This function returns a boolean indicating whether or not the protocol transfer functionality is presently paused.
function isTransferPaused() override public view returns (bool)
RETURN
: A boolean value of whether or not the protocol functionality is presently paused.This function returns a boolean indicating whether or not the protocol withdraw functionality is presently paused.
function isWithdrawPaused() override public view returns (bool)
RETURN
: A boolean value of whether or not the protocol functionality is presently paused.This function returns a boolean indicating whether or not the protocol absorb functionality is presently paused.
function isAbsorbPaused() override public view returns (bool)
RETURN
: A boolean value of whether or not the protocol functionality is presently paused.This function returns a boolean indicating whether or not the protocol’s selling of absorbed collateral functionality is presently paused.
function isBuyPaused() override public view returns (bool)
RETURN
: A boolean value of whether or not the protocol functionality is presently paused.This function sets the official contract address of the price feed of the protocol base asset.
function setBaseTokenPriceFeed(address cometProxy, address newBaseTokenPriceFeed) external
cometProxy
: The address of the Comet proxy to set the configuration for.newBaseTokenPriceFeed
: The address of the new price feed contract.RETURN
: No return, reverts on error.This function sets the official contract address of the protocol’s Comet extension delegate. The methods in CometExt.sol are able to be called via the same proxy as Comet.sol.
function setExtensionDelegate(address cometProxy, address newExtensionDelegate) external
cometProxy
: The address of the Comet proxy to set the configuration for.newExtensionDelegate
: The address of the new extension delegate contract.RETURN
: No return, reverts on error.This function sets the borrow interest rate utilization curve kink for the Compound III base asset.
function setBorrowKink(address cometProxy, uint64 newKink) external
cometProxy
: The address of the Comet proxy to set the configuration for.newKink
: The new kink parameter.RETURN
: No return, reverts on error.This function sets the borrow interest rate slope low bound in the approximate amount of seconds in one year.
function setBorrowPerYearInterestRateSlopeLow(address cometProxy, uint64 newSlope) external
cometProxy
: The address of the Comet proxy to set the configuration for.newSlope
: The slope low bound as an unsigned integer.RETURN
: No return, reverts on error.This function sets the borrow interest rate slope high bound in the approximate amount of seconds in one year.
function setBorrowPerYearInterestRateSlopeHigh(address cometProxy, uint64 newSlope) external
cometProxy
: The address of the Comet proxy to set the configuration for.newSlope
: The slope high bound as an unsigned integer.RETURN
: No return, reverts on error.This function sets the borrow interest rate slope base in the approximate amount of seconds in one year.
function setBorrowPerYearInterestRateBase(address cometProxy, uint64 newBase) external
cometProxy
: The address of the Comet proxy to set the configuration for.newSlope
: The slope base as an unsigned integer.RETURN
: No return, reverts on error.This function sets the supply interest rate utilization curve kink for the Compound III base asset.
function setSupplyKink(address cometProxy, uint64 newKink) external
cometProxy
: The address of the Comet proxy to set the configuration for.newKink
: The new kink parameter.RETURN
: No return, reverts on error.This function sets the supply interest rate slope low bound in the approximate amount of seconds in one year.
function setSupplyPerYearInterestRateSlopeLow(address cometProxy, uint64 newSlope) external
cometProxy
: The address of the Comet proxy to set the configuration for.newSlope
: The slope low bound as an unsigned integer.RETURN
: No return, reverts on error.This function sets the supply interest rate slope high bound in the approximate amount of seconds in one year.
function setSupplyPerYearInterestRateSlopeHigh(address cometProxy, uint64 newSlope) external
cometProxy
: The address of the Comet proxy to set the configuration for.newSlope
: The slope high bound as an unsigned integer.RETURN
: No return, reverts on error.This function sets the supply interest rate slope base in the approximate amount of seconds in one year.
function setSupplyPerYearInterestRateBase(address cometProxy, uint64 newBase) external
cometProxy
: The address of the Comet proxy to set the configuration for.newSlope
: The slope base as an unsigned integer.RETURN
: No return, reverts on error.This function sets the fraction of the liquidation penalty that goes to buyers of collateral instead of the protocol. This factor is used to calculate the discount rate of collateral for sale as part of the account absorption process. The rate is a decimal scaled up by 10 ^ 18
.
function setStoreFrontPriceFactor(address cometProxy, uint64 newStoreFrontPriceFactor) external
cometProxy
: The address of the Comet proxy to set the configuration for.newStoreFrontPriceFactor
: The new price factor as an unsigned integer expressed as a decimal scaled up by 10 ^ 18
.RETURN
: No return, reverts on error.This function sets the rate at which base asset supplier accounts accrue rewards.
function setBaseTrackingSupplySpeed(address cometProxy, uint64 newBaseTrackingSupplySpeed) external
cometProxy
: The address of the Comet proxy to set the configuration for.newBaseTrackingSupplySpeed
: The rate as an APR expressed as a decimal scaled up by 10 ^ 18
.RETURN
: No return, reverts on error.This function sets the rate at which base asset borrower accounts accrue rewards.
function setBaseTrackingBorrowSpeed(address cometProxy, uint64 newBaseTrackingBorrowSpeed) external
cometProxy
: The address of the Comet proxy to set the configuration for.newBaseTrackingBorrowSpeed
: The rate as an APR expressed as a decimal scaled up by 10 ^ 18
.RETURN
: No return, reverts on error.This function sets the minimum amount of base asset supplied to the protocol in order for accounts to accrue rewards.
function setBaseMinForRewards(address cometProxy, uint104 newBaseMinForRewards) external
cometProxy
: The address of the Comet proxy to set the configuration for.newBaseMinForRewards
: The amount of base asset scaled up by 10 to the “decimals” integer in the base asset’s contract.RETURN
: No return, reverts on error.This function sets the minimum amount of base token that is allowed to be borrowed.
function setBaseBorrowMin(address cometProxy, uint104 newBaseBorrowMin) external
cometProxy
: The address of the Comet proxy to set the configuration for.setBaseBorrowMin
: The minimum borrow as an unsigned integer scaled up by 10 to the “decimals” integer in the base asset’s contract.RETURN
: No return, reverts on error.This function sets the target reserves amount. Once the protocol reaches this amount of reserves of base asset, liquidators cannot buy collateral from the protocol.
function setTargetReserves(address cometProxy, uint104 newTargetReserves) external
cometProxy
: The address of the Comet proxy to set the configuration for.newTargetReserves
: The amount of reserves of base asset as an unsigned integer scaled up by 10 to the “decimals” integer in the base asset’s contract.RETURN
: No return, reverts on error.This function adds an asset to the protocol through governance.
function addAsset(address cometProxy, AssetConfig calldata assetConfig) external
cometProxy
: The address of the Comet proxy to set the configuration for.assetConfig
: The configuration that is added to the array of protocol asset configurations.RETURN
: No return, reverts on error.This function modifies an existing asset’s configuration parameters.
function updateAsset(address cometProxy, AssetConfig calldata newAssetConfig) external
cometProxy
: The address of the Comet proxy to set the configuration for.newAssetConfig
: The configuration that is modified in the array of protocol asset configurations. All parameters are overwritten.RETURN
: No return, reverts on error.This function updates the price feed contract address for a specific asset.
function updateAssetPriceFeed(address cometProxy, address asset, address newPriceFeed) external
cometProxy
: The address of the Comet proxy to set the configuration for.asset
: The address of the underlying asset smart contract.newPriceFeed
: The address of the new price feed smart contract.RETURN
: No return, reverts on error.This function updates the borrow collateral factor for an asset in the protocol.
function updateAssetBorrowCollateralFactor(address cometProxy, address asset, uint64 newBorrowCF) external
cometProxy
: The address of the Comet proxy to set the configuration for.asset
: The address of the underlying asset smart contract.newBorrowCF
: The collateral factor as an integer that represents the decimal value scaled up by 10 ^ 18
.RETURN
: No return, reverts on error.This function updates the liquidation collateral factor for an asset in the protocol.
function updateAssetLiquidateCollateralFactor(address cometProxy, address asset, uint64 newLiquidateCF) external
cometProxy
: The address of the Comet proxy to set the configuration for.asset
: The address of the underlying asset smart contract.newLiquidateCF
: The collateral factor as an integer that represents the decimal value scaled up by 10 ^ 18
.RETURN
: No return, reverts on error.This function updates the liquidation factor for an asset in the protocol.
The liquidation factor is a decimal value that is between 0 and 1 (inclusive) which determines the amount that is paid out to an underwater account upon liquidation.
The following is an example of the liquidation factor’s role in a Compound III liquidation:
An underwater account has supplied $100 of WBTC as collateral. If the WBTC liquidation factor is 0.9
, the user will receive $90 of the base asset when a liquidator triggers an absorption of their account.
function updateAssetLiquidationFactor(address cometProxy, address asset, uint64 newLiquidationFactor) external
cometProxy
: The address of the Comet proxy to set the configuration for.asset
: The address of the underlying asset smart contract.newLiquidationFactor
: The factor as an integer that represents the decimal value scaled up by 10 ^ 18
.RETURN
: No return, reverts on error.This function sets the maximum amount of an asset that can be supplied to the protocol. Supply transactions will revert if the total supply would be greater than this number as a result.
function updateAssetSupplyCap(address cometProxy, address asset, uint128 newSupplyCap) external
cometProxy
: The address of the Comet proxy to set the configuration for.asset
: The address of the underlying asset smart contract.newSupplyCap
: The amount of the asset as an unsigned integer scaled up by 10 to the “decimals” integer in the asset’s contract.RETURN
: No return, reverts on error.This function sets the Comet contract’s ERC-20 allowance of an asset for a manager address. It can only be called by the Governor.
In the event of a governance attack, an attacker could create a proposal that leverages this function to give themselves permissions to freely transfer all ERC-20 tokens out of the Comet contract.
Hypothetically, the attacker would need to either acquire supreme voting weight or add a malicious step in an otherwise innocuous and popular proposal and the community would fail to detect before approving.
function approveThis(address manager, address asset, uint amount) override external
manager
: The address of a manager account that has its allowance modified.asset
: The address of the asset’s smart contract.amount
: The amount of the asset approved for the manager expressed as an integer.RETURN
: No return, reverts on error.This function changes the address of the Configurator’s Governor.
function transferGovernor(address newGovernor) external
newGovernor
: The address of the new Governor for Configurator.RETURN
: No return, reverts on error.This function allows governance to withdraw base token reserves from the protocol and send them to a specified address. Only the Governor address may call this function.
function withdrawReserves(address to, uint amount) external
to
: The address of the recipient of the base asset tokens.amount
: The amount of the base asset to send scaled up by 10 to the “decimals” integer in the base asset’s contract.RETURN
: No return, reverts on error.Contract | Address |
---|