lohoz/Smart-Contract-MultiTask-Dataset huggingface dataset:
// Solidity 0.8.4
/**
 * @dev Transfers contract/tokenId into contract and issues wrapping token.
 */
function wrap(address contract_, uint256 tokenId) external virtual override nonReentrant {
        require(IERC721(contract_).ownerOf(tokenId) == msg.sender, 'ERC721Wrapper: Caller must own NFT.');
        require(IERC721(contract_).getApproved(tokenId) == address(this), 'ERC721Wrapper: Contract must be given approval to wrap NFT.');
        require(isWrappable(contract_, tokenId), 'ERC721Wrapper: TokenId not within approved range.');

		IERC721(contract_).transferFrom(msg.sender, address(this), tokenId);
        _wrap(msg.sender, tokenId);
	}
// Solidity 0.8.4
/**
 * @dev Updates approved contract/token ranges. Simple access control mechanism.
 */
function _updateApprovedTokenRanges(address contract_, uint256 minTokenId, uint256 maxTokenId) internal virtual {
        require(minTokenId <= maxTokenId, 'ERC721Wrapper: Min tokenId must be less-than/equal to max.');

        if (_approvedTokenRanges[contract_].maxTokenId == 0) {
            _approvedTokenRanges[contract_] = TokenIdRange(minTokenId, maxTokenId);
        } else {
            _approvedTokenRanges[contract_].minTokenId = minTokenId;
            _approvedTokenRanges[contract_].maxTokenId = maxTokenId;
        }
    }
// Solidity 0.8.4
/**
 * @dev Transfers tokenIds to rental pool and returns an ERC721 receipt to owner
 * @param erc721Address Address of supported ERC721 NFT (only erc721 is supported in v1)
 * @param tokenIds TokenIds to be staked within the contract
 * @param rentalFees Fees charged per token rental (in gwei)
 */
function addStaked(
    address erc721Address,
    uint16[] calldata tokenIds,
    uint80[] calldata rentalFees
  ) external whenNotPaused {
    uint256 _nftIndex = getAirSupportIndex(erc721Address);
    require(tokenIds.length == rentalFees.length, 'Token and fee mismatch');

    // Verify ownership and fees, Update storage; Transfer staked colors; Issue Receipt
    for (uint256 i = 0; i < tokenIds.length; i++) {
      require(
        msg.sender == IERC721Enumerable(erc721Address).ownerOf(tokenIds[i]),
        'Token not owned by caller'
      );

      verifyFee(erc721Address, rentalFees[i]);

      AirNFTStorage
        .flashableNFT[_nftIndex + tokenIds[i]]
        .rentalFee = rentalFees[i];

      IERC721Enumerable(erc721Address).transferFrom(
        msg.sender,
        address(this),
        tokenIds[i]
      );

      _safeMint(msg.sender, _nftIndex + tokenIds[i]);
    }
    emit stakeEvent(msg.sender, tokenIds, rentalFees);
  }
// Solidity 0.8.4
/**
 * @dev Removes tokenIds from rental pool and returns them to owner + burns receipt token
 * @param erc721Address Address of ERC721 NFT (only erc721 is supported in v1)
 * @param tokenIds tokens staked within the contract
 * @param claimRoyalties supplied boolean true will claim royalties for those tokens removed from staking
 */
function removeStaked(
    address erc721Address,
    uint16[] calldata tokenIds,
    bool claimRoyalties
  ) external whenNotPaused {
    uint256 _nftIndex = getAirSupportIndex(erc721Address);

    // Withdraw accruals (optional)
    if (claimRoyalties) {
      claim(erc721Address, tokenIds);
    }

    // Verify receipt holder; Transfer tokens; burn receipt
    for (uint256 i = 0; i < tokenIds.length; i++) {
      verifyReceiptOwnership(_nftIndex + tokenIds[i]);

      IERC721Enumerable(erc721Address).safeTransferFrom(
        address(this),
        msg.sender,
        tokenIds[i]
      );

      _burn(_nftIndex + tokenIds[i]);
    }
    emit unstakeEvent(msg.sender, tokenIds);
  }
// Solidity 0.8.4
/**
 * @dev Updates rental fee for supplied tokenIds
 * @param nftAddress Address of supported NFT
 * @param tokenIds TokenIds staked within the contract
 * @param rentalFees Fees charged per token rental (in gwei)
 */
