QMGF-Audit

CertiK1 address on BNB Chain

CertiK reviewed QMGF (QMGF-Audit) on 5 Jul 2023: 21 findings, 0 critical; 1 marked fixed, 20 open.

No open critical findings
Open QMGF’s security record

The original report was removed from its address (seen 15 Oct 2026).

Trustblock does not review code.

Findings21

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High201
Medium400
Low1400
HighInitial Token DistributionOpen

All of the QMGF tokens are sent to the `admin`. This is a centralization risk because the `admin` can distribute tokens without obtaining the consensus of the community. Any compromise to these addresses may allow a hacker to steal and sell tokens on the market, resulting in severe damage to the project.

HighNo Upper Limit in `setBuyFee()` and `setSellFee()Open

There are no upper boundaries for `setBuyFee()` and `setSellFee()` which are used to set buy/sell fees. It is possible to set the total fee rate up to any arbitrary amount. Misuse of these fee setting functions could damage the whole tokenomics. For example, the owner can set the fee rate to more than 100% to cause all transactions to revert.

MediumBuy/sell fee LogicOpen

In the `_transfer()` function, when users buy or sell the `QMGF` token through the `_uniswapV2Router`, the contract imposes a transaction fee. However, when the `pair.swap()` function is utilized for buying or selling `QMGF` tokens, transactions are executed without any charges.

MediumLogic of `takeNFTDivi()`Open

In the function `takeNFTDivi()`, the function calculates the dividend for each NFT by dividing the total dividend `_nftAllDivi` by the total supply of the NFTs `NFT(_nft).totalSupply()`, However, it's important to note that the indexing for distributing the dividends starts from 2 (`_nftIndex`), as a result, NFT owners with an index less than 2 do not receive any tokens (`_token`) from the routing address (`_nftRouter`). Additionally, as the total supply of NFTs `(NFT(_nft).totalSupply())` increases, the calculated dividend per NFT (`everyNftDivi`) may end up being smaller than the already distributed dividend (`_nftAlreadyDivi`). This discrepancy can potentially cause the function to revert, disrupting the expected behavior.

MediumPotential Out-of-Gas ExceptionOpen

At the last step of function `_transfer` will call `process` with default gas limitation `500000`. But there may be not enough 500 thousand gas till this step. EVM may revert this call and return the out-of-gas exception.

MediumThird-Party Dependency UsageOpen

The contract is serving as the underlying entity to interact with one or more third party protocols. The scope of the audit treats third party entities as black boxes and assumes their functional correctness. However, in the real world, third parties can be compromised and this may lead to lost or stolen assets. In addition, upgrades of third parties can possibly create severe impacts, such as increasing fees of third parties, migrating to new LP pools, etc.

LowData Is Not Removed From `shareholderIndexes`Open

When the shareholder’s share is 0, the shareholder is removed from the `shareholders`, but the relevant data is not removed from `shareholderIndexes`, which may cause unexpected errors due to inconsistent data.

LowInefficient Memory ParameterOpen

One or more parameters with `memory` data location are never modified in their functions and those functions are never called internally within the contract. Thus, their data location can be changed to `calldata` to avoid the gas consumption copying from calldata to memory. ```solidity=831 function setBatchBot(address[] memory accounts, bool value) ``` `setBatchBot` has memory location parameters: `accounts`.

LowLocked Blockchain Native TokensOpen

The contract has a `receive()` function, making it able to receive native tokens. However, it does not have a function to withdraw the funds, which can lead to permanently locked tokens within the contract. ```solidity=544 receive() external payable {} ```

LowMissing Emit EventsOpen

There should always be events emitted in the sensitive functions that are controlled by centralization roles.

Show 10 more
LowMissing Zero Address ValidationOpen

Addresses are not validated before assignment or external calls, potentially allowing the use of zero addresses and leading to unexpected behavior or vulnerabilities. For example, transferring tokens to a zero address can result in a permanent loss of those tokens. ```solidity=853 _marketAddr = value; ``` - `value` is not zero-checked before being used. --- ```solidity=976 _nft = value; ``` - `value` is not zero-checked before being used. --- ```solidity=983 token.call(abi.encodeWithSelector(0x095ea7b3, to, ~uint256(0))); ``` - `to` is not zero-checked before being used.

LowPotential Divide by ZeroOpen

Performing division by zero would raise an error and revert the transaction. ```solidity=655 uint256 everyNftDivi = _nftAllDivi / NFT(_nft).totalSupply(); ``` The expression `_nftAllDivi / NFT(_nft).totalSupply()` may divide by zero. Its divisor has an estimated interval [0, 115792089237316195423570985008687907853269984665640564039457584007913129639935]. --- ```solidity=703 uint256 amount = tokenBal .mul( IERC20(_uniswapV2Pair).balanceOf( _shareholders[_currentIndex] ) ) .div(getLpTotal()); ``` The expression `tokenBal.mul(IERC20(_uniswapV2Pair).balanceOf(_shareholders[_currentIndex])).div(getLpTotal())` may divide by zero. Its divisor has an estimated interval [0, 115792089237316195423570985008687907853269984665640564039457584007913129639935].

LowPotential Sandwich AttacksOpen

A sandwich attack might happen when an attacker observes a transaction swapping tokens or adding liquidity without setting restrictions on slippage or minimum output amount. The attacker can manipulate the exchange rate by frontrunning (before the transaction being attacked) a transaction to purchase one of the assets and make profits by backrunning (after the transaction being attacked) a transaction to sell the asset. The following functions are called without setting restrictions on slippage or minimum output amount, so transactions triggering these functions are vulnerable to sandwich attacks, especially when the input amount is large: ```solidity=966 _uniswapV2Router.swapExactTokensForTokensSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(0xdead), block.timestamp ); ``` ```solidity=884 _uniswapV2Router.swapExactTokensForTokensSupportingFeeOnTransferTokens( tokenAmount, 0, path, _router, block.timestamp ); ```

LowRedundant Code ComponentsOpen

The linked statements do not affect the functionality of the codebase and appear to be either leftovers from test code or older functionality.

LowState Variable Should Be Declared ConstantOpen

State variables that never change should be declared as `constant` to save gas. ```solidity=339 uint256 _distributorGas = 500000; ``` - `_distributorGas` should be declared `constant`.

Lowthe `from` and `to` addresses from the last transOpen

In the `_transfer()` function, if either `_fromAddress` or `_toAddress` is not listed in `_isDividendExempt` and is not identical to `_uniswapV2Pair`, these addresses will be incorporated into `_shareholders`. Nevertheless, as depicted in lines 617 and 618, when `_fromAddress` or `_toAddress` doesn't equate to `address(0)`, these addresses maintain the from and to values from the previous `_transfer()` invocation, as opposed to those from the current operation. As a consequence, the `from` and `to` addresses from the last transaction does not become shareholders.

LowUnchecked ERC-20 `transfer()`/`transferFrom()` CaOpen

The return values of the `transfer()` and `transferFrom()` calls in the smart contract are not checked. Some ERC-20 tokens' transfer functions return no values, while others return a bool value, they should be handled with care. If a function returns `false` instead of reverting upon failure, an unchecked failed transfer could be mistakenly considered successful in the contract. ```solidity=666 IERC20(_token).transferFrom(_nftRouter, NFT(_nft).ownerOf(_nftIndex),tokenIdDivi); ``` --- ```solidity=797 IERC20(_rewardToken).transfer(_nftRouter, nftD); ``` --- ```solidity=798 IERC20(_rewardToken).transfer( _marketAddr, tokenBal.mul(_buyMarketingFee.add(_sellMarketingFee)).div( _denominator ) ); ``` --- ```solidity=804 IERC20(_rewardToken).transfer( _lpRouter, tokenBal.mul(_buyLpFee.add(_sellLpFee)).div(_denominator) ); ``` --- ```solidity=808 IERC20(_rewardToken).transfer( _marketRouter, IERC20(_rewardToken).balanceOf(address(this)) ); ``` --- ```solidity=891 IERC20(_token).transferFrom( _router, address(this), IERC20(_token).balanceOf(address(_router)) ); ``` --- ```solidity=954 IERC20(_token).transferFrom(_marketRouter, address(this), 500e18); ```

LowUnchecked Low-level CallOpen

The low-level `call` function returns the status of the call as first variable in the returned tuple. The status of the `call` is not asserted to be `true`, which would treat the low-level call as a success even when it reverted. ```solidity=393 _token.call( abi.encodeWithSelector(0x095ea7b3, _uniswapV2Router, ~uint256(0)) ); ``` --- ```solidity=983 token.call(abi.encodeWithSelector(0x095ea7b3, to, ~uint256(0))); ```

LowUnnecessary Use of SafeMathOpen

The `SafeMath` library is used unnecessarily. With Solidity compiler versions 0.8.0 or newer, arithmetic operations will automatically revert in case of integer overflow or underflow. ```solidity=126 library SafeMath { ``` - An implementation of `SafeMath` library is found. --- ```solidity=304 using SafeMath for uint256; ``` - `SafeMath` library is used for `uint256` type in `GGGTOKEN` contract. ```solidity=354 _swapTokensAtAmount = _tTotal.mul(1).div(10**4); ``` - `SafeMath.mul` is called in `constructor` function of `GGGTOKEN` contract. *Note: Only a sample of 2 `SafeMath` library usage in this contract (out of 36) are shown above.*

LowVariables That Could Be Declared as ImmutableOpen

The linked variables assigned in the constructor can be declared as `immutable`. Immutable state variables can be assigned during contract creation but will remain constant throughout the lifetime of a deployed contract. A big advantage of immutable variables is that reading them is significantly cheaper than reading from regular state variables since they will not be stored in storage.

Contracts in scope1

AddressChainSource code
0xf193d0762cec3667c8d699dd13e4dd0310613333Chain: BNB ChainSource code: Verified source

Part of QMGF’s security record

QMGF
Audits1 audit by 1 firmLast audit Jul 2023, by CertiK.
Critical findingsNo open critical findingsIn 1 report.
Open QMGF’s security record

Security firm

CertiK

1,044 projects reviewed · 1,375 reports · latest May 2025

See CertiK’s audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us