// Possible HashMasks fix // 1. Add the following to the Masks.sol on line 17 or so (new line, do not paste in "contract {" or anywhere else. // NOTE: I removed the comments it contained to save space. // The source of it is here: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol abstract contract ReentrancyGuard { uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor () { _status = _NOT_ENTERED; } modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } } // 2. Change line ~113 from contract Masks is Context, Ownable, ERC165, IMasks, IERC721Metadata { // TO contract Masks is ReentrancyGuard, Context, Ownable, ERC165, IMasks, IERC721Metadata { // 3. Change mintNFT on line ~325 from function mintNFT(uint256 numberOfNfts) public payable { // TO function mintNFT(uint256 numberOfNfts) public payable nonReentrant { // Now the reentrancy is not possible anymore.
0.4.18