Coinsult

Request your audit at coinsult.net

Advanced Manual
Smart Contract Audit

August 5, 2022

Audit requested by

Infinity Gnomes

0xfD0307C6D7668cBac39A87B12D5004906A93d740

Infinity Gnomes / Security Audit

Table of Contents

1. Audit Summary

1.1 Audit scope

1.2 Tokenomics

1.3 Source Code

2. Disclaimer

3. Global Overview

3.1 Informational issues

3.2 Low-risk issues

3.3 Medium-risk issues

3.4 High-risk issues

4. Vulnerabilities Findings

5. Contract Privileges

5.1 Maximum Fee Limit Check

5.2 Contract Pausability Check

5.3 Max Transaction Amount Check

5.4 Exclude From Fees Check

5.5 Ability to Mint Check

5.6 Ability to Blacklist Check

5.7 Owner Privileges Check

6. Notes

6.1 Notes by Coinsult

6.2 Notes by Infinity Gnomes

7. Contract Snapshot

8. Website Review

9. Certificate of Proof

Infinity Gnomes / Security Audit

Audit Summary

Audit Scope

Project Name

Infinity Gnomes

Blockchain

Binance Smart Chain

Smart Contract Language

Solidity

Contract Address

0xfD0307C6D7668cBac39A87B12D5004906A93d740

Audit Method

Static Analysis, Manual Review

Date of Audit

5 August 2022

This audit report has been prepared by Coinsult’s experts at the request of the client. In this audit, the results of the static analysis and the manual code review will be presented. The purpose of the audit is to see if the functions work as intended, and to identify potential security issues within the smart contract.

The information in this report should be used to understand the risks associated with the smart contract. This report can be used as a guide for the development team on how the contract could possibly be improved by remediating the issues that were identified.

Infinity Gnomes / Security Audit

Tokenomics

NFT Supply = 6666

Source Code

Coinsult was comissioned by Infinity Gnomes to perform an audit based on the following code:
https://etherscan.io/address/0xfD0307C6D7668cBac39A87B12D5004906A93d740#code

Infinity Gnomes / Security Audit

Disclaimer

This audit report has been prepared by Coinsult’s experts at the request of the client. In this audit, the results of the static analysis and the manual code review will be presented. The purpose of the audit is to see if the functions work as intended, and to identify potential security issues within the smart contract.

The information in this report should be used to understand the risks associated with the smart contract. This report can be used as a guide for the development team on how the contract could possibly be improved by remediating the issues that were identified.

Coinsult is not responsible if a project turns out to be a scam, rug-pull or honeypot. We only provide a detailed analysis for your own research.

Coinsult is not responsible for any financial losses. Nothing in this contract audit is financial advice, please do your own research.

The information provided in this audit is for informational purposes only and should not be considered investment advice. Coinsult does not endorse, recommend, support or suggest to invest in any project. 

Coinsult can not be held responsible for when a project turns out to be a rug-pull, honeypot or scam.

Infinity Gnomes / Security Audit

Global Overview

Manual Code Review

In this audit report we will highlight the following issues:

Vulnerability Level

Total

Pending

Acknowledged

Resolved

0

0

0

0

2

0

0

0

0

0

0

0

0

0

0

0

Infinity Gnomes / Security Audit

Avoid relying on block.timestamp

block.timestamp can be manipulated by miners.

				
					function _mint(
        address to,
        uint256 quantity,
        bytes memory _data,
        bool safe
    ) internal {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
        // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
        unchecked {
            _addressData[to].balance += uint64(quantity);
            _addressData[to].numberMinted += uint64(quantity);

            _ownerships[startTokenId].addr = to;
            _ownerships[startTokenId].startTimestamp = uint64(block.timestamp);

            uint256 updatedIndex = startTokenId;
            uint256 end = updatedIndex + quantity;

            if (safe && to.isContract()) {
                do {
                    emit Transfer(address(0), to, updatedIndex);
                    if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (updatedIndex != end);
                // Reentrancy protection
                if (_currentIndex != startTokenId) revert();
            } else {
                do {
                    emit Transfer(address(0), to, updatedIndex++);
                } while (updatedIndex != end);
            }
            _currentIndex = updatedIndex;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }
				
			

Recommendation

Do not use block.timestampnow or blockhash as a source of randomness

Exploit scenario

				
					contract Game {

    uint reward_determining_number;

    function guessing() external{
      reward_determining_number = uint256(block.blockhash(10000)) % 10;
    }
}
				
			

Eve is a miner. Eve calls guessing and re-orders the block containing the transaction. As a result, Eve wins the game.

Infinity Gnomes / Security Audit

Too many digits

Literals with many digits are difficult to read and review.

				
					function _feeDenominator() internal pure virtual returns (uint96) {
        return 10000;
    }
				
			

Recommendation

Exploit scenario

				
					contract MyContract{
    uint 1_ether = 10000000000000000000; 
}
				
			

While 1_ether looks like 1 ether, it is 10 ether. As a result, it’s likely to be used incorrectly.

Infinity Gnomes / Security Audit

Other Owner Privileges Check

Coinsult lists all important contract methods which the owner can interact with.

⚠ Owner can mint NFT’s to address directly

⚠ Owner can set max NFT’s per wallet during presale and normal NFT trading

⚠ Owner can change price of the NFT’s

⚠ Owner can change royalty fees

⚠ Owner can withdraw NFT’s

⚠ Owner can change SaleState at any moment also during presale

Infinity Gnomes / Security Audit

Notes

Notes by Infinity Gnomes

No notes provided by the team.

Notes by Coinsult

✅ No notes provided by Coinsult

Infinity Gnomes / Security Audit

Contract Snapshot

This is how the constructor of the contract looked at the time of auditing the smart contract.

				
					contract InfinityGnomes is ERC721A, Ownable, ERC2981 {
    uint256 public price = 0.015 ether;
    uint256 public presalePrice = 0.015 ether;
    uint256 public maxPerWallet = 6;
    
    uint256 public presaleMaxPerWallet = 6;
    

    uint256 public immutable presaleSupply = 6666;
    uint256 public immutable supply = 6666;
				
			

Infinity Gnomes / Security Audit

Website Review

Coinsult checks the website completely manually and looks for visual, technical and textual errors. We also look at the security, speed and accessibility of the website. In short, a complete check to see if the website meets the current standard of the web development industry. 

Type of check

Description

Mobile friendly?

Contains jQuery errors?

Is SSL secured?

Contains spelling errors?

Infinity Gnomes / Security Audit

Certificate of Proof

Infinity Gnomes

Completed KYC Verification at Coinsult.net

Date: 5 August 2022

Infinity Gnomes

Audited by Coinsult.net

Date: 5 August 2022

Coinsult

coinsult.net

End of report
Smart Contract Audit

Request your smart contract audit / KYC

t.me/coinsult_tg