Skip to content

Tether, CToken gas optimizations, and a new DAI interest rate model

Compare
Choose a tag to compare
@jflatow jflatow released this 30 Apr 17:34
· 45 commits to master since this release
a79cda9

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:

  1. Remove checkTransferIn in favor of looking at the effect of transfer to handle fees, which obviates the need for checking the transfer in.
  2. Change our delegator contract to use msg.data directly, instead of re-encoding. This removes some unnecessary repacking.
  3. Reduce potentially redundant SLOADs by memoizing values.
  4. 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).
  5. Remove localVars structs as Solidity handles more variables correctly and it cleans up code.
  6. In some cases, switch from CarefulMath to SafeMath (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.
  7. Add Tether to Price Oracle Proxy.
  8. Bump up to 0.5.16 with an eye towards bumping to Solidity 0.6.x-style in the near future
  9. Add a scenario command to check the BorrowRate from an IR model.
  10. Deploy cUSDT to ropsten, mainnet, and rinkeby.