KVORUM
compoundSource: Compound governor bravo · #80

Update cSUSHI cToken Implementation

defeatedJan 11, 2022, 10:39 PM UTCby580x589c…9a4d

01Summary

AISummary by Kvorumclaude-haiku-4-5

Upgrade cSUSHI cToken implementation to Solidity 0.8.6 with custom errors instead of error codes. No core logic changes intended. Implementation audited by ChainSecurity.

Type
contract upgrade

Key changes

  • Upgrade Solidity version from previous version to 0.8.6(medium)
  • Replace SafeMath and CarefulMath with Solidity 0.8 built-in checked math(medium)
  • Replace custom errorCode return values with reverts and custom errors(medium)
  • No intended behavior changes in successful execution paths(high)

Notable concerns

  • Changes affect error handling behavior - failures will now revert instead of returning error codes
  • Future cToken upgrades planned pending results of this proposal
  • Multiple Solidity versions maintained in repository during transition period
Contracts0x4b0181102a0112a2ef11abee5563bb4a3176c9d70xFcB924Ae46C7DDc6ad4F873a59ad6F3b5A2e20d5
Generated by Kvorum
model: claude-haiku-4-5
provider: anthropic
profile: anthropic-fast-v1
prompt: v1.0
generated: 2mo ago
Read the description ↗

02Description

289 words

Update cSUSHI cToken Implementation

Summary

This proposal is a patch developed by Equilibria which updates the cToken implementation contract for cSUSHI to a more recent Solidity version (0.8.6) and removes error codes in favor of reverts with custom errors. No other core logic changes are intended. The new implementation has been deployed to 0xFcB924Ae46C7DDc6ad4F873a59ad6F3b5A2e20d5

Changelog

These changes implement the following:

  • Upgrade the Solidity version of the cToken and related contracts to 0.8.6 - all contracts in the repo were changed to 0.8.6 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.

It is important to note that the goal is to have no behavior changes in the happy path case, and to only move away from errorCodes and to revert in the failure case (both math errors and checks). All existing unit and scenario tests should pass with only changes to the error code cases.

More cTokens will be upgraded in a future proposal if this one passes and causes no issues.

Development

The code changes can be viewed here: Pull Request #152.

An audit was completed by the ChainSecurity Team and all issues were either fixed or out of scope for this change. For further discussion, please view the Community Forum thread.

03Mismatch analysis

AIMismatch analysis by Kvorumclaude-sonnet-5
Consistent

The single decoded action is a standard Compound _setImplementation call on the cSUSHI cToken proxy, pointing to the new implementation address 0xFcB924Ae46C7DDc6ad4F873a59ad6F3b5A2e20d5 — this exactly matches the address given in the proposal's Summary section as the deployed patched implementation. The proposal's stated intent (swap in a new, functionally-equivalent implementation with updated Solidity version and error handling) aligns precisely with what a _setImplementation call does: it swaps the logic contract behind the cToken proxy without altering state. The allowResign=true and empty bytes arguments are standard boilerplate for this call type and not something the description would be expected to itemize. There is no other action in the calldata, and the description does not claim any additional actions (e.g., parameter changes, transfers, or role grants) beyond the implementation swap, so there's nothing extra or omitted. Confidence is high because the target address in the description is a specific, checkable Ethereum address that matches the calldata argument exactly.重

Generated by Kvorum
model: claude-sonnet-5
provider: anthropic
profile: anthropic-strong-v1
prompt: v1.0
generated: 2mo ago
Review the decoded actions ↗

04Actions

1 total
#0_setImplementation(address,bool,bytes)chain 0x1
Target
0x4b01…c9d7
Value
0 wei
Function
_setImplementation(address,bool,bytes)
Arguments
{
  "0": "0xFcB924Ae46C7DDc6ad4F873a59ad6F3b5A2e20d5",
  "1": true,
  "2": "0x"
}
Calldata

05Tally

Summed from votes

Voters2
VP participating376K
Outcome (current)Against
Current support0%

06Voters

2 total
Filter:
VoterChoice% of totalRationale
EA0xea6c…3bf7Against306K81.38%—5y ago
8D0x8d07…a265Against70K18.62%—5y ago
Showing 2

07Forum

No forum thread is confidently linked to this proposal.