InfinityBit Token

Smart Contract Audit Report

Audit Summary

InfinityBit Token Audit Report InfinityBit Token is a new ERC-20 token on Ethereum that is an automatic liquidity providing protocol.

For this audit, we reviewed the project team's InfinityBitTokenV2 contract at 0xA3cB87080e68AD54D00573983D935Fa85d168FDE on the Ethereum Mainnet.

Audit Findings

Informational findings were identified and the team may want to review them.
Date: April 14th, 2023.

Finding #1 - InfinityBitTokenV2 - Informational

Description: The below if-statement in the _transfer() function is redundant as tax_amount is already set to zero.
uint256 tax_amount;

if(isTaxExempt(from, to))
{
      tax_amount = 0;
}
else
{
      tax_amount = _calcTaxes(amount);
}
Recommendation: The above if-statement in the _transfer() function could be modified as follows for additional gas savings on each transfer:
uint256 tax_amount;

if(!isTaxExempt(from, to))
tax_amount = _calcTaxes(amount);

Finding #2 - InfinityBitTokenV2 - Informational

Description: The _deployHeight and _contractDeployer state variables and the private isBuy() function are not used in the contract.
Recommendation: The team should either remove the above state variables and function to reduce contract size and deployment costs or utilize them in a way that fits their intended functionality.

Contract Overview

  • The total supply of the token is currently ~5.88 billion $IBIT [5,883,566,923.48].
  • No mint or burn functions are accessible, though the circulating supply can be decreased by sending tokens to the 0x..dead address.
  • At the time of writing this report, there are 172 total token holders. The token allocation is as follows:

  • Trading must be enabled by the owner in order for all transfers to take place on the platform. Only the owner can participate in transfers when trading is disabled. Once trading is enabled, it cannot be disabled.
  • The contract enforces a maximum wallet amount that prevents a transfer from occurring if the recipient's token balance will exceed 125 million tokens after the transfer occurs.
  • There is a Liquidity fee, Development fee, and Marketing fee on all transfers where neither the sender nor the recipient is excluded from fees.
  • The tokens collected through fees are swapped for ETH for the purpose of funding Uniswap liquidity and team wallets when the following conditions are met:
    • The automatic token swapping functionality is enabled by the team.
    • The caller is initiating a sell transaction via Uniswap.
    • The contract's swap threshold is either zero or the threshold number of tokens in the Dev wallet, Marketing wallet, and the fees collected through this transfer exceeds the current swap threshold.
  • Liquidity-adds are automatically performed by selling the tokens collected as fees, pairing the received ETH with the token, and adding it as liquidity to the ETH pair.
  • The LP tokens received through this process are sent to the owner. We recommend the team lock these newly acquired LP tokens.
  • The tokens collected through the Development fee and Marketing fee are swapped for ETH and sent to the team's Development wallet and Marketing wallet respectively when the contract's swapping functionality is triggered.
  • If the number of tokens that will be swapped for ETH does not exceed the calculated "maximum auto-swap" value and the current balance of the Dev wallet and Marketing wallet exceeds 100,000 tokens, tokens will be transferred to the contract from either the Dev wallet or Marketing wallet before the swap occurs depending on their current balances in relation to the calculated "max extra autoswap" value.
  • If the contract's swapping functionality is not triggered on a transfer, the tokens collected through the Development fee and Marketing fee are sent to the Development wallet and Marketing wallet respectively. The tokens collected through the Liquidity fee are sent to the contract.
  • Tokens are minted and locked within the contract at a 1:1 ratio to the transaction's total tax amount. The total supply is not increased in the contract to reflect these minted tokens.
  • As the contract is deployed with Solidity v0.8.18, it is protected from overflows/underflows.
  • The contract complies with the ERC-20 token standard.
Ownership Controls:
  • The owner can set the Liquidity fee, Development fee, and Marketing fee to any percentages as long as the total combined fee percentage does not exceed 5% at any time.
  • The owner can include and exclude accounts from fees at any time.
  • The owner can include and exclude accounts from the maximum wallet restriction at any time.
  • The owner can enable/disable the maximum wallet restriction at any time.
  • The owner can enable/disable the automatic token swapping functionality at any time.
  • The owner can set the token swapping deadline to any value (in seconds) at any time.
  • The owner can set the token swapping limit to any value up to 5% at any time.
  • The owner can set the token swapping threshold to any value up to 5% at any time.
  • The owner can enable/disable the transferring of tokens from the Marketing wallet or Dev wallet to the contract during swaps at any time.
  • The owner can manually trigger the transferring of tokens from the Marketing wallet or Dev wallet to the contract at any time as long as the necessary conditions listed above are met.
  • The owner can perform an airdrop one time which will transfer tokens from the owner to the specified legacy holder addresses.
  • The owner can update the Uniswap Pair address at any time.
  • The owner can update the team's Dev wallet and Marketing wallet to any addresses at any time.

