Dstarlights Coin - Smart Contract Audit Report

Summary

Dstarlights Coin Audit Report Dstarlights Coin ($DSC) is a new BEP20 token on the Binance Smart Chain that features automatic liquidity adds and pays out dividends to holders.

We reviewed the Dstarlights Coin contract that is deployed at 0x2a43dcDcdd8C264A3a87b2d1b78581727EE1BD6b on the Binance Smart Chain mainnet.

Notes on the Contract:
  • The total supply of the token is set to 10 trillion $DSC [10,000,000,000,000].
  • No mint functions are accessible beyond deployment.
  • The contract utilizes a burner role. Any assigned burner address can burn their own tokens to reduce the total supply.
  • At the time of writing this report, 100% of the total supply belongs to the owner.

  • There is a Liquidity Fee, Dividend fee, Distributor fee, Burn fee, and Wallet fee on all transfers when interacting with Pancakeswap (given that the transferring address is not excluded from fees). A separate fee structure can be set by the team to apply different fee amounts depending on whether the user is buying or selling during the transfer.
  • The fees charged on transactions are stored in the contract and once a threshold value of tokens (determined by the owner) is met, a swap will occur for the purpose of funding Pancakeswap liquidity.
  • Liquidity-adds are funded by selling a portion of the tokens collected as fees (after the threshold value of tokens is met), then 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 owner. We recommend that the team locks these newly acquired LP tokens.
  • The tokens collected from the Distributor Fee are swapped for BNB and sent to the Distributor contract.
  • The tokens collected from the Dividend Fee are used to fund dividend rewards for all eligible users.
  • The tokens collected from the Burn fee are burned to reduce the total supply.
  • The tokens collected from the Wallet fee are sent to the team's Marketing address.

  • 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 between claiming dividend rewards.
  • Claimed dividends are sent to the user's wallet address.

  • The contract features a maximum sell amount (determined by the owner) which imposes a limit to the number of tokens that can be sold in any given transaction to Pancakeswap.
  • The contract features a maximum wallet amount (determined by the owner) which imposes a limit to the number of tokens that a user can own after a buying transaction.
  • The contract utilizes AntiSniper logic to determine if a user is attempting to buy tokens before a certain time (determined by the owner). If an account that is considered a sniper attempts to trade, they will be taxed at a 99% rate.
  • Although the Safemath library is utilized, the contract is deployed with Solidity v0.8.10 which has built-in overflow checks. Safemath could be safely removed to reduce contract size and increase gas savings.
Ownership Controls:
  • The owner can set the Liquidity Fee, Dividend fee, Distributor fee, Burn fee, and Wallet fee for both fee structures to any percentages as long the total percentages combined for each fee structure does not exceed 50%.
  • The owner can exclude any address from transfer fees and dividends at any time.
  • The owner can disable trading at any time. Only users that have been added to a whitelist by the owner can participate in transfers when trading is set to disabled.
  • The owner can enable/disable the automatic swapping functionality and update the threshold value needed to trigger it at any time.
  • The owner can update the maximum transaction amount when selling to Pancakeswap to any value at any time.
  • The owner can update the maximum wallet amount after a buying transaction to any amount at any time.
  • The owner can withdraw any BNB or BEP20 tokens from the contract address at any time.
  • The owner can add any address to a blacklist which will prevent them from being able to sell their tokens.
  • The owner can assign addresses to the burner role at any time.
  • If a user has pending withdrawable dividends, The owner can manually send those dividends to the user at any time.
  • The owner can enable/disable the AntiSniper functionality at any time and set the block time that triggers it.
  • The owner can manually add/remove accounts from the AntiSniper list.
  • The owner can update the maximum amount of gas used for processing to any value at any time.
  • The owner can update the team's Marketing address at any time.
  • The owner can update the Pancakeswap Pair address at any time.

Audit Findings Summary
  • No external threats were identified.
  • As with any presale, please ensure trust in the team prior to investing.
  • Further, ensure trust in the team as they have substantial control in the ecosystem.
  • Date: December 13th, 2021
  • Updated: February 28th, 2022 to reflect the contract's newly deployed mainnet address.

Audit Results

