MurderHeadDeathClubNFT

Smart Contract Audit Report

Audit Summary

MHDC Audit Report MurderHeadDeathClubNFT is a new NFT collection with a presale and public sale format.

For this audit, we reviewed the project team's MHDC contract at 0x8b6d881cb985c2c49e893a522735852839c58737 and Secondaries contract at 0xb551babf0171a0deeca60adcc60bd88c278abd9e on the Ethereum Mainnet.

Audit Findings

Please ensure trust in the team prior to investing as they have some control in the ecosystem.
Date: March 18th, 2022.
Updated: March 21st, 2022 to address changes made by the team.

Finding #1 - MHDC - Medium (Resolved)

Description: The primaryMint() function is vulnerable to reentrancy attacks although it is limited to only whitelisted users. Reentrancy is made possible via the call to _safeMint(), which requires that the receiver has implemented the onERC721Received() function in the event that the receiver is a contract.
Risk/Impact: Addresses can use the onERC721Received() function to execute arbitrary logic and reenter the primaryMint() function in an effort to mint NFTs in excess of the presale and presale wallet amount limits.
Recommendation: The logic in the primaryMint() function should be restructured to follow the Checks-Effects-Interactions pattern. The _primarySold and _primary[_msgSender()] values should be increased by the appropriate amount prior to minting any NFTs.
Resolution: The team has implemented the above recommendation.

Finding #2 - MHDC - Medium (Resolved)

Description: The publicMint() function is vulnerable to reentrancy attacks. Reentrancy is made possible via the call to _safeMint(), which requires that the receiver has implemented the onERC721Received() function in the event that the receiver is a contract.
Risk/Impact: Addresses can use the onERC721Received() function to execute arbitrary logic and reenter the publicMint() function in an effort to mint NFTs excess of the public sale public sale wallet amount limits.
Recommendation: The logic in the publicMint() function should be restructured to follow the Checks-Effects-Interactions pattern. The _publicSold and _public[_msgSender()] values should be increased by the appropriate amount prior to minting any NFTs.
Resolution: The team has implemented the above recommendation.

Finding #3 - MHDC - Low (Resolved)

Description: Any excess ETH supplied to the contract during minting is not returned to the user.
Risk/Impact: Users will lose any excess funds sent as payment.
Recommendation: The contract should require the user to supply the exact amount of ETH needed to mint the desired amount of NFTs.
Resolution: The contract only accepts the exact amount of ETH for the specified amount of NFTs.

Finding #4 - MurderHeadDeathClub - Informational

Description: Several functions are declared public, but are never called internally.
MHDC.getShareTotal, MHDC.getName, MHDC.allDist, MHDC.isDist, MHDC.getPrice, MHDC.getPrimaryLimit, MHDC.getPublicLimit, MHDC.isPrimarySale, MHDC.isPublicSale, MHDC.getPrimarySold, MHDC.getPublicSold, MHDC.getTotalSold, MHDC.getAddressPrimarySold, MHDC.getAddressPublicSold, MHDC.isPrimaryAddress, Secondaries.getShareTotal, Secondaries.getName, Secondaries.allDist, Secondaries.isDist, Secondaries.allTokens, Secondaries.getTokenName, Secondaries.isToken
Recommendation: We recommend declaring these functions external for additional gas savings on each call.

Contracts Overview

  • As the contracts are implemented with Solidity v0.8.X, they are protected from any underflow/overflow attacks.
MHDC Contract:
  • This contract is used to facilitate a presale and a public sale for the $MHDC NFTs.
  • On deployment, the maximum total supply for $MHDC NFTs is 6,600.
  • The maximum total presale supply of $MHDC NFTs is 6000 and the maximum total public sale supply is 600; if the maximum total presale limit is not reached, the excess amount will be added to the total public sale supply limit.
  • On deployment, the team can provide addresses to be minted specified amounts of $MHDC NFTs.
  • While the presale is active, whitelisted users can each purchase up to a maximum of 3 NFTs until the maximum total presale supply has been reached; each $MHDC NFT has a price of 0.0666 ETH on deployment.
  • While the public sale is active, users can each purchase a maximum of 2 NFTs until the maximum total supply has been reached.
  • Users can provide any amount of ETH when purchasing NFTs but should use caution as excess ETH is not returned.
  • ETH collected in the contract from the presale and public sale is distributed to the distribution list addresses in proportion to each address's share amount.
  • The owner can transfer ownership at any time.
  • The owner can toggle the presale and public sale at any time.
  • The owner can add or remove addresses from the whitelist at any time.
  • The owner can distribute the contract's ETH balance at any time.
  • The owner can set the presale and public sale maximum wallet amount to any value at any time.
  • The owner can add or remove addresses from the distribution list.
  • The owner can change the share amount, address, and name property of any entry in the distribution list at any time.
  • The contract uses the ERC-721A implementation, which promotes significant gas savings during minting.
