nonReentrant modifier not found or not unique

Unfortunately could not make the nonReentrant modifier work.

:memo:Details

Getting this error
Identifier not found or not unique.

import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";

function mintWithFee(
        address _to,
        Fee[] memory _fees,
        AttributesStruct[] memory _attributes
    ) public nonReentrant payable {
...
}

:1234: Code to reproduce
selimerunkut/nft_troubleshoot

:computer: Environment
@openzeppelin/contracts-upgradeable”: “^4.0.0”,
“truffle”: “^5.3.1”

Hi, I think your contract should be inherited from ReentrancyGuardUpgradeable, that is:

contract YOUR_CONTRACT is ReentrancyGuardUpgradeable {  <<<======= here!
    xxx;
    function mintWithFee(
        address _to,
        Fee[] memory _fees,
        AttributesStruct[] memory _attributes
    ) public nonReentrant payable {
        ...
    }
}
1 Like

Will try it out, thanks

1 Like