Vulnerability CategoryNotesResult
Arbitrary Storage WriteN/APASS
Arbitrary JumpN/APASS
Centralization of ControlThe owner can set each fee percentage up to 50%.WARNING
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
OraclesN/APASS
SuicideN/APASS
State Change External CallsN/APASS
Unchecked RetvalN/APASS
User Supplied AssertionN/APASS
Critical Solidity CompilerN/APASS
Overall Contract Safety PASS

BEP20 Token Graph

Multi-file Token

												
($) = payable function
 # = non-constant function

 + [Int] IOwnable 
    - [Ext] owner

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

 + [Int] IBurnable 
    - [Ext] burn #
    - [Ext] burnFrom #

 + [Int] IDEXFactory 
    - [Ext] createPair #

 + [Int] IDEXRouter 
    - [Ext] factory
    - [Ext] WETH
    - [Ext] addLiquidityETH ($)
    - [Ext] swapExactTokensForETH #
    - [Ext] swapExactTokensForETHSupportingFeeOnTransferTokens #

 + [Int] IDividendDistributor 
    - [Ext] setDistributionCriteria #
    - [Ext] setShare #
    - [Ext] depositNative ($)
    - [Ext] depositToken #
    - [Ext] process #
    - [Ext] inSwap

 + [Int] ITaxDistributor 
    - [Ext]  ($)
    - [Ext] lastSwapTime
    - [Ext] inSwap
    - [Ext] createWalletTax #
    - [Ext] createDistributorTax #
    - [Ext] createDividendTax #
    - [Ext] createBurnTax #
    - [Ext] createLiquidityTax #
    - [Ext] distribute ($)
    - [Ext] getSellTax
    - [Ext] getBuyTax
    - [Ext] setTaxWallet #
    - [Ext] setSellTax #
    - [Ext] setBuyTax #
    - [Ext] takeSellTax #
    - [Ext] takeBuyTax #

 + [Int] IWalletDistributor 
    - [Ext] receiveToken #

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

 +  BaseErc20 (IERC20, IOwnable)
    - [Int] configure #
    - [Pub] totalSupply
    - [Pub] balanceOf
    - [Pub] allowance
    - [Pub] transfer #
       - modifiers: tradingEnabled
    - [Pub] approve #
       - modifiers: tradingEnabled
    - [Pub] transferFrom #
       - modifiers: tradingEnabled
    - [Pub] increaseAllowance #
       - modifiers: tradingEnabled
    - [Pub] decreaseAllowance #
       - modifiers: tradingEnabled
    - [Pub] launch #
       - modifiers: onlyOwner
    - [Int] preTransfer #
    - [Int] calculateTransferAmount #
    - [Int] postTransfer #
    - [Pub] changeOwner #
       - modifiers: onlyOwner
    - [Pub] removeBnb #
       - modifiers: onlyOwner
    - [Pub] transferTokens #
       - modifiers: onlyOwner
    - [Pub] setTradingEnabled #
       - modifiers: onlyOwner
    - [Pub] setCanAlwaysTrade #
       - modifiers: onlyOwner
    - [Pub] setExchange #
       - modifiers: onlyOwner
    - [Pub] setExcludedFromSelling #
       - modifiers: onlyOwner
    - [Prv] _transfer #

 +  Burnable (BaseErc20, IBurnable)
    - [Int] configure #
    - [Pub] setAbleToBurn #
       - modifiers: onlyOwner
    - [Pub] burn #
       - modifiers: onlyBurner
    - [Pub] burnFrom #
       - modifiers: onlyBurner

 +  Taxable (BaseErc20)
    - [Int] configure #
    - [Int] calculateTransferAmount #
    - [Int] preTransfer #
    - [Pub] sellTax
    - [Pub] buyTax
    - [Pub] taxDistributorAddress
    - [Pub] setAutoSwaptax #
       - modifiers: onlyOwner
    - [Pub] setExcludedFromTax #
       - modifiers: onlyOwner
    - [Pub] setTaxDistributionThresholds #
       - modifiers: onlyOwner
    - [Pub] setSellTax #
       - modifiers: onlyOwner
    - [Pub] setBuyTax #
       - modifiers: onlyOwner
    - [Pub] setTaxWallet #
       - modifiers: onlyOwner
    - [Pub] runSwapManually #
       - modifiers: onlyOwner,isLaunched

 +  TaxDistributor (ITaxDistributor)
    - [Pub]  #
    - [Ext]  ($)
    - [Pub] createWalletTax #
       - modifiers: onlyToken
    - [Pub] createDistributorTax #
       - modifiers: onlyToken
    - [Pub] createDividendTax #
       - modifiers: onlyToken
    - [Pub] createBurnTax #
       - modifiers: onlyToken
    - [Pub] createLiquidityTax #
       - modifiers: onlyToken
    - [Pub] distribute ($)
       - modifiers: onlyToken,swapLock
    - [Pub] getSellTax
       - modifiers: onlyToken
    - [Pub] getBuyTax
       - modifiers: onlyToken
    - [Pub] setTaxWallet #
       - modifiers: onlyToken
    - [Pub] setSellTax #
       - modifiers: onlyToken
    - [Pub] setBuyTax #
       - modifiers: onlyToken
    - [Pub] takeSellTax #
       - modifiers: onlyToken
    - [Pub] takeBuyTax #
       - modifiers: onlyToken
    - [Pub] compareStrings
    - [Prv] checkTokenAmount

 + [Int] IPinkAntiBot 
    - [Ext] setTokenOwner #
    - [Ext] onPreTransferCheck #

 +  AntiSniper (BaseErc20)
    - [Int] configure #
    - [Pub] launch #
       - modifiers: onlyOwner
    - [Int] preTransfer #
    - [Int] calculateTransferAmount #
    - [Pub] maxHoldAmount
    - [Pub] maxSellAmount
    - [Pub] sniperTax
    - [Int] configurePinkAntiBot #
    - [Pub] setSniperBlocking #
       - modifiers: onlyOwner
    - [Pub] setBlockLogProtection #
       - modifiers: onlyOwner
    - [Pub] setHighTaxCountdown #
       - modifiers: onlyOwner
    - [Pub] setPinkAntiBot #
       - modifiers: onlyOwner
    - [Pub] setMaxSellPercentage #
       - modifiers: onlyOwner
    - [Pub] setMaxHoldPercentage #
       - modifiers: onlyOwner
    - [Pub] setMaxGasLimit #
       - modifiers: onlyOwner
    - [Pub] setIsSniper #
       - modifiers: onlyOwner
    - [Pub] setNeverSniper #
       - modifiers: onlyOwner

 +  Dividends (BaseErc20)
    - [Int] configure #
    - [Int] postTransfer #
    - [Pub] dividendDistributorAddress
    - [Pub] setDividendDistributionThresholds #
       - modifiers: onlyOwner
    - [Pub] setAutoDistributeDividends #
       - modifiers: onlyOwner
    - [Pub] setIsDividendExempt #
       - modifiers: onlyOwner
    - [Pub] runDividendsManually #
       - modifiers: onlyOwner

 +  DStarlightsCoin (BaseErc20, AntiSniper, Burnable, Taxable, Dividends)
    - [Pub]  #
    - [Pub] launch #
       - modifiers: onlyOwner
    - [Int] configure #
    - [Int] preTransfer #
    - [Int] calculateTransferAmount #
    - [Int] postTransfer #

 +  DividendDistributor (IDividendDistributor)
    - [Pub]  #
    - [Ext] setDistributionCriteria
       - modifiers: onlyToken
    - [Ext] setDistributionCriteria #
       - modifiers: onlyToken
    - [Ext] setShare #
       - modifiers: onlyToken
    - [Ext] depositNative ($)
       - modifiers: onlyDistributor
    - [Ext] depositToken #
       - modifiers: onlyDistributor
    - [Ext] process #
       - modifiers: onlyToken,swapLock
    - [Prv] shouldDistributeToken
    - [Prv] distributeTokenDividend #
    - [Ext] claimDividend #
    - [Pub] getUnpaidTokenEarnings
    - [Prv] getTokenCumulativeDividends
    - [Prv] addShareholder #
    - [Prv] removeShareholder #