Skip to content

[P1-L04] Update require messages#1259

Merged
chrismaree merged 6 commits intomasterfrom
update-require-messages
Apr 21, 2020
Merged

[P1-L04] Update require messages#1259
chrismaree merged 6 commits intomasterfrom
update-require-messages

Conversation

@chrismaree
Copy link
Copy Markdown
Member

This PR updates require messages within the DVM. Specifically places that were missing require messages now include them and messages that are over 32 chars in length were decreased to optimize gas usage.

Signed-off-by: Christopher Maree <christopher.maree@gmail.com>
@chrismaree chrismaree added the audit-fix-phase1 Fixes for Phase 1 (DVM) of the OZ audit label Apr 20, 2020
Signed-off-by: Christopher Maree <christopher.maree@gmail.com>
Signed-off-by: Christopher Maree <christopher.maree@gmail.com>
Comment thread package.json
"pretty-quick": "^2.0.1",
"prettier": "1.19.1",
"prettier-plugin-solidity": "^1.0.0-alpha.46",
"prettier-plugin-solidity": "1.0.0-alpha.46",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

unrelated to changes but locking this prettier version because prettier 1.0.0-alpha.48 is now out which results in a bunch of linting changes to our code. If we enable higher versions we will need to lint all the contracts again.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you're unlocking or locking? it looks like you're unlocking

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

To my understanding this pins us to use exactly this package version.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Doesn't the "^" pin it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

https://semver.npmjs.com/

I stand corrected. Based on this, the "^" does not pin it.

Signed-off-by: Christopher Maree <christopher.maree@gmail.com>
Comment thread core/contracts/oracle/implementation/TokenMigrator.sol Outdated
Copy link
Copy Markdown
Member

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

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

Aren't there a few requires in Voting.sol that don't have messages?

@chrismaree
Copy link
Copy Markdown
Member Author

Aren't there a few requires in Voting.sol that don't have messages?

The only ones that currently dont have are in modifiers. I can add messages to these but they are quite low level. For consistancy sake I'll add them

modifier onlyRegisteredContract() {
        if (migratedAddress != address(0)) {
            require(msg.sender == migratedAddress);
        } else {
            Registry registry = Registry(finder.getImplementationAddress(OracleInterfaces.Registry));
            require(registry.isContractRegistered(msg.sender));
        }
        _;
    }

    modifier onlyIfNotMigrated() {
        require(migratedAddress == address(0));
        _;
    }

Signed-off-by: Christopher Maree <christopher.maree@gmail.com>
Copy link
Copy Markdown
Member

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

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

LGTM!

@chrismaree chrismaree merged commit f21afb0 into master Apr 21, 2020
@chrismaree chrismaree deleted the update-require-messages branch April 21, 2020 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit-fix-phase1 Fixes for Phase 1 (DVM) of the OZ audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants