YOMP

Smart Contract Audit Report

Audit Summary

YOMP Audit Report YOMP is a new BEP-20 token with an elastic supply.

For this audit, we reviewed the YOMPTOKEN contract provided to us by the project team.

Audit Findings

All findings have been resolved, though some centralized aspects are present.
Date: July 25th, 2023.
Updated: July 26th, 2023 to reflect updates made to the contract by the project team that resolves all Findings.

Finding #1 - YOMPTOKEN - High (Resolved)

Description: The auto-rebase mechanism calls the sync() function on each Pair contract on all transfers; sync() cannot be called on buys otherwise the transaction will revert.
Risk/Impact: All buy transactions will revert on transfers that trigger the auto-rebase mechanism.
Recommendation: The coreRebase() function should be modified to ensure that the manualSync() function is not called on a buy transaction. This can be remedied by checking the following condition: !automatedMarketMakerPairs[msg.sender].
Resolution: The team has properly modified the _transferFrom() to only call the sync() function on each Pair contract on all non-buy transactions.

Finding #2 - YOMPTOKEN - Informational (Resolved)

Description: The following if-statement in the _transferFrom() function is redundant as the manualSync() function is already called in the coreRebase() function when an auto rebase is triggered.
if(!automatedMarketMakerPairs[sender] && !automatedMarketMakerPairs[recipient]){
    manualSync();
}
Recommendation: This redundant if-statement could be removed for additional gas savings on each transfer that triggers an auto rebase.
Resolution: The team has implemented the above recommendation.

Finding #3 - YOMPTOKEN - Informational (Resolved)

Description: The following state variables can never be modified but are not declared constant.
DEAD, ZERO, DisciplesReceiverPart, KingReceiverPart, YOMPGodPart, treasuryReceiverPart, busdToken, feeDenominator
Recommendation: These state variables could be declared constant for additional gas savings on each reference.
Resolution: The team has implemented the above recommendation.

Contract Overview

  • The initial supply of the token is set to 1 million [1,000,000] $YOMP.
  • No mint or burn functions are publicly accessible though the circulating supply can be decreased by sending tokens to the 0x..dead address.
  • There was no token allocation for our team to analyze as the contract has yet to be deployed to the mainnet.

  • The initial distribution period of the contract must be declared "finished" by the owner in order for all transfers to take place on the platform. Only excluded accounts can transfer tokens while the initial distribution period is declared unfinished.
  • There is a transfer fee charged on all buys and sells via Pancakeswap where neither the sender nor the recipient is excluded from fees. A separate fee structure is set by the team that applies different fee percentages depending on whether the transaction is a buy or a sell.
  • Any whitelisted address can enable/disable fees on peer-to-peer transfers at any time.
  • The fees charged during transfers are stored in the contract address. The tokens are swapped for BNB for the purpose of funding addresses set by the team when the following conditions are met:
    • The automatic liquidity add functionality is enabled by the team.
    • The threshold number of tokens in the contract address (determined by the team) has been reached.
    • The contract is not currently performing an automatic liquidity add.
    • The current total fee amount is greater than zero.
    • The caller is not initiating a buy transaction via Pancakeswap.
  • 33% of the received BNB is sent to the King Receiver address set by the team.
  • 28% of the received BNB is sent to the Treasury Receiver address set by the team.
  • 15% of the received BNB is sent to the Yomp God address set by the team.
  • 24% of the received BNB is evenly split amongst 12 Disciple addresses set by the team.
  • During transfers, if the "next rebase" time has passed and auto rebase is enabled by the team, tokens are automatically added to or removed from the total supply. This process acts as a frictionless token redistribution, automatically adjusting token holdings for all token holders proportionally with each total supply change.
  • The rebase operation is calculated based on the contract's predefined time ranges since deployment and their corresponding percentages.
  • The rebase function calls sync() on all Pancakeswap Pair contracts to prevent theft-of-liquidity attacks that have occurred with other rebase tokens.
  • Any user can elect to manually sync the Pancakeswap Pair contracts at any time.
  • The contract utilizes SafeMath libraries to protect against overflows/underflows.
