Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

C4 mothership fixes #119

Open
wants to merge 41 commits into
base: main
Choose a base branch
from
Open

C4 mothership fixes #119

wants to merge 41 commits into from

Conversation

Copy link
Contributor

@mesozoic-technology mesozoic-technology left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

uint16 public constant MIN_FEE = 1; // 0.01%
uint16 public constant MAX_FEE = 100; // 1.00%
uint public constant MIN_FEE = 1e14; // 0.01%
uint public constant MAX_FEE = 1e16; // 1.00%
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we see scenarios on long tail markets where we want more?

@@ -60,65 +60,59 @@ contract OverlayV1Mothership is AccessControlEnumerable {

_setupRole(ADMIN, msg.sender);
_setupRole(GOVERNOR, msg.sender);
_setupRole(GUARDIAN, msg.sender);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing the guardian role? I don't have any strong opinions yet about the types of roles we need but it is likely more than just admin and governor.

Governor would be something with a reasonable time lock for instance.

Guardian would be something along the lines of emergency shutdown.

Admin, that'd be to grant/remove various roles.

Not sure though. I'd like to look at other protocol's thought processes. Fei in particular. We are in the realm of somewhat more permissioned operation so maybe protocols like Aave and Compound should also be taken into account.


marketExists[market] = true;
marketActive[market] = true;
function initializeMarket(address _market) external onlyGovernor {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't really initializing a market, that seems to say we are instantiating some state on the market. We are just adding it to the manifest here in the mothership.

@@ -128,65 +122,92 @@ contract OverlayV1Mothership is AccessControlEnumerable {
@param _collateral Overlay OVL collateral contract address
*/
function initializeCollateral (address _collateral) external onlyGovernor {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, not really initializing here, just adding to the manifest and activating

market_path +
'_raw_uni_framed.json')
market_path
+ '_raw_uni_framed.json')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Changes like this exaggerate pull requests and might lead to annoying conflicts? Just leave it the way it was in the future



def test_initialize_collateral(mothership, collateral, gov, token):
total = mothership.totalCollaterals()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick, I would name this initial_total

mothership.disableCollateral(collateral, {"from": gov})


def test_disable_collateral_reverts_when_not_gov(mothership, collateral, gov,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a function we might also want to have a guardian role authorized for. If something is going haywire, we need immediate action.

@@ -0,0 +1,160 @@
import brownie
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would name this file test_collateral_administration.py

@@ -0,0 +1,136 @@
import brownie
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would name this file test_market_administration.py

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants