Skip to content

Add _setCollateralPaused function to Comptroller #19

@nourharidy

Description

@nourharidy

Add a _setCollateralPaused(CToken cToken, bool state) public returns (bool) function the Comptroller that disables future borrows for all users using a cToken as collateral

Similar to the other guardian roles, the function can be called by either the pauseGuardian or the admin (governance). However, only admin can pass state as false. Both can pass it as true.

If state is passed as true, the Comptroller should prevent future borrows across all Anchor markets for any user that uses the cToken as a collateral by checking checkMembership(address account, CToken cToken) function. If passed as false, the effect should be reversed.

The function should allow multiple cTokens to be paused as collateral at the same time.

Changes should be made to https://github.com/InverseFinance/anchor/blob/master/contracts/Comptroller.sol and its dependencies only.

The modified Comptroller will replace the existing Anchor Comptroller on Ethereum by executing a a proxy pattern upgrade on the Unitroller https://etherscan.io/address/0x4dcf7407ae5c07f8681e1659f626e114a7667339

Changes to the Comptroller must follow proxy pattern best practices in order to avoid an upgrade flaw

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions