Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize codebase Part 2 #297

Closed
wants to merge 17 commits into from

Conversation

petejkim
Copy link
Contributor

@petejkim petejkim commented May 14, 2020

Requires #296.

  1. Set up TypeScript (existing JS files aren't converted)
  2. Set up TypeScript and Solidity linters
  3. Add tests to check that storage slot positions stay the same between FiatTokenV1 and V2. This test also ensures Solidity upgrade does not affect storage slots going forward.
  4. Update contracts to Solidity v0.6.7

@petejkim petejkim changed the title Modernize Codebase Part 2 Modernize codebase Part 2 May 14, 2020
@@ -96,13 +96,6 @@ async function run_tests(newToken, _accounts) {
await checkVariables([token], [customVars]);
});

it("nut007 should fail to call proxy function with non-adminAccount", async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was no point in putting ifAdmin modifier for admin() and implementation(). Besides, those were marked as view functions, but if a non-admin invokes those functions, the modifier could cause a delegate call to the functions with the same name in the implementation contract which may not be read-only (i.e. not view). New versions of Solidity compiler correctly catches this and errors out. The implementation contract should also never contain meaningful admin() and implementation() defined that relies on the modifier to be callable.

require(msg.sender == blacklister);
require(
msg.sender == blacklister,
"Blacklistable: caller is not the blacklister"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The format and wording of the error messages follow the convention in OpenZeppelin code.

@petejkim
Copy link
Contributor Author

Closing in favor of merging with previous PR #296

@petejkim petejkim closed this May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant