ERC721

The ERC721 mode uses a deployed ERC721 contract to mint non-fungible tokens (NFTs) as part of the stress test. NFT mints generally require more gas than simple value transfers or ERC20 token transfers, so this mode is useful for testing the performance of the network when more expensive transactions are being made.

The ERC721 contract used for the stress test is called ZexNFT. This contract is deployed on the blockchain network and is used to mint NFTs as part of the stress test.

ZexNFT.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.9.0;

import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";


contract ZexNFTs is ERC721URIStorage {
    using Counters for Counters.Counter;
    Counters.Counter private _tokenIds;
    
    constructor (string memory tokenName, string memory tokenSymbol ) ERC721(tokenName, tokenSymbol){}

    function createNFT(string memory tokenURI) public returns (uint256) {
        uint256 newNFTTokenId = _tokenIds.current();
        _safeMint(msg.sender, newNFTTokenId);
        _setTokenURI(newNFTTokenId, tokenURI);
    
        _tokenIds.increment();
        
        return newNFTTokenId;
    }
}

Last updated