Audit Results

Vulnerability Category Notes Result
Arbitrary Jump/Storage Write N/A PASS
Centralization of Control The team has access to the Ownership Controls listed above. PASS
Compiler Issues N/A PASS
Delegate Call to Untrusted Contract N/A PASS
Dependence on Predictable Variables N/A PASS
Ether/Token Theft N/A PASS
Flash Loans N/A PASS
Front Running N/A PASS
Improper Events N/A PASS
Improper Authorization Scheme N/A PASS
Integer Over/Underflow N/A PASS
Logical Issues N/A PASS
Oracle Issues N/A PASS
Outdated Compiler Version N/A PASS
Race Conditions N/A PASS
Reentrancy N/A PASS
Signature Issues N/A PASS
Sybil Attack N/A PASS
Unbounded Loops N/A PASS
Unused Code N/A PASS
Overall Contract Safety   PASS

Inheritance Chart

Smart Contract Audit - Inheritance

Function Graph

Smart Contract Audit - Graph

Functions Overview


 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public

 + [Lib] Address 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Int] functionDelegateCall #
    - [Int] functionDelegateCall #
    - [Int] verifyCallResultFromTarget
    - [Int] verifyCallResult
    - [Prv] _revert

 +  Context 
    - [Int] _msgSender
    - [Int] _msgData

 +  Ownable (Context)
    - [Pub]  #
    - [Pub] owner
    - [Int] _checkOwner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Int] _transferOwnership #

 + [Int] IERC20 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Int] IUniswapV2Router01 
    - [Ext] factory
    - [Ext] WETH
    - [Ext] addLiquidity #
    - [Ext] addLiquidityETH ($)
    - [Ext] removeLiquidity #
    - [Ext] removeLiquidityETH #
    - [Ext] removeLiquidityWithPermit #
    - [Ext] removeLiquidityETHWithPermit #
    - [Ext] swapExactTokensForTokens #
    - [Ext] swapTokensForExactTokens #
    - [Ext] swapExactETHForTokens ($)
    - [Ext] swapTokensForExactETH #
    - [Ext] swapExactTokensForETH #
    - [Ext] swapETHForExactTokens ($)
    - [Ext] quote
    - [Ext] getAmountOut
    - [Ext] getAmountIn
    - [Ext] getAmountsOut
    - [Ext] getAmountsIn

 + [Int] IUniswapV2Router02 (IUniswapV2Router01)
    - [Ext] removeLiquidityETHSupportingFeeOnTransferTokens #
    - [Ext] removeLiquidityETHWithPermitSupportingFeeOnTransferTokens #
    - [Ext] swapExactTokensForTokensSupportingFeeOnTransferTokens #
    - [Ext] swapExactETHForTokensSupportingFeeOnTransferTokens ($)
    - [Ext] swapExactTokensForETHSupportingFeeOnTransferTokens #

 + [Int] IUniswapV2Factory 
    - [Ext] feeTo
    - [Ext] feeToSetter
    - [Ext] getPair
    - [Ext] allPairs
    - [Ext] allPairsLength
    - [Ext] createPair #
    - [Ext] setFeeTo #
    - [Ext] setFeeToSetter #

 + [Int] IUniswapV2Pair 
    - [Ext] name
    - [Ext] symbol
    - [Ext] decimals
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transfer #
    - [Ext] transferFrom #
    - [Ext] DOMAIN_SEPARATOR
    - [Ext] PERMIT_TYPEHASH
    - [Ext] nonces
    - [Ext] permit #
    - [Ext] MINIMUM_LIQUIDITY
    - [Ext] factory
    - [Ext] token0
    - [Ext] token1
    - [Ext] getReserves
    - [Ext] price0CumulativeLast
    - [Ext] price1CumulativeLast
    - [Ext] kLast
    - [Ext] mint #
    - [Ext] burn #
    - [Ext] swap #
    - [Ext] skim #
    - [Ext] sync #
    - [Ext] initialize #

 +  InfinityBitTokenV2 (IERC20, Ownable)
    - [Ext]  ($)
    - [Pub]  ($)
    - [Pub] name
    - [Pub] symbol
    - [Pub] decimals
    - [Pub] totalSupply
    - [Pub] balanceOf
    - [Pub] transfer #
    - [Int] _approve #
    - [Int] _spendAllowance #
    - [Pub] allowance
    - [Pub] approve #
    - [Pub] transferFrom #
    - [Pub] increaseAllowance #
    - [Pub] decreaseAllowance #
    - [Int] _mint #
    - [Pub] enableTransfers #
       - modifiers: onlyOwner
    - [Pub] setDevWallet #
       - modifiers: onlyOwner
    - [Pub] setMarketingWallet #
       - modifiers: onlyOwner
    - [Prv] isSell
    - [Prv] isBuy
    - [Prv] _swapTokensForETH #
    - [Prv] addLiquidity #
    - [Pub] getDevTax
    - [Pub] toggleAutoSwapTokens #
       - modifiers: onlyOwner
    - [Pub] getLpTax
    - [Pub] getMarketingTax
    - [Pub] setDevTax #
       - modifiers: onlyOwner
    - [Pub] setLpTax #
       - modifiers: onlyOwner
    - [Pub] setMarketingTax #
       - modifiers: onlyOwner
    - [Pub] setAutoswapDeadline #
       - modifiers: onlyOwner
    - [Pub] DetectMaxWalletEnabled
    - [Pub] ToggleMaxWallet #
       - modifiers: onlyOwner
    - [Pub] SetUniswapV2Pair #
       - modifiers: onlyOwner
    - [Pub] GetUniswapV2Pair
    - [Pub] SetTaxlessAllowList #
       - modifiers: onlyOwner
    - [Pub] UnsetTaxlessAllowList #
       - modifiers: onlyOwner
    - [Pub] SetMaxWalletAllowList #
       - modifiers: onlyOwner
    - [Pub] UnsetMaxWalletAllowList #
       - modifiers: onlyOwner
    - [Pub] isTaxExempt
    - [Pub] isMaxWalletExempt
    - [Pub] totalTax
    - [Prv] sendEther #
    - [Pub] getLiquidityIBIT
    - [Pub] getMaxAutoswap
    - [Pub] getAutoswapLimit
    - [Pub] setAutoswapLimit #
       - modifiers: onlyOwner
    - [Pub] getAutoswapThreshold
    - [Pub] setAutoswapThreshold #
       - modifiers: onlyOwner
    - [Pub] autoswapTotalTokensAvailable
    - [Pub] calcAutoswapAmount
    - [Prv] _transfer #
    - [Prv] _autoSwapTaxForEth #
    - [Pub] autoSwapConditionCheck
    - [Pub] toggleSellFromTaxWallets #
       - modifiers: onlyOwner
    - [Pub] takeTokensFromTaxWallets #
       - modifiers: onlyOwner
    - [Prv] _takeTokensFromMarketingAndDevWallets #
    - [Prv] _calcTaxDistribution
    - [Prv] _calcLpTaxAmount
    - [Prv] _calcDevTaxAmount
    - [Prv] _calcMarketingTaxAmount
    - [Pub] _calcTaxes
    - [Prv] _takeTaxes #
    - [Prv] _taxlessTransfer #
    - [Prv] setLegacyHolder #
    - [Pub] initialAirdrop #
       - modifiers: onlyOwner
    - [Prv] setLegacyBalancesFromSnapshot #

