OpenZeppelin – Resolving Import Problems

importopenzeppelinsafemath

I am trying to import a couple of OpenZeppelin contracts to my project, but each time I am given an error related to unsuccessful imports from sources. I'm gonna attach a screenshot of my code. I have to mention that I am using Macos and I have installed NPM package of OpenZeppelin via terminal, although it's not visible in my node_modules folder. Could anyone help me with a proper way of importing OpenZeppeli contracts on Remix?
Thanks in advance
enter image description here
enter image description here

Best Answer

You have two options to importing OpenZeppelin contracts in Remix IDE:

  1. Copy and paste.
  2. Import with github links.

So if you write:

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol";

That should be fine.

Related Topic