1

While trying to use SafeMath to compute the modulo of a uint256 like shown in this video:https://www.youtube.com/watch?v=JqZWariqh5s (without SafeMath) I'm having some trouble finding a pragma solidity 0.6.6 version of the SafeMath contract.

If I simply use the @openzeppelin command it defaults to pragma solidity 0.8.0 which is incompatible with the remainder of my code. Hence, I was wondering: where I can find a working SafeMath.sol file using pragma solidity 0.6.6?

1
  • 1
    For anyone seeing this in 2022 and beyond: you don't need SafeMath in Solidity v0.8 and above anymore. Jun 22, 2022 at 17:04

1 Answer 1

4

You can get that on openzepplins github. Just navigate to Github then Openzeeplin-contracts. Go to the branches and check a lower branch.

import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.3/contracts/math/SafeMath.sol';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.