compound-finance / compound-protocol

The Compound On-Chain Protocol
https://compound.finance/developers
BSD 3-Clause "New" or "Revised" License
1.88k stars 1.2k forks source link

Update error handling #207

Open ZrowGz opened 2 years ago

ZrowGz commented 2 years ago

Updated contracts throughout compound protocol, building on the work done by equilibria-xyz's CToken Cleanup that was merged:

Update error handling to modern standards for solidity v0.8.10 Reduce the gas costs for contract deployments & users through efficient if () revert customError(); Reorganize interfaces into standard format, pulling them out of contract files Reduce the reliance upon ErrorReporter.sol where feasible

edit: includes corrections to a few additional contracts

jflatow commented 2 years ago

Updated contracts throughout compound protocol, building on the work done by equilibria-xyz's CToken Cleanup that was merged:

Update error handling to modern standards for solidity v0.8.10 Reduce the gas costs for contract deployments & users through efficient if () revert customError(); Reorganize interfaces into standard format, pulling them out of contract files Reduce the reliance upon ErrorReporter.sol where feasible

edit: includes corrections to a few additional contracts

Thanks for taking an interest in upgrading these contracts! So equilibria was actually encouraged not to upgrade solc, since the contracts that would be upgraded were deployed with the version they were deployed with. The efficient errors, are a function of the solc version as well, I suppose. I wonder what the net gas savings are beyond the recent upgrades, but the cost would be considerable to audit these changes and upgrade all the markets again, so I wouldn't really count on getting them made. This repository is largely becoming legacy, in favor of https://github.com/compound-finance/comet, where there's lots of new and exciting development to be done, so I'd recommend checking it out if you haven't yet!