Earthling

Smart Contract Audit Report

Audit Summary

Earthling Audit Report Earthling is a new BEP-20 token that features automatic liquidity adds and pays holders dividends in BUSD.

For this audit, we reviewed the project team's Earthling and DividendPayingToken contract at 0x1F7d905c0c495DcA4C9E859c313b29179D272cA1 on the Binance Smart Chain Mainnet.

Audit Findings

Please ensure trust in the team prior to investing as they have substantial control in the ecosystem.
Date: April 29th, 2022.

Finding #1 - Earthling- Informational

Description: Although the SafeMath library is utilized, the contract is deployed with Solidity v0.8.11 which has built-in overflow checks.
Recommendation: SafeMath could be safely removed to reduce contract size and deployment costs.

Contracts Overview

  • The total supply of the token is set to 1 billion $ETLG [1,000,000,000].
  • No mint or burn functions are present; though the circulating supply can be reduced by sending tokens to the 0x..dead address if desired.
  • At the time of writing this report, 100% of the total supply belongs to the owner.

  • There is a Dividend fee, Liquidity fee, Marketing fee, Reforestation fee, and Development fee on all transfers where neither the sender nor the recipient is excluded from fees.
  • Fees are increased by the sell multiplier value on sell transactions via PancakeSwap if the sell multiplier period (set by the team) exceeds the time difference of the current sell transaction and the users' previous buy.
  • The tokens collected from the Dividend fee and Liquidity fee are stored in the contract address. The tokens are swapped for BNB for the purpose of funding Pancakeswap liquidity and the DividendTracker contract when the following conditions are met:
    • The automatic liquidity add functionality is enabled by the team.
    • The threshold number of tokens (determined by the owner) in the contract address has been reached.
    • The contract is not currently performing an automatic liquidity add.
    • The caller is not initiating a buy transaction via Pancakeswap.
    • The owner is neither the sender nor the recipient.
  • Liquidity-adds are automatically performed by selling the tokens collected as fees, pairing the received BNB with the token, and adding it as liquidity to the BNB pair.
  • The LP tokens received through this process are sent to the 0x00 address.
  • The tokens collected from the Dividend Fee are swapped for BNB and sent to the DividendTracker contract where they are swapped for BUSD and distributed as rewards.
  • The tokens collected from the Marketing fee, Reforestation fee, and Development fee are sent to the team's Marketing wallet, Reforestation wallet, and Development wallet respectively.
  • The contract utilizes the SafeMath library to prevent overflows along with following the BEP-20 standard.

  • A user must hold at least 200,000 $ETLG tokens to be eligible for dividends.
  • Once dividends are distributed, they will need to be claimed; claiming happens automatically on each transfer.
  • Dividend rewards can also be claimed manually by kicking off the claim cycle, which will process all eligible token holders.
  • Alternatively, a user can manually claim dividends as an individual.
  • There is a wait-time (set by the team) between claiming dividend rewards.
  • Claimed dividends are sent to the user's wallet address.
Ownership Controls:
  • The owner can assign addresses to an Operator role which can be used to maintain control over various role-restricted functions within the contract.
  • The owner can set the Dividend fee, Liquidity fee, Marketing fee, Reforestation fee, and Development fee to any percentages at any time.
  • The owner can update the team's Marketing wallet, Reforestation wallet, and Development wallet at any time.
  • The owner can exclude and include accounts from transfer fees.
  • The owner or the Operator can exclude and include accounts from dividends.
  • The owner or the Operator can update the minimum number of tokens a user must hold in order to be eligible for dividends to any value at any time.
  • The owner can update the Dividend Tracker address at any time.
  • The owner can update the Pancakeswap Router and Pair addresses at any time.
  • The owner can enable/disable automatic liquidity adds at any time.
  • The owner can update the threshold number of tokens needed to trigger an automatic liquidity add to any value at any time.
  • The owner can set the sell multiplier period and sell multiplier value to any values at any time.
  • The owner can withdraw any BNB or tokens from the Earthling and DividendTracker contracts at any time.
  • The owner can update the dividend reward token to any address at any time.
  • The owner can update the maximum amount of gas used for processing to a value between 100,000 and 500,000 at any time.
  • The owner or the Operator can update the amount of time a user must wait between claiming dividends to any value between 1 and 24 hours (in seconds).