function updateRentalFees(
    address nftAddress,
    uint16[] calldata tokenIds,
    uint80[] calldata rentalFees
  ) public whenNotPaused {
    uint256 _nftIndex = getAirSupportIndex(nftAddress);
    require(tokenIds.length == rentalFees.length, 'Token and fee mismatch');

    // Verify receipt + fees; Update storage
    for (uint256 i = 0; i < tokenIds.length; i++) {
      verifyReceiptOwnership(_nftIndex + tokenIds[i]);

      verifyFee(nftAddress, rentalFees[i]);

      AirNFTStorage
        .flashableNFT[_nftIndex + tokenIds[i]]
        .rentalFee = rentalFees[i];
    }
  }
// Solidity 0.8.4
/**
 * @dev Mints Sync x Colors NFT with staked COLORS NFT tokens.
 * @param mintAmount Amount to mint
 * @param tokenIds tokenIds of COLORS NFT to apply to mint
 */
function mintSyncsWithRentedTokens(
    uint16 mintAmount,
    uint16[] calldata tokenIds
  ) external payable whenNotPaused {
    require(tokenIds.length <= 3, 'Num COLORS must be <=3');

    uint256 mintPrice = 0.05 ether;
    uint256 _nftIndex = 10**16; // Avoid an MLoad here since the Colors contract is predetermined to be within slot 1

    // Calculte fees; Update accrued royalties
    uint256 totalRentalFee = updateRoyalties(
      _nftIndex,
      tokenIds,
      uint80(mintAmount)
    );

    require(
      msg.value == mintAmount * mintPrice + totalRentalFee,
      'Insufficient funds.'
    );

    // Mint to contract address
    ISYNC(SYNCXCOLORS).mint{value: mintAmount * mintPrice}(
      mintAmount,
      tokenIds
    );

    // Transfer NFTs to the sender
    uint256 new_supply = IERC721Enumerable(SYNCXCOLORS).totalSupply();
    for (uint256 i = new_supply - mintAmount; i < new_supply; i++) {
      IERC721Enumerable(SYNCXCOLORS).safeTransferFrom(
        address(this),
        msg.sender,
        i
      );
    }

    emit mintEvent(msg.sender, tokenIds, mintAmount, totalRentalFee);
  }
// Solidity 0.8.4
/**
 * @dev Updates colors of Sync x Colors NFT with staked COLORS NFT tokens
 * @param tokenIds Sync x Colors tokens to recolor
 * @param colorsTokenIds COLORS NFT tokenIds to apply to recolor
 */
function updateSyncColors(
    uint16[] calldata tokenIds,
    uint16[] calldata colorsTokenIds
  ) external payable whenNotPaused {
    require(colorsTokenIds.length <= 3, 'Num COLORS must be <=3');

    uint256 resyncPrice = 0.005 ether;
    uint256 _nftIndex = 10**16; // Avoid an MLoad here since the Colors contract is predetermined to be at first airSupportIndex

    // Verify ownership,
    for (uint256 i = 0; i < tokenIds.length; i++) {
      require(
        msg.sender == IERC721Enumerable(SYNCXCOLORS).ownerOf(tokenIds[i]),
        'SYNC not owned by sender'
      );
    }

    // Verify staked colors; update storage; calculate fees
    uint96 totalRentalFee = updateRoyalties(
      _nftIndex,
      colorsTokenIds,
      uint80(tokenIds.length)
    );

    require(
      msg.value == tokenIds.length * resyncPrice + totalRentalFee,
      'Insufficient funds'
    );

    // Transfer sync, updateColors, transfer sync back to sender
    for (uint256 i = 0; i < tokenIds.length; i++) {
      IERC721Enumerable(SYNCXCOLORS).transferFrom(
        msg.sender,
        address(this),
        tokenIds[i]
      );
      ISYNC(SYNCXCOLORS).updateColors{value: 0.005 ether}(
        tokenIds[i],
        colorsTokenIds
      );
      IERC721Enumerable(SYNCXCOLORS).transferFrom(
        address(this),
        msg.sender,
        tokenIds[i]
      );
    }
    emit recolorEvent(msg.sender, tokenIds, colorsTokenIds, totalRentalFee);
  }
// Solidity 0.8.4
/**
 * @dev Update royalty balances and calculate total fees for the loan
 * @param _nftIndex NFT index
 * @param tokenIds Tokens to be loaned
 * @param size Number of uses to be applied to each loaned token
 # @return airSupportIndex of NFT represented by receipt token ID
 */
function updateRoyalties(
    uint256 _nftIndex,
    uint16[] memory tokenIds,
    uint80 size
  ) internal returns (uint96) {
    uint96 royaltyFee;
    flashableNFTStruct memory rentalNFT;
    for (uint256 i = 0; i < tokenIds.length; i++) {
      require(_exists(_nftIndex + tokenIds[i]), 'COLORS tokenId unavailable');

      rentalNFT = AirNFTStorage.flashableNFT[_nftIndex + tokenIds[i]];
      AirNFTStorage.flashableNFT[_nftIndex + tokenIds[i]].allTimeAccruals =
        rentalNFT.allTimeAccruals +
        rentalNFT.rentalFee *
        size;
      AirNFTStorage.flashableNFT[_nftIndex + tokenIds[i]].accruals =
        rentalNFT.accruals +
        rentalNFT.rentalFee *
        size;
      AirNFTStorage.flashableNFT[_nftIndex + tokenIds[i]].allTimeLends =
        rentalNFT.allTimeLends +
        uint16(size);
      royaltyFee += rentalNFT.rentalFee;
    }

    uint96 totalRentalFee = (royaltyFee * uint96(size) * platformFeeRate) /
      1000;

    AirNFTStorage.platformAccruals +=
      totalRentalFee -
      royaltyFee *
      uint96(size);

    return totalRentalFee;
  }
// Solidity 0.8.4
/**
 * @dev tokenURI function
 * @param tokenId tokenId of receipt
 * @return returns URI of receipt token
 */
function tokenURI(uint256 tokenId)
    public
    view
    override
    returns (string memory)
  {
    require(
      _exists(tokenId),
      'ERC721Metadata: URI query for nonexistent token..'
    );
    uint256 nftIndex = receiptIndex(tokenId);
    uint256 nftTokenId = tokenId - nftIndex;
    address nftAddress = AirNFTStorage.airSupportNFTAddress[nftIndex];
    string memory nftName = IERC721MetaData(nftAddress).name();
    bytes memory nftColor = getReceiptColor(nftAddress, nftTokenId);

    string memory receiptImage = Base64.encode(
      printReceipt(nftName, nftTokenId, nftColor)
    );

    return
      string(
        abi.encodePacked(
          'data:application/json;base64,',
          Base64.encode(
            bytes(
              abi.encodePacked(
                '{',
                '"image":"',
                'data:image/svg+xml;base64,',
                receiptImage,
                '",',
                '"description":"AIR NFT Lender Staking Receipt"',
                ',',
                '"attributes":[',
                '{"trait_type":"Collection","value":"',
                nftName,
                '"},',
                '{"trait_type":"tokenID","value":"',
                tokenId.toString(),
                '"}]}'
              )
            )
          )
        )
      );
  }
// Solidity 0.8.4
/**
 * @dev Produces the receipt token image for tokenURI
 * @param nftName Name of NFT to be printed on the receipt
 * @param tokenId tokenId to be printed on the receipt
 * @return returns SVG as bytes
 */
function printReceipt(
    string memory nftName,
    uint256 tokenId,
    bytes memory color
  ) internal pure returns (bytes memory) {
    return
      abi.encodePacked(
        '<svg xmlns="http://www.w3.org/2000/svg" width="320" height="450" viewbox="0 0 320 450" style="background-color:#FFFFFF">',
        '<g id= "2"> <path d = "M20 400L20 30L40 30L60 60L100 30L120 30L140 60L180 30L200 30L220 60L260 30L280 30L300 60L300 220" ',
        'stroke="black" fill="',
        color,
        '" stroke-width="15"/><path d = "M300 60L300 400" stroke="black" stroke-width="30"/>',
        '</g><use href="#2" x="0" y="0" transform="scale(1,-1) translate(0,-450)"/>',
        '<path d = "M60 310L260 310" stroke="black" stroke-width="15"/><path d = "M60 260L260 260" stroke="black" stroke-width="15"/>',
        '<text x="50" y="180" font-size="8em">AIR</text><text x="60" y="245" font-size="1em">',
        nftName,
        '</text><text x="60" y="295" font-size="1em">TokenID #',
        tokenId.toString(),
        '</text><text x="60" y="355" font-size="1em">Redeemable at SyncxColors.xyz</text>',
        '<text x="60" y="375" font-size="1em">Powered by AirNFT</text></svg>'
      );
  }
// Solidity 0.8.4
/**
 * @dev Get color for receipt
 * @param nftAddress Address of NFT for receipt
 * @param tokenId tokenId of NFT for receipt
 * @return returns hex color string as bytes
 */
function getReceiptColor(address nftAddress, uint256 tokenId)
    internal
    view
    returns (bytes memory)
  {
    if (nftAddress == THE_COLORS) {
      return bytes(ITheColors(THE_COLORS).getHexColor(tokenId));
    } else {
      return '#DDDDDD'; // Future: For other collections, generate colors by hash of uri.
    }
  }
// Solidity 0.8.4
/**
 * @dev Withdraws all royalties accrued by the calling address (based on receipts held)
 * @param nftAddress Nft address
 */
function claimAllContract(address nftAddress) public whenNotPaused {
    uint256 _nftIndex = getAirSupportIndex(nftAddress);

    uint256 royalties;
    uint256 bal = balanceOf(msg.sender);
    uint256 receiptTokenId;
    for (uint256 i = 0; i < bal; i++) {
      receiptTokenId = tokenOfOwnerByIndex(msg.sender, i);
      if (receiptIndex(receiptTokenId) == _nftIndex) {
        royalties += AirNFTStorage.flashableNFT[receiptTokenId].accruals;
        AirNFTStorage.flashableNFT[receiptTokenId].accruals = 0;
      }
    }
    _claim(royalties);
  }
// Solidity 0.8.4
/**
 * @dev External Facing: Withdraws royalties accrued for the supplied tokenIds (based on receipts held)
 * @param nftAddress Address of NFT
 * @param tokenIds tokenIds staked within the contract
 */
function claim(address nftAddress, uint16[] calldata tokenIds)
    public
    whenNotPaused
  {
    uint256 _nftIndex = getAirSupportIndex(nftAddress);

    uint256 royalties;
    for (uint256 i = 0; i < tokenIds.length; i++) {
      verifyReceiptOwnership(_nftIndex + tokenIds[i]);
      royalties += AirNFTStorage.flashableNFT[_nftIndex + tokenIds[i]].accruals;
      AirNFTStorage.flashableNFT[_nftIndex + tokenIds[i]].accruals = 0;
    }
    _claim(royalties);
  }
// Solidity 0.8.4
/**
 * @dev Returns total rental cost for supplied tokenIds
 * @param nftAddress Address of NFT
 * @param tokenIds tokens staked within the contract
 * @return Total rental cost (in gwei)
 */
function getRentalCost(address nftAddress, uint16[] calldata tokenIds)
    public
    view
    returns (uint256)
  {
    uint256 _nftIndex = getAirSupportIndex(nftAddress);

    uint256 rentalFee = 0;
    for (uint256 i = 0; i < tokenIds.length; i++) {
      rentalFee += AirNFTStorage
        .flashableNFT[_nftIndex + tokenIds[i]]
        .rentalFee;
    }
    return (rentalFee * platformFeeRate) / 1000;
  }
// Solidity 0.8.4
/**
 * @dev Convenience function which returns supported ERC721 tokenIds owned by calling address
 * @param erc721Address Address of ERC721 NFT
 * @param request Address of owner queried
 * @return Array of tokenIds
 */
function getOwnedERC721ByAddress(address erc721Address, address request)
    public
    view
    returns (uint256[] memory)
  {
    require(
      AirNFTStorage.airSupportIndex[erc721Address] != 0,
      'NFT unsupported'
    );

    uint256 bal = IERC721Enumerable(erc721Address).balanceOf(request);
    uint256[] memory tokenIds = new uint256[](bal);
    for (uint256 i = 0; i < bal; i++) {
      tokenIds[i] = IERC721Enumerable(erc721Address).tokenOfOwnerByIndex(
        request,
        i
      );
    }
    return tokenIds;
  }
// Solidity 0.8.4
/**
 * @dev Returns NFT tokenIds staked by calling address (based on receipts held)
 * @param nftAddress Address of ERC721 NFT
 * @param stakerAddress Address of staker
 * @return Array of tokenIds
 */
