Omniscia Rari Capital Audit

The changes brought by the Rari Capital development team changed several files in the Compound codebase, some less drastically than others. In order to be transparent with regards to these changes, we have created this dedicated chapter that details what type of changes were brought for each file. These changes take into account the f162ce512934a9e0642595b6e0cfef5cc869b981 commit hash of the official Compound Protocol repository.

CErc20.sol

The contract was updated to relay the newly introduced reserveFactorMantissa_ and adminFeeMantissa_ constructor variables to its inheritance tree.

CErc20Delegate.sol

The order of inheritance was adjusted to comply with the proxy pattern and ensure the same storage slots are assigned for both the delegate and the delegator.

CErc20Delegator.sol

The inherited contracts were adjusted to comply with the proxy pattern ensuring the same storage slots are assigned for both the delegate & the delegator and its constructor was updated in a similar fashion to CErc20's delegating the newly introduced arguments.

Additionally, the administrative checks were replaced by the hasAdminRights invocation and the way calls are relayed was swapped from an explicit notation to a catch-all fallback function.

CErc20Immutable.sol

The initialize call was updated to pass zeroed-out arguments to the new argument slots.

CEther.sol

The constructor was adjusted in a similar lieu to CErc20.

CEtherDelegate.sol

The order of inheritance was adjusted to comply with the proxy pattern and ensure the same storage slots are assigned fro both the delegate and the delegator.

CEtherDelegator.sol

The inherited contracts were adjusted to comply with the proxy pattern ensuring the same storage slots are assigned for both the delegate & the delegator and its constructor was updated in a similar fashion to CEther's delegating the newly introduced arguments.

Additionally, the administrative checks were replaced by the hasAdminRights invocation and the way calls are relayed was swapped from an explicit notation to a catch-all fallback function.

CToken.sol

New mantissas were introduced to acquire admin fees for the administrator, the fuse contracts and a mantissa for the reserve factor.

Additionally, restrictions wre introduced for minting and for borrowing that are based on newly introduced functions to the Comptroller implementation. A maximum utilization rate was also introduced as well as setters for the fees.

CTokenInterfaces.sol

The common storage slots were introduced into a separate CTokenAdminStorage contract that is inherited by CTokenStorage as well as delegator implementations.

Comptroller.sol

A tracking mechanism for a list o borrowers and minters was introduced as well as two new checks for minting and borrowing along with utility functions.

ComptrollerInterface.sol

The interface was adjusted to reflect the newly implemented methods of Comptroller.sol

ComptrollerStorage.sol

The storage contract was adjusted to support the new functions of Comptroller as well as the uniform storage convention for delegators and delegates.

ErrorReporter.sol

New errors were introduced to account for the new edge cases that can occur in the forked code.

IFuseFeeDistributor.sol

A new contract was introduced that details the interface of an IFuseFeeDistributor to properly interact with in the Comptroller and CToken implementations.

Unitroller.sol

The Unitroller implementation was adjusted to utilize the new access control utility function hasAdminRights in place of literal comparisons.