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

use unchecked math in Comp token refresh #205

Open z0r0z opened 2 years ago

z0r0z commented 2 years ago

I noticed Comp token got a refresh and uses ^0.8.0 solidity. This will automatically do 'safemath' checks, which cost more gas. Since Comp token was already doing unchecked math in many cases, it makes sense to wrap these statements. For example this cannot underflow.