function getStakedByAddress(address nftAddress, address stakerAddress)
    public
    view
    returns (uint256[] memory)
  {
    uint256 _nftIndex = getAirSupportIndex(nftAddress);

    uint256 bal = balanceOf(stakerAddress);
    uint256[] memory staked = new uint256[](bal);
    uint256 receiptTokenId;
    uint256 index;
    for (uint256 i = 0; i < bal; i++) {
      receiptTokenId = tokenOfOwnerByIndex(stakerAddress, i);
      if (receiptIndex(receiptTokenId) == _nftIndex) {
        staked[index] = receiptTokenId - _nftIndex;
        index++;
      }
    }
    // Trim the array before returning it
    return trimmedArray(staked, index);
  }
// Solidity 0.8.4
/**
 * @dev Returns all ERC721 tokenIds currently staked
 * @param nftAddress Address of ERC721 NFT
 * @return Array of tokenIds
 */
function getStaked(address nftAddress)
    public
    view
    returns (uint256[] memory)
  {
    uint256 _nftIndex = getAirSupportIndex(nftAddress);

    uint256 supply = totalSupply();
    uint256[] memory staked = new uint256[](supply);
    uint256 receiptTokenId;
    uint256 index;
    for (uint256 i = 0; i < supply; i++) {
      receiptTokenId = tokenByIndex(i);
      if (receiptIndex(receiptTokenId) == _nftIndex) {
        staked[index] = receiptTokenId - _nftIndex;
        index++;
      }
    }

    // Trim the array before returning it
    return trimmedArray(staked, index);
  }
// Solidity 0.8.4
/**
 * @dev Returns royalty accruals by address of Staker (based on receipts held)
 * @param stakerAddress Address of token staker
 * @return Total royalties accrued (in gwei)
 */
function getAccruals(address stakerAddress) public view returns (uint256) {
    uint256 royalties;
    uint256 bal = balanceOf(stakerAddress);
    for (uint256 i = 0; i < bal; i++) {
      royalties += AirNFTStorage
        .flashableNFT[tokenOfOwnerByIndex(stakerAddress, i)]
        .accruals;
    }
    return royalties;
  }
// Solidity 0.8.4
/**
 * @dev Returns statistics for the staked ERC721 tokenId
 * @param nftAddress Address of ERC721 NFT
 * @param tokenIds tokenIds
 * @return Array of flashableNFTStruct structs
 */
function stakedNFTData(address nftAddress, uint256[] calldata tokenIds)
    public
    view
    returns (flashableNFTStruct[] memory)
  {
    uint256 _nftIndex = getAirSupportIndex(nftAddress);

    flashableNFTStruct[] memory stakedStructs = new flashableNFTStruct[](
      tokenIds.length
    );

    for (uint256 i = 0; i < tokenIds.length; i++) {
      stakedStructs[i] = AirNFTStorage.flashableNFT[_nftIndex + tokenIds[i]];
    }
    return stakedStructs;
  }
// Solidity 0.8.4
/**
 * @dev Adds NFT contract address to supported staking NFTs
 * @param nftAddress Address of NFT
 */
function addSupportedNFT(address nftAddress, uint96 _minimumFlashFee)
    public
    onlyOwner
  {
    require(
      AirNFTStorage.airSupportIndex[nftAddress] == 0,
      'NFT already supported'
    );
    // Each additional NFT index is incremented by 10**16
    uint64 index = AirNFTStorage.currentIndex + 10**16;
    AirNFTStorage.currentIndex = index;
    AirNFTStorage.airSupportIndex[nftAddress] = index;
    AirNFTStorage.airSupportNFTAddress[index] = nftAddress;
    minimumFlashFee[nftAddress] = _minimumFlashFee;
  }
// Solidity 0.8.4
/**
 * @dev Trims inputArray to size length
 */
function trimmedArray(uint256[] memory inputArray, uint256 length)
    internal
    pure
    returns (uint256[] memory)
  {
    uint256[] memory outputArray = new uint256[](length);
    for (uint256 i = 0; i < length; i++) {
      outputArray[i] = inputArray[i];
    }
    return outputArray;
  }
// Solidity 0.4.16
/* Burn Jane by User */
function burn(uint256 _value) returns (bool success) {
        if (balanceOf[msg.sender] < _value) revert();            // Check if the sender has enough
        balanceOf[msg.sender] -= _value;                         // Subtract from the sender
        totalSupply -= _value;                                   // Updates totalSupply
        Burn(msg.sender, _value);
        return true;
    }
