Update High-TVL cToken Implementations
01Summary
This proposal updates the cToken implementation for high-TVL assets to Solidity 0.8.10, removes SafeMath in favor of native checked math, and replaces custom error codes with reverts. It also allocates $350,000 worth of COMP (~3,070 COMP) to Equilibria for the upgrade work and 79,764.36 USDC to Compound Labs for a ChainSecurity audit.
- Type
- contract upgrade
- Funding
- $429,764.36
Key changes
- Upgrade Solidity version from prior version to 0.8.10 for cToken and related contracts(high)
- Remove SafeMath and CarefulMath libraries, relying on Solidity 0.8's native checked arithmetic that automatically reverts on overflow/division by zero(high)
- Replace custom errorCode return values with reverts and custom errors for structured error handling(high)
- Grant 3,070.175438596500000000 COMP (~$350,000 USD at $114/COMP spot price) to Equilibria for upgrade work(high)
- Transfer 79,764.36 USDC from cUSDC reserves to Compound Labs for ChainSecurity audit costs(medium)
Notable concerns
- This is the final proposal in a series to update all upgradeable cTokens; previous upgrade was Proposal 101
Generated by Kvorum
02Description
Update High-TVL cToken Implementations
Summary
This proposal is a patch developed by Equilibria which updates the cToken implementation contract for high TVL assets. The new implementation has been deployed to 0x3363BAe2Fc44dA742Df13CD3ee94b6bB868ea376.
This is the final proposal to bring all upgradeable cTokens up to the new implementation. In addition to updating the implementation, it grants $350,000[1] worth of COMP to Equilibria for the upgrade work and 79,764.36 USDC to Compound Labs for the ChainSecrity audit of the protocol[2].
[1] COMP value based on the current spot price at time of this proposal ($114) [2] ChainSecurity Payment Transaction can be viewed here
Changelog
These changes implement the following:
- Upgrade the Solidity version of the cToken and related contracts to 0.8.10 - all contracts in the repo were changed to 0.8.10 but only the cTokens will be upgraded as part of upcoming governance proposals. This is due to the complexity of having multiple Solidity versions in the same repo.
- Remove the usage of SafeMath and CarefulMath in favor of Solidity 0.8’s checked math - Solidity will now automatically revert when math errors occur (overflows, division by zero, etc)
- Remove the custom errorCode return values in favor of reverts and custom errors - this allows for a more structured way to deal with errors rather than enum or string comparisons.
The previous upgrade can be seen here: Proposal 101
Development
The code changes can be viewed here: Pull Request #152.
Audits of these changes were completed by ChainSecurity and OpenZeppelin and all issues were either fixed or out of scope for this change. For further discussion, please view the Community Forum thread.
03Mismatch analysis
I compared each on-chain action to the corresponding claim in the description. Actions 0-2 set the implementation of three high-TVL cToken markets to the exact address (0x3363BAe2...) named in the description, matching the 'update cToken implementation' claim. Action 3 grants 3,070.175438596500 COMP; at the stated spot price of $114/COMP this equals $350,000, exactly matching the COMP grant claim. Actions 4 and 5 reduce USDC reserves and then transfer 79,764.36 USDC (6-decimal precision) to a recipient address, matching the stated USDC payment for the ChainSecurity audit down to the cent. The reserve-reduction step (action 4) is a mechanical prerequisite for the transfer and is reasonably omitted from the prose as routine bookkeeping, not a material omission. I could not independently verify that the COMP and USDC recipient addresses correspond to 'Equilibria' and 'Compound Labs' respectively, but the amounts align precisely with the description's stated figures, giving high confidence the actions faithfully implement what is described. No value, target, or scope mismatches were found.
Generated by Kvorum
04Actions
- Target
- 0xf650…dcc9
- Value
- 0 wei
- Function
- _setImplementation(address,bool,bytes)
- Arguments
{ "0": "0x3363BAe2Fc44dA742Df13CD3ee94b6bB868ea376", "1": true, "2": "0x" }- Calldata
- Target
- 0x5d3a…3643
- Value
- 0 wei
- Function
- _setImplementation(address,bool,bytes)
- Arguments
{ "0": "0x3363BAe2Fc44dA742Df13CD3ee94b6bB868ea376", "1": true, "2": "0x" }- Calldata
- Target
- 0xccf4…dd6a
- Value
- 0 wei
- Function
- _setImplementation(address,bool,bytes)
- Arguments
{ "0": "0x3363BAe2Fc44dA742Df13CD3ee94b6bB868ea376", "1": true, "2": "0x" }- Calldata
- Target
- 0x3d98…cd3b
- Value
- 0 wei
- Function
- _grantComp(address,uint256)
- Arguments
{ "0": "0x589CDCf60aea6B961720214e80b713eB66B89A4d", "1": "3070175438596500000000" }- Calldata
- Target
- 0x39aa…7563
- Value
- 0 wei
- Function
- _reduceReserves(uint256)
- Arguments
{ "0": "79764360000" }- Calldata
- Target
- 0xa0b8…eb48
- Value
- 0 wei
- Function
- transfer(address,uint256)
- Arguments
{ "0": "0xe8F0c9059b8Db5B863d48dB8e8C1A09f97D3B991", "1": "79764360000" }- Calldata
05Tally
Summed from votes
06Voters
No votes recorded yet.
07Forum
No forum thread is confidently linked to this proposal.