Releases: compound-finance/compound-protocol
COMP Distribution Patch
COMP Distribution System
This is the final release for the COMP distribution mechanism to the Comptroller. It contains the deployment configurations for mainnet, kovan, and ropsten, as well as the code changes for the protocol.
Once applied, users of 'comped' markets will receive units of the Compound governance token whenever they interact with the protocol. COMP is distributed at a steady rate (controlled by the admin), and earned based on the fraction of total supply or borrow held by each user within a market, and that market's share of total interest generated. Above a certain threshold, earned COMP is automatically transferred to the user. COMP which has not yet been transferred may be claimed explicitly.
This patch also adds a Reservoir contract, which will drip COMP to the Comptroller contract at a constant rate, whenever poked. The Reservoir effectively guarantees the Comptroller will have enough COMP to distribute, up to a maximum rate.
The Comptroller also now tracks the entire list of markets that have ever been supported. The existing Market struct is modified to track an additional 'isComped' field.
COMP Distribution System
This patch adds a COMP distribution mechanism to the Comptroller. Once applied, users of 'comped' markets will receive units of the Compound governance token whenever they interact with the protocol. COMP is distributed at a steady rate (controlled by the admin), and earned based on the fraction of total supply or borrow held by each user within a market, and that market's share of total interest generated. Above a certain threshold, earned COMP is automatically transferred to the user. COMP which has not yet been transferred may be claimed explicitly.
This patch also adds a Reservoir contract, which will drip COMP to the Comptroller contract at a constant rate, whenever poked. The Reservoir effectively guarantees the Comptroller will have enough COMP to distribute, up to a maximum rate.
The Comptroller also now tracks the entire list of markets that have ever been supported. The existing Market struct is modified to track an additional 'isComped' field.
This patch also contains configuration for connecting to a fully verifiable Kovan flywheel testnet.
Tether, CToken gas optimizations, and a new DAI interest rate model
This release includes changes to CToken in order to support listing Tether. In particular, underlying transfer fees are accounted for properly when moving underlying in and out of the CToken.
This release also creates a number of small gas optimizations. The goal is to reduce about 10-20K of gas on operations by simplifying certain operations in the protocol, without significantly changing behavior.
This release also includes a new deploy script and Compound Lens contract. The lens can be used for fetching data from the protocol in bulk, to cut down on web3 provider usage.
Finally, this release includes a change to the DAI interest rate model to bump gapPerBlock
from 0.05%
to 2%
.
More specifically with regards to CToken changes:
- Remove
checkTransferIn
in favor of looking at the effect oftransfer
to handle fees, which obviates the need for checking the transfer in. - Change our delegator contract to use
msg.data
directly, instead of re-encoding. This removes some unnecessary repacking. - Reduce potentially redundant SLOADs by memoizing values.
- Do not re-accrue interest multiple-times per block (as the interest accrued is, by definition, zero, beyond the first transaction in a block for a given cToken).
- Remove
localVars
structs as Solidity handles more variables correctly and it cleans up code. - In some cases, switch from
CarefulMath
toSafeMath
(that is, revert instead of returning error codes). This is done in select places as it's technically a change of behavior and needs to be handled carefully. - Add Tether to Price Oracle Proxy.
- Bump up to 0.5.16 with an eye towards bumping to Solidity 0.6.x-style in the near future
- Add a scenario command to check the BorrowRate from an IR model.
- Deploy cUSDT to ropsten, mainnet, and rinkeby.
Price oracle proxy to allow decoupling SAI/DAI
This release includes the deployment of a new PriceOracleProxy which allows the SAI price to be set once by the guardian, at some point in the future. This is in preparation for the emergency shutdown of SAI - at which point each SAI will become worth a fractional amount of Ether. The proxy will not accept a SAI price >= 0.1 ETH, as a sanity check, given the current price of ETH.
Pause Guardian by Market
This patch adds the pause by market functionality to Comptroller, giving finer-grained control to the pause guardian. Mint and borrow may now be paused for individual markets, instead of globally for all markets at once. A new event type is emitted by the Comptroller to indicate when an action is paused in a market.
This patch also includes a new 'lens' contract, which is designed to cut down on bandwidth from off-chain clients to web3 providers, for accessing data from the Compound markets.
Comp and Governor
This patch adds the Comp Token and Governor Alpha contracts. The Comp token represents the administrative rights of the protocol, divided into 10,000,000 fungible tokens. These tokens have governance rights in the Governor contract, which in turn will become the admin of the Compound Timelock that administers the Compound Comptroller and cToken contracts.
The Comp Token is a basic Erc-20 with an ability to delegate to third parties. The goal of delegation is that an account could delegate his/her voting rights in the Governor to a hot-wallet or trusted third-party which is paying closer attention to governance proposals.
The Governor Alpha system is a simple vote-based governor which allows Comp Token holders to propose and ratify specific Ethereum actions. For instance, a user with sufficient tokens could propose supporting a new market in the Compound Comptroller. All Comp Token delegees will then have the ability over some period to vote on that proposal, and if its ratified, it can be automatically executed (through the Compound Timelock).
Delegation is unique in the fact it's tracked by block, forever, for each account. This allows us to say "how many delegated votes existed for X account at block Y." We then say that your votes for a given proposal are the amount of votes you had delegated at the time the proposal was created. In this way, we prevent sybil attacks without forcing users to lock tokens before voting.
Patch Notes 1
- Reduced storage typing to prevent potentially unsafe downcasts. These sizes are enforced due to the limited total
- number of Comp tokens (10MM tokens with 18 decimal precision).
- A proposal cannot be queued if an identical action already exists in the Timelock. This will prevent two proposals with identical actions from conflicting and explicitly make it impossible to ever enqueue a proposal that itself has two identical proposals.
- We add more scenarios and formal analysis tests.
Patch Notes 2
This patch builds our official release candidates for the Comp and Governor Alpha systems. We make a number of minor changes from the 2.5 Alpha 2 version, including:
- Change proposal and quorum thresholds to 1% and 4% respectively
- Make a number of cosmetic changes and updates to events
- Add test-net deployments [Ropsten, Goerli]
- Add additional unit tests, scenarios and formal verification
- Upgrade saddle to include saddle console
- Upgrade Docker for newest version
Patch Notes 3
This patch is a very small update to our Comp and Gov contracts to improve formatting and grammar. We also:
- Remove SafeMath in place of inlining the two SafeMath functions that were being used.
- Move Interfaces to the bottom to clean up flattened code viewing
- Add StartBlock and EndBlock to the ProposalCreated event.
Comp and Governor Alpha [Release Candidate 2]
Note: this is a pre-release version available exclusively for testing and evaluation. A protocol specification is attached. For information on security audits and to report issues, please visit the Compound Security page.
This patch adds the Comp Token and Governor Alpha contracts. The Comp token represents the administrative rights of the protocol, divided into 10,000,000 fungible tokens. These tokens have governance rights in the Governor contract, which in turn will become the admin of the Compound Timelock that administers the Compound Comptroller and cToken contracts.
The Comp Token is a basic Erc-20 with an ability to delegate to third parties. The goal of delegation is that an account could delegate his/her voting rights in the Governor to a hot-wallet or trusted third-party which is paying closer attention to governance proposals.
The Governor Alpha system is a simple vote-based governor which allows Comp Token holders to propose and ratify specific Ethereum actions. For instance, a user with sufficient tokens could propose supporting a new market in the Compound Comptroller. All Comp Token delegees will then have the ability over some period to vote on that proposal, and if its ratified, it can be automatically executed (through the Compound Timelock).
Delegation is unique in the fact it's tracked by block, forever, for each account. This allows us to say "how many delegated votes existed for X account at block Y." We then say that your votes for a given proposal are the amount of votes you had delegated at the time the proposal was created. In this way, we prevent sybil attacks without forcing users to lock tokens before voting.
Patch Notes 1:
- Reduced storage typing to prevent potentially unsafe downcasts. These sizes are enforced due to the limited total number of Comp tokens (10MM tokens with 18 decimal precision).
- A proposal cannot be queued if an identical action already exists in the Timelock. This will prevent two proposals with identical actions from conflicting and explicitly make it impossible to ever enqueue a proposal that itself has two identical proposals.
- We add more scenarios and formal analysis tests.
Patch Notes 2:
This patch builds our official release candidates for the Comp and Governor Alpha systems. We make a number of minor changes from the 2.5 Alpha 2 version, including:
- Change proposal and quorum thresholds to 1% and 4% respectively
- Make a number of cosmetic changes and updates to events
- Add test-net deployments [Ropsten, Goerli]
- Add additional unit tests, scenarios and formal verification
- Upgrade saddle to include saddle console
- Upgrade Docker for newest version
Patch Notes 3:
This patch includes minor updates:
- Bump to Solidity 0.5.16
- Increase coverage of formal verification
- Add updated Ropsten deployment
- Add tBTC token
- Rename Comp token to simply "Compound"
Compound v2.31
Compound v2.31 Release Candidate
- Additional improvement and optimizations to Dai Savings Rate integration
- Adjusts jump rate model to use a fixed slope jump
- Improves Dai Savings Rate interest model to ensure supply rate always matches or is above DSR itself.
Compound v2.3
Compound v2.3 Release Candidate
- Feature: Add support for multi-collateral DAI as a new token
- Feature: Allow upgrades for cTokens which have upgradable underlying tokens
- Improvement: Allow liquidation of a borrow collateralized in the same kind of token
- Improvement: Add support for Erc-20 tokens which have a fee on transfers