// Solidity 0.4.16
/* Burn Janes from Users */
function burnFrom(address _from, uint256 _value) returns (bool success) {
        if (balanceOf[_from] < _value) revert();                // Check if the sender has enough
        if (_value > allowance[_from][msg.sender]) revert();    // Check allowance
        balanceOf[_from] -= _value;                             // Subtract from the sender
        totalSupply -= _value;                                  // Updates totalSupply
        Burn(_from, _value);
        return true;
    }
// Solidity 0.8.3
/**
 * @dev Performs all the functionalities that are enabled.
 */
function _afterTokenTransfer(ValuesFromAmount memory values, bool selling, bool buying) internal virtual {
        
        if (buying || selling) {
            if (_autoBurnEnabled) {
                _tokenBalances[address(this)] += values.tBurnFee;
                _reflectionBalances[address(this)] += values.rBurnFee;
                _approve(address(this), _msgSender(), values.tBurnFee);
                burnFrom(address(this), values.tBurnFee);
            }

            if (_marketingRewardEnabled) {
                _tokenBalances[address(this)] += values.tMarketingFee;
                _reflectionBalances[address(this)] += values.rMarketingFee;

                _marketingTokensToSwap += values.tMarketingFee;
            }

            if (_rewardEnabled) {
                _distributeFee(values.rRewardFee, values.tRewardFee);
            }
        }

        if (!buying && selling && values.amount >= getReservePercent(maxSellAmountNormalTax) && values.amount < getReservePercent(maxSellAmountPercent)) {
            if (_autoSwapAndLiquifyEnabled) {
                // add liquidity fee to this contract.
                _tokenBalances[address(this)] += values.tLiquifyFee;
                _reflectionBalances[address(this)] += values.rLiquifyFee;
            }
        }
    }
// Solidity 0.8.3
/**
 * @dev Performs transfer between two accounts that are both excluded in receiving reward.
 */
function _transferBothExcluded(address sender, address recipient, ValuesFromAmount memory values) private {

        _tokenBalances[sender] = _tokenBalances[sender] - values.amount;
        _reflectionBalances[sender] = _reflectionBalances[sender] - values.rAmount;
        _tokenBalances[recipient] = _tokenBalances[recipient] + values.tTransferAmount;
        _reflectionBalances[recipient] = _reflectionBalances[recipient] + values.rTransferAmount;        

    }
// Solidity 0.8.3
/**
 * @dev Includes an account from receiving reward.
 *
 * Emits a {IncludeAccountInReward} event.
 *
 * Requirements:
 *
 * - `account` is excluded in receiving reward.
 */
function includeAccountInReward(address account) public onlyOwner {
        require(_isExcludedFromReward[account], "Account is already included.");

        for (uint256 i = 0; i < _excludedFromReward.length; i++) {
            if (_excludedFromReward[i] == account) {
                _excludedFromReward[i] = _excludedFromReward[_excludedFromReward.length - 1];
                _tokenBalances[account] = 0;
                _isExcludedFromReward[account] = false;
                _excludedFromReward.pop();
                break;
            }
        }

        emit IncludeAccountInReward(account);
    }
// Solidity 0.8.3
/**
 * @dev Airdrop tokens to all holders that are included from reward.
 *  Requirements:
 * - the caller must have a balance of at least `amount`.
 */
function airdrop(uint256 amount) public whenNotPaused {
        address sender = _msgSender();
        //require(!_isExcludedFromReward[sender], "Excluded addresses cannot call this function");
        require(!isBlacklisted[_msgSender()], "Blacklisted address");
        require(balanceOf(sender) >= amount, "The caller must have balance >= amount.");

        ValuesFromAmount memory values = _getValues(amount, false, false, false);
        if (_isExcludedFromReward[sender]) {
            _tokenBalances[sender] -= values.amount;
        }
        _reflectionBalances[sender] -= values.rAmount;
        
        _reflectionTotal = _reflectionTotal - values.rAmount;
        _totalRewarded += amount;
        emit Airdrop(amount);
    }
// Solidity 0.8.3
/**
 * @dev Returns the reflected amount of a token.
 *  Requirements:
 * - `amount` must be less than total supply.
 */
function reflectionFromToken(uint256 amount, bool deductTransferFee, bool selling, bool buying) internal view returns(uint256) {
        require(amount <= _totalSupply, "Amount must be less than supply");
        ValuesFromAmount memory values = _getValues(amount, deductTransferFee, selling, buying);
        return values.rTransferAmount;
    }