Secondaries Contract:
  • The contract enables ETH and designated tokens to be distributed to specified addresses in proportion to each address's share amount.
  • The owner can transfer ownership at any time.
  • The owner can distribute the contract's ETH balance at any time.
  • The owner can add or remove any token to be distributed by the contract at any time.
  • The owner can add or remove addresses from the distribution list.
  • The owner can change the share amount, address, and name property of any entry in the distribution list at any time.

Audit Results

Vulnerability CategoryNotesResult
Arbitrary Jump/Storage WriteN/APASS
Centralization of ControlN/APASS
Compiler IssuesN/APASS
Delegate Call to Untrusted ContractN/APASS
Dependence on Predictable VariablesN/APASS
Ether/Token TheftN/APASS
Flash LoansN/APASS
Front RunningN/APASS
Improper EventsN/APASS
Improper Authorization SchemeN/APASS
Integer Over/UnderflowN/APASS
Logical IssuesN/APASS
Oracle IssuesN/APASS
Outdated Compiler VersionN/APASS
Race ConditionsN/APASS
ReentrancyN/APASS
Signature IssuesN/APASS
Unbounded LoopsN/APASS
Unused CodeN/APASS
Overall Contract Safety PASS

MHDC Contract

Smart Contract Audit - Inheritance

Smart Contract Audit - Graph


 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public
 
  + [Int] IERC165 
    - [Ext] supportsInterface

 + [Int] IERC721 (IERC165)
    - [Ext] balanceOf
    - [Ext] ownerOf
    - [Ext] safeTransferFrom #
    - [Ext] transferFrom #
    - [Ext] approve #
    - [Ext] getApproved
    - [Ext] setApprovalForAll #
    - [Ext] isApprovedForAll
    - [Ext] safeTransferFrom #

 + [Int] IERC721Receiver 
    - [Ext] onERC721Received #

 + [Int] IERC721Metadata (IERC721)
    - [Ext] name
    - [Ext] symbol
    - [Ext] tokenURI

 + [Int] IERC721Enumerable (IERC721)
    - [Ext] totalSupply
    - [Ext] tokenOfOwnerByIndex
    - [Ext] tokenByIndex

 + [Lib] Address 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Int] functionDelegateCall #
    - [Int] functionDelegateCall #
    - [Int] verifyCallResult

 +  Context 
    - [Int] _msgSender
    - [Int] _msgData

 + [Lib] Strings 
    - [Int] toString
    - [Int] toHexString
    - [Int] toHexString

 +  ERC165 (IERC165)
    - [Pub] supportsInterface

 +  ERC721A (Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable)
    - [Pub]  #
    - [Pub] totalSupply
    - [Pub] tokenByIndex
    - [Pub] tokenOfOwnerByIndex
    - [Pub] supportsInterface
    - [Pub] balanceOf
    - [Int] _numberMinted
    - [Int] _numberBurned
    - [Int] ownershipOf
    - [Pub] ownerOf
    - [Pub] name
    - [Pub] symbol
    - [Pub] tokenURI
    - [Int] _baseURI
    - [Pub] approve #
    - [Pub] getApproved
    - [Pub] setApprovalForAll #
    - [Pub] isApprovedForAll
    - [Pub] transferFrom #
    - [Pub] safeTransferFrom #
    - [Pub] safeTransferFrom #
    - [Int] _exists
    - [Int] _safeMint #
    - [Int] _safeMint #
    - [Int] _mint #
    - [Prv] _transfer #
    - [Int] _burn #
    - [Prv] _approve #
    - [Prv] _checkOnERC721Received #
    - [Int] _beforeTokenTransfers #
    - [Int] _afterTokenTransfers #

 +  Ownable (Context)
    - [Pub]  #
    - [Pub] owner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Int] _transferOwnership #

 +  MHDC (ERC721A, Ownable)
    - [Pub]  #
       - modifiers: ERC721A
    - [Ext]  ($)
    - [Ext]  ($)
    - [Int] _baseURI
    - [Pub] getShareTotal
    - [Pub] getShare
    - [Pub] getName
    - [Pub] allDist
    - [Pub] isDist
    - [Ext] setPrice #
       - modifiers: onlyOwner
    - [Pub] getPrice
    - [Ext] setPrimaryLimit #
       - modifiers: onlyOwner
    - [Ext] setPublicLimit #
       - modifiers: onlyOwner
    - [Pub] getPrimaryLimit
    - [Pub] getPublicLimit
    - [Pub] isPrimarySale
    - [Pub] isPublicSale
    - [Pub] getPrimarySold
    - [Pub] getPublicSold
    - [Pub] getTotalSold
    - [Pub] getAddressPrimarySold
    - [Pub] getAddressPublicSold
    - [Pub] isPrimaryAddress
    - [Ext] setPrimaryAddresses #
       - modifiers: onlyOwner
    - [Prv] shareTotal #
    - [Pub] addDist #
       - modifiers: onlyOwner
    - [Ext] removeDist #
       - modifiers: onlyOwner
    - [Ext] editDistName #
       - modifiers: onlyOwner
    - [Ext] editDistShare #
       - modifiers: onlyOwner
    - [Ext] primaryMint ($)
    - [Ext] publicMint ($)
    - [Ext] setPrimarySale #
       - modifiers: onlyOwner
    - [Ext] setPublicSale #
       - modifiers: onlyOwner
    - [Ext] distribute #

