Debug Custom Contract

Contract methods

Mint method

Here's an example mint method in Solidity:

function claim(address _to, uint256 _quantity) external payable {

  // (This method is incomplete)
  
  // If you have any `require` calls, check `_to` instead of `msg.sender`.
  _safeMint(_to, tokenId);
}

Eligibility method (optional)

The optional eligibility method allows checking this buyer is allowed to purchase the specified quantity. If a non-empty string is returned, the error will be shown to the buyer. If an empty string is returned, the buyer will be able to complete their purchse.

Here's an example eligibility method in Solidity.

function checkClaimEligibility(uint256 quantity) external view returns (string memory) {

  // (This method is incomplete)
  
  if (paused) {
    return "Sale period is not live.";
  } else if (quantity > maxMintAmountPerTxn) {
    return "Exceeded max mint amount per transaction.";
  } else if (totalSupply() + quantity > maxSupply) {
    return "Not enough supply";
  }
  return "";
}

s