Audit Results

Vulnerability CategoryNotesResult
Arbitrary Jump/Storage WriteN/APASS
Centralization of Control
  • The owner can set each fee to any percentage at any time.
  • The team can withdraw any tokens from the Earthling and DividendTracker contracts at any time.
WARNING
Compiler IssuesN/APASS
Delegate Call to Untrusted ContractN/APASS
Dependence on Predictable VariablesN/APASS
Ether/Token TheftN/APASS
Flash LoansN/APASS
Front RunningThe Automatic Reflection functionality may be susceptible to front-running; The team must monitor and if suspicious activity is detected, the team must disable this system. The team should also ensure that no more than 0.1 BNB is used when funding the DividendTracker contract.PASS
Improper EventsN/APASS
Improper Authorization SchemeN/APASS
Integer Over/UnderflowN/APASS
Logical IssuesN/APASS
Oracle IssuesN/APASS
Outdated Compiler VersionN/APASS
Race ConditionsN/APASS
ReentrancyN/APASS
Signature IssuesN/APASS
Unbounded LoopsN/APASS
Unused CodeN/APASS
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

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

 + [Int] IERC20Metadata (IERC20)
    - [Ext] name
    - [Ext] symbol
    - [Ext] decimals

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

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

 +  ERC20 (Context, IERC20, IERC20Metadata)
    - [Pub]  #
    - [Pub] name
    - [Pub] symbol
    - [Pub] decimals
    - [Pub] totalSupply
    - [Pub] balanceOf
    - [Pub] transfer #
    - [Pub] allowance
    - [Pub] approve #
    - [Pub] transferFrom #
    - [Pub] increaseAllowance #
    - [Pub] decreaseAllowance #
    - [Int] _transfer #
    - [Int] _mint #
    - [Int] _burn #
    - [Int] _approve #
    - [Int] _beforeTokenTransfer #

 + [Lib] SafeMathUint 
    - [Int] toInt256Safe

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

 + [Int] DividendPayingTokenInterface 
    - [Ext] dividendOf
    - [Ext] withdrawDividend #
    - [Ext] updateUniswapV2RouterTracker #
    - [Ext] updateDividendToken #

 + [Int] DividendPayingTokenOptionalInterface 
    - [Ext] withdrawableDividendOf
    - [Ext] withdrawnDividendOf
    - [Ext] accumulativeDividendOf

 +  Ownable (Context)
    - [Pub]  #
    - [Pub] owner
    - [Pub] operator
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOperator
    - [Pub] transferOperator #
       - modifiers: onlyOperator
    - [Prv] _setOwner #

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

 + [Lib] IterableMapping 
    - [Pub] get
    - [Pub] getIndexOfKey
    - [Pub] getKeyAtIndex
    - [Pub] size
    - [Pub] set #
    - [Pub] remove #

 +  DividendPayingToken (ERC20, Ownable, DividendPayingTokenInterface, DividendPayingTokenOptionalInterface)
    - [Pub]  #
       - modifiers: ERC20,Ownable
    - [Pub] updateUniswapV2RouterTracker #
       - modifiers: onlyOwner
    - [Pub] updateDividendToken #
       - modifiers: onlyOwner
    - [Pub] distributeDividends #
       - modifiers: onlyOwner
    - [Pub] withdrawDividend #
    - [Int] _withdrawDividendOfUser #
    - [Pub] dividendOf
    - [Pub] withdrawableDividendOf
    - [Pub] withdrawnDividendOf
    - [Pub] accumulativeDividendOf
    - [Int] _transfer #
    - [Int] _mint #
    - [Int] _burn #
    - [Int] _setBalance #
    - [Prv] swapETHForDivToken #

 +  DividendTracker (DividendPayingToken)
    - [Pub]  #
       - modifiers: DividendPayingToken
    - [Ext] setMinimumTokenBalanceForDividends #
       - modifiers: onlyOperator
    - [Int] _transfer
    - [Pub] withdrawDividend
    - [Ext] excludeFromDividends #
       - modifiers: onlyOperator
    - [Ext] updateClaimWait #
       - modifiers: onlyOperator
    - [Ext] getLastProcessedIndex
    - [Ext] getNumberOfTokenHolders
    - [Pub] getAccount
    - [Pub] getAccountAtIndex
    - [Prv] canAutoClaim
    - [Ext] setBalance #
       - modifiers: onlyOwner
    - [Pub] process #
    - [Pub] sendTokens #
       - modifiers: onlyOperator
    - [Pub] processAccount #
       - modifiers: onlyOwner
    - [Ext]  ($)

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

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

 +  Earthling (ERC20, Ownable)
    - [Pub]  #
       - modifiers: ERC20,Ownable
    - [Ext]  ($)
    - [Pub] updateDividendTracker #
       - modifiers: onlyOwner
    - [Pub] updateUniswapV2Router #
       - modifiers: onlyOwner
    - [Pub] excludeFromFees #
       - modifiers: onlyOwner
    - [Pub] excludeMultipleAccountsFromFees #
       - modifiers: onlyOwner
    - [Ext] setMarketingWallet #
       - modifiers: onlyOwner
    - [Ext] setReforestationWallet #
       - modifiers: onlyOwner
    - [Ext] setDevWallet #
       - modifiers: onlyOwner
    - [Ext] setDividendRewardsFee #
       - modifiers: onlyOwner
    - [Ext] setReforestationFee #
       - modifiers: onlyOwner
    - [Ext] setDevelopmentFee #
       - modifiers: onlyOwner
    - [Ext] setLiquidityFee #
       - modifiers: onlyOwner
    - [Ext] setMarketingFee #
       - modifiers: onlyOwner
    - [Pub] setSwapEnabled #
       - modifiers: onlyOwner
    - [Pub] setSwapTokensAtAmount #
       - modifiers: onlyOwner
    - [Pub] setMultiplierPeriod #
       - modifiers: onlyOwner
    - [Pub] setMultiplier #
       - modifiers: onlyOwner
    - [Pub] setAutomatedMarketMakerPair #
       - modifiers: onlyOwner
    - [Prv] _setAutomatedMarketMakerPair #
    - [Pub] updateGasForProcessing #
       - modifiers: onlyOwner
    - [Pub] updateRewardToken #
       - modifiers: onlyOwner
    - [Ext] updateClaimWait #
       - modifiers: onlyOwner
    - [Ext] getClaimWait
    - [Ext] getTotalDividendsDistributed
    - [Pub] isExcludedFromFees
    - [Pub] withdrawableDividendOf
    - [Pub] dividendTokenBalanceOf
    - [Ext] excludeFromDividends #
       - modifiers: onlyOwner
    - [Ext] getAccountDividendsInfo
    - [Ext] getAccountDividendsInfoAtIndex
    - [Ext] processDividendTracker #
    - [Ext] claim #
    - [Ext] getLastProcessedIndex
    - [Ext] getNumberOfDividendTokenHolders
    - [Int] _transfer #
    - [Prv] swapAndSendToAll #
    - [Prv] swapTokensForEth #
    - [Prv] addLiquidity #
    - [Ext] clearStuckBNBBalance #
       - modifiers: onlyOwner
    - [Ext] withdrawStuckTokens #
       - modifiers: onlyOwner

About Solidity Finance

Solidity Finance was founded in 2020 and quickly grew to have one of the most experienced and well-equipped smart contract auditing teams in the industry. Our team has conducted 1000+ solidity smart contract audits covering all major project types and protocols, securing a total of over $10 billion U.S. dollars in on-chain value.
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 Solidity Audit?

Typically, a smart contract audit is a comprehensive review process designed to discover logical errors, security vulnerabilities, and optimization opportunities within code. A Solidity 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.