Secondaries Contract

Smart Contract Audit - Inheritance

Smart Contract Audit - Graph


 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public
 
    +  Context 
    - [Int] _msgSender
    - [Int] _msgData

 +  Ownable (Context)
    - [Pub]  #
    - [Pub] owner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Int] _transferOwnership #

 + [Int] IERC20 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 +  Secondaries (Ownable)
    - [Pub]  #
    - [Ext]  ($)
    - [Ext]  ($)
    - [Pub] getShareTotal
    - [Pub] getShare
    - [Pub] getName
    - [Pub] allDist
    - [Pub] isDist
    - [Pub] allTokens
    - [Pub] getTokenName
    - [Pub] isToken
    - [Prv] shareTotal #
    - [Pub] addDist #
       - modifiers: onlyOwner
    - [Ext] removeDist #
       - modifiers: onlyOwner
    - [Ext] editDistName #
       - modifiers: onlyOwner
    - [Ext] editDistShare #
       - modifiers: onlyOwner
    - [Pub] addToken #
       - modifiers: onlyOwner
    - [Ext] removeToken #
       - modifiers: onlyOwner
    - [Ext] distribute #

About Solidity Finance

Solidity Finance was founded in 2020 and quickly grew to have one of the most experienced and well-equipped smart contract auditing teams in the industry. Our team has conducted 1000+ solidity smart contract audits covering all major project types and protocols, securing a total of over $50 billion U.S. dollars in on-chain value across 1500 projects!.
Our firm is well-reputed in the community and is trusted as a top smart contract auditing company for the review of solidity code, no matter how complex. Our team of experienced solidity smart contract auditors performs audits for tokens, NFTs, crowdsales, marketplaces, gambling games, financial protocols, and more!

Contact us today to get a free quote for a smart contract audit of your project!

What is a Solidity Audit?

Typically, a smart contract audit is a comprehensive review process designed to discover logical errors, security vulnerabilities, and optimization opportunities within code. A Solidity Audit takes this a step further by verifying economic logic to ensure the stability of smart contracts and highlighting privileged functionality to create a report that is easy to understand for developers and community members alike.

How Do I Interpret the Findings?

Each of our Findings will be labeled with a Severity level. We always recommend the team resolve High, Medium, and Low severity findings prior to deploying the code to the mainnet. Here is a breakdown on what each Severity level means for the project:

  • High severity indicates that the issue puts a large number of users' funds at risk and has a high probability of exploitation, or the smart contract contains serious logical issues which can prevent the code from operating as intended.
  • Medium severity issues are those which place at least some users' funds at risk and has a medium to high probability of exploitation.
  • Low severity issues have a relatively minor risk association; these issues have a low probability of occurring or may have a minimal impact.
  • Informational issues pose no immediate risk, but inform the project team of opportunities for gas optimizations and following smart contract security best practices.