Skip to content

feat: use require in SafeMath#1187

Merged
nventuro merged 2 commits into
OpenZeppelin:masterfrom
sohkai:safemath-require
Aug 10, 2018
Merged

feat: use require in SafeMath#1187
nventuro merged 2 commits into
OpenZeppelin:masterfrom
sohkai:safemath-require

Conversation

@sohkai

@sohkai sohkai commented Aug 10, 2018

Copy link
Copy Markdown
Contributor

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).

Comment thread test/math/SafeMath.test.js Outdated
});

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

Copy link
Copy Markdown
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

@nventuro nventuro left a comment

Copy link
Copy Markdown
Contributor

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