Ownership Controls:
  • The deployer of the contract is initially added to the contract's whitelist during deployment.
  • Any whitelisted user can add/remove any address from the whitelist at any time.
  • Any whitelisted user can set total Buy fees and total Sell fees to any values up to 20% each at any time.
  • Any whitelisted address can include and exclude accounts from transfer fees at any time.
  • Any whitelisted address can enable/disable the auto rebase functionality and set the next rebase timestamp to any value at any time.
  • Any whitelisted address can set the rebase frequency to any value up to 30 minutes (in seconds) at any time.
  • Any whitelisted address can enable/disable the automatic token swapping functionality at any time.
  • Any whitelisted address can update the threshold number of tokens that triggers the automatic token swapping functionality to any value at any time.
  • Any whitelisted address can add/remove accounts from the Pancakeswap Pair list at any time.
  • Any whitelisted address can update each of the team's fee addresses at any time.
  • Any whitelisted address can withdraw any BNB or tokens from the contract at any time.
  • The owner can toggle the initial distribution period which will enable/disable trading at any time.

Audit Results

Vulnerability Category Notes Result
Arbitrary Jump/Storage Write N/A PASS
Centralization of Control The owner can toggle the initial distribution period which will enable/disable trading at any time. 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] TransferHelper 
    - [Int] safeTransferETH #

 + [Lib] SafeMathInt 
    - [Int] mul
    - [Int] div
    - [Int] sub
    - [Int] add
    - [Int] abs

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

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

 + [Int] InterfaceLP 
    - [Ext] sync #

 + [Lib] Roles 
    - [Int] add #
    - [Int] remove #
    - [Int] has

 +  ERC20Detailed (IERC20)
    - [Pub]  #
    - [Pub] name
    - [Pub] symbol
    - [Pub] decimals

 + [Int] IDEXRouter 
    - [Ext] factory
    - [Ext] WETH
    - [Ext] addLiquidity #
    - [Ext] addLiquidityETH ($)
    - [Ext] swapExactTokensForTokensSupportingFeeOnTransferTokens #
    - [Ext] swapExactETHForTokensSupportingFeeOnTransferTokens ($)
    - [Ext] swapExactTokensForETHSupportingFeeOnTransferTokens #

 + [Int] IDEXFactory 
    - [Ext] createPair #

 +  Ownable 
    - [Pub]  #
    - [Pub] owner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Int] _transferOwnership #

 +  WhitelistedRole (Ownable)
    - [Pub]  #
    - [Pub] isWhitelisted
    - [Pub] addWhitelisted #
       - modifiers: onlyWhitelisted
    - [Pub] removeWhitelisted #
       - modifiers: onlyWhitelisted
    - [Pub] trenounceWhitelisted #
    - [Int] _addWhitelisted #
    - [Int] _removeWhitelisted #

 +  YOMPTOKEN (ERC20Detailed, Ownable, WhitelistedRole)
    - [Pub]  #
       - modifiers: ERC20Detailed
    - [Ext]  ($)
    - [Ext] totalSupply
    - [Ext] allowance
    - [Pub] balanceOf
    - [Ext] checkFeeExempt
    - [Ext] checkSwapThreshold
    - [Int] shouldRebase
    - [Int] shouldTakeFee
    - [Int] shouldSwapBack
    - [Pub] getCirculatingSupply
    - [Pub] getLiquidityBacking
    - [Pub] isOverLiquified
    - [Pub] manualSync #
    - [Ext] transfer #
       - modifiers: validRecipient
    - [Int] _basicTransfer #
    - [Int] _transferFrom #
    - [Ext] transferFrom #
       - modifiers: validRecipient
    - [Prv] _swapTokensForBNB #
    - [Int] swapBack #
       - modifiers: swapping
    - [Int] takeFee #
    - [Ext] decreaseAllowance #
    - [Ext] increaseAllowance #
    - [Ext] approve #
    - [Pub] _rebase #
    - [Prv] coreRebase #
    - [Pub] getTimeRange
    - [Pub] setAutomatedMarketMakerPair #
       - modifiers: onlyWhitelisted
    - [Ext] setInitialDistributionFinished #
       - modifiers: onlyWhitelisted
    - [Ext] setFeeExempt #
       - modifiers: onlyWhitelisted
    - [Ext] setSwapBackSettings #
       - modifiers: onlyWhitelisted
    - [Ext] setFeeReceivers #
       - modifiers: onlyWhitelisted
    - [Ext] setFees #
       - modifiers: onlyWhitelisted
    - [Ext] clearStuckBalance #
       - modifiers: onlyWhitelisted
    - [Ext] rescueToken #
       - modifiers: onlyWhitelisted
    - [Ext] setAutoRebase #
       - modifiers: onlyWhitelisted
    - [Ext] setRebaseFrequency #
       - modifiers: onlyWhitelisted
    - [Ext] setFeesOnNormalTransfers #
       - modifiers: onlyWhitelisted
    - [Ext] setNextRebase #
       - modifiers: onlyWhitelisted
    - [Ext] setMaxSellTransaction #
       - modifiers: onlyWhitelisted

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.