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

feat: use require in SafeMath #1187

Merged
merged 2 commits into from
Aug 10, 2018
Merged

Conversation

sohkai
Copy link
Contributor

@sohkai sohkai commented Aug 10, 2018

Following #1121 and #1120, changes SafeMath to use reverts instead of asserts.

Fixes #1120.

  • πŸ“˜ I've reviewed the OpenZeppelin Contributor Guidelines
  • βœ… I've added tests where applicable to test my new functionality.
  • πŸ“– I've made sure that my contracts are well-documented.
  • 🎨 I've run the JS/Solidity linters and fixed any issues (npm run lint:all:fix).

@@ -22,11 +22,11 @@ contract('SafeMath', () => {
result.should.be.bignumber.equal(a.plus(b));
});

it('throws an error on addition overflow', async function () {
it('throws an revert error on addition overflow', async function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: throws a revert :) (on this and all other it blocks)

@nventuro nventuro added kind:improvement contracts Smart contract code. breaking change Changes that break backwards compatibility of the public API. labels Aug 10, 2018
@nventuro nventuro self-assigned this Aug 10, 2018
@nventuro nventuro added this to the v2.0 milestone Aug 10, 2018
Copy link
Contributor

@nventuro nventuro left a comment

Choose a reason for hiding this comment

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

Awesome @sohkai, glad we're moving forward with this!

@nventuro nventuro merged commit c9e9158 into OpenZeppelin:master Aug 10, 2018
@sohkai sohkai deleted the safemath-require branch August 10, 2018 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Changes that break backwards compatibility of the public API. contracts Smart contract code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Another attempt on SafeMath assert->require but for a different reason
2 participants