Remix not recognizing ReentrancyGuard

Using:
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; in remix and its saying not found. Any suggestions is appreciated

Hi, welcome! :wave:

I think if you want to use the latest version that is 0.8.x, it should be

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

You can look through their repo to find the correct route:

Thank you that did fix that error but now its giving me another
not found libs/SafeBEP20.sol

This is the start of the contract I'm using:
pragma solidity 0.8.0;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "./libs/IBEP20.sol";
import "./libs/SafeBEP20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

libs/SafeBEP20 is a file in your own project. This error has nothing to do with OpenZeppelin Contracts.

1 Like