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.