Skip to content

Commit

Permalink
add reentrancy guard to ERC721M base contract (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-yu authored Oct 5, 2022
1 parent baf958b commit 018ad8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions contracts/BucketAuction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

pragma solidity ^0.8.4;

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
Expand All @@ -11,7 +10,7 @@ import "erc721a/contracts/ERC721A.sol";
import "./IBucketAuction.sol";
import "./ERC721M.sol";

contract BucketAuction is IBucketAuction, ERC721M, ReentrancyGuard {
contract BucketAuction is IBucketAuction, ERC721M {
bool private _claimable;
uint256 private _minimumContributionInWei;
uint256 private _price;
Expand Down
7 changes: 4 additions & 3 deletions contracts/ERC721M.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "erc721a/contracts/extensions/ERC721AQueryable.sol";
import "./IERC721M.sol";

contract ERC721M is IERC721M, ERC721AQueryable, Ownable {
contract ERC721M is IERC721M, ERC721AQueryable, Ownable, ReentrancyGuard {
using ECDSA for bytes32;

uint64 public constant MIN_STAGE_INTERVAL_SECONDS = 60;
Expand Down Expand Up @@ -242,7 +243,7 @@ contract ERC721M is IERC721M, ERC721AQueryable, Ownable {
bytes32[] calldata proof,
uint256 timestamp,
bytes calldata signature
) external payable {
) external payable nonReentrant {
_mintInternal(qty, msg.sender, proof, timestamp, signature);
}

Expand All @@ -252,7 +253,7 @@ contract ERC721M is IERC721M, ERC721AQueryable, Ownable {
bytes32[] calldata proof,
uint256 timestamp,
bytes calldata signature
) external payable {
) external payable nonReentrant {
if (_crossmintAddress == address(0)) revert CrossmintAddressNotSet();

// Check the caller is Crossmint
Expand Down

0 comments on commit 018ad8c

Please sign in to comment.