About SourceHat

SourceHat has quickly grown to have one of the most experienced and well-equipped smart contract auditing teams in the industry. Our team has conducted 1300+ solidity smart contract audits covering all major project types and protocols, securing a total of over $50 billion U.S. dollars in on-chain value across 1500 projects!. Our firm is well-reputed in the community and is trusted as a top smart contract auditing company for the review of solidity code, no matter how complex. Our team of experienced solidity smart contract auditors performs audits for tokens, NFTs, crowdsales, marketplaces, gambling games, financial protocols, and more!

Contact us today to get a free quote for a smart contract audit of your project!

What is a SourceHat Audit?

Typically, a smart contract audit is a comprehensive review process designed to discover logical errors, security vulnerabilities, and optimization opportunities within code. A SourceHat Audit takes this a step further by verifying economic logic to ensure the stability of smart contracts and highlighting privileged functionality to create a report that is easy to understand for developers and community members alike.

How Do I Interpret the Findings?

Each of our Findings will be labeled with a Severity level. We always recommend the team resolve High, Medium, and Low severity findings prior to deploying the code to the mainnet. Here is a breakdown on what each Severity level means for the project:

  • High severity indicates that the issue puts a large number of users' funds at risk and has a high probability of exploitation, or the smart contract contains serious logical issues which can prevent the code from operating as intended.
  • Medium severity issues are those which place at least some users' funds at risk and has a medium to high probability of exploitation.
  • Low severity issues have a relatively minor risk association; these issues have a low probability of occurring or may have a minimal impact.
  • Informational issues pose no immediate risk, but inform the project team of opportunities for gas optimizations and following smart contract security best practices.