contract ERC721 { // take OpenZeppelin contract and add this at the end: uint256 _lastTokenId; /// @dev be careful this function expects recipients to all be unique and not be address(0) function _airdrop(address[] calldata recipients) internal virtual { uint256 length = recipients.length; uint256 tokenId = _lastTokenId; address to; for (uint256 i; i < length; i++) { tokenId++ to = recipients[i]; unchecked { // _airdrop should only be used at the very start of the contract // so to should not have any balance _balances[to] = 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } _lastTokenId = tokenId; } }