UselessFurnace - Smart Contract Audit Report

Summary

UselessFurnace Audit Report Useless Crypto is creating a contract used to mantain health between the Useless-BNB liquidity pool and the total supply of Useless tokens.

For this audit, we reviewed the UselessFurnace contract using code provided by the project team.
We previously reviewed the project team's UselessToken contract here.

Notes on the Contract:
  • The contract's purpose is to perform different functionalities based on the ratio between the Useless tokens in the liquidity pool and the circulating supply of Useless tokens.
  • If at least 20% of the circulating supply of Useless tokens are stored in the liquidity pool, a portion of the Useless-BNB pair in the liquidity pool will be decoupled and pulled into the contract.
  • The portion of LP tokens that are pulled into the contract is equal to the the contract's Useless token balance multiplied by the percentage referred to above. As a consequence of this, the contract is required to have a Useless token balance that is greater than 0 in order for any liquidity to be pulled.
  • If this percentage is between 12.5% and 20%, a portion of the BNB in the contract will be used to purchase Useless tokens which are subsequently burned. The amount of BNB used to purchase will be the amount of BNB in the contract, up to 50 BNB. Note that this function requires the contract to have a balance of BNB greater than 0.
  • If this is percentage is between 6.66% and 12.5%, half of the contract's BNB (capped at 25 BNB) will be swapped for Useless tokens and paired with the remaining BNB, which will then be added to the liquidity pool.
  • If this percentage is less than 6.66%, the liquidity pool will be added to using the contract's funds.
  • The function which performs these actions can be called by anyone at any time, however can only be called once per 20 blocks.

  • Solidity v0.8.x is used prevent overflows.
Audit Findings Summary:
  • No external threats were identified.
  • Date: September 10th, 2021.

Audit Results

Vulnerability CategoryNotesResult
Arbitrary Storage WriteN/APASS
Arbitrary JumpN/APASS
Delegate Call to Untrusted ContractN/APASS
Dependence on Predictable VariablesN/APASS
Deprecated OpcodesN/APASS
Ether ThiefN/APASS
ExceptionsN/APASS
External CallsN/APASS
Flash LoansN/APASS
Integer Over/UnderflowN/APASS
Multiple SendsN/APASS
SuicideN/APASS
State Change External CallsN/APASS
Unchecked RetvalN/APASS
User Supplied AssertionN/APASS
Critical Solidity CompilerN/APASS
Overall Contract Safety PASS

Smart Contract Graph

Contract Inheritance


 ($) = payable function
 # = non-constant function
 
 + [Int] IERC20 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] decimals
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Lib] Address 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Prv] _functionCallWithValue #

 + [Lib] SafeMath 
    - [Int] add
    - [Int] sub
    - [Int] sub
    - [Int] mul
    - [Int] div
    - [Int] div
    - [Int] mod
    - [Int] mod

 + [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 #

 +  UselessFurnace 
    - [Ext] BURN_IT_DOWN_BABY #
       - modifiers: isAutomating
    - [Prv] automate #
    - [Prv] checkUselessStanding #
    - [Prv] buyAndBurn #
    - [Prv] reverseSwapAndLiquify #
    - [Prv] pairLiquidity #
    - [Pub] checkLPHealth
    - [Prv] pairLiquidityThresholdReached
    - [Int] getTokenInToken
    - [Prv] buyAndBurnUseless #
    - [Prv] clamp
    - [Prv] justBuyBack #
    - [Prv] swapTokensForBNB #
    - [Prv] determineLPHealth
    - [Prv] addLiquidity #
    - [Prv] pullLiquidity #
    - [Ext] getContractLPBalance
    - [Ext] getPercentageOfLPTokensOwned
    - [Ext]  ($)