Doge Viking - Smart Contract Audit Report

Summary

Doge Viking Audit Report Doge Viking ($DVK) is a new community-driven DeFi token on the Binance Smart Chain that is an automatic liquidity providing protocol that pays out static rewards to holders.

Our team reviewed and audited the Doge Viking Token Contract at commit 7e7fe0b6c5f1e94ece6e074fcf6b9b31b92327a2 on Github.

Notes on the undeployed Contract:
  • Doge Viking's code implements and builds upon the fee-redistribution features pioneered by Reflect Finance.
  • The total supply of the token is initially set to one quadrillion $DVK [1,000,000,000,000,000].
  • No minting or burn functions are present; and holders are not allowed to directly send tokens to the burn address.
  • There is a 'Tax fee', a 'Liquidity fee', and a "Doge Viking Fund fee" on all transactions for any "non-excluded" address that participates in a transfer. The owner has the ability to modify the these fees at any time. The tax fee may range from 0% to 10%; the liquidity fee may range from 0% to 20.0%, and the "Doge Viking Fund Fee" can range from 0% to 2%.
  • The 'tax fee' is instantly redistributed across all of the existing (and non-excluded) token holders at the time of each transaction.
  • The tokens collected from the "Doge Viking Fund fee" are sent to the team's "Pool Address" which the owner can change at any time.
  • The liquidity fee charged on transactions is stored in the contract and, once a threshold value is met, used to fund PancakeSwap liquidity. This functionality can be enabled/disabled by the owner.
  • Liquidity-adds are funded by selling a portion of the tokens collected as fees (after the threshhold as determined by the owner is met), then pairing the received BNB with the token, and adding it as liquidity to the BNB pair.
  • The newly created LP tokens will be sent to the owner of the contract.
  • The contract implements a sell delay in the amount of 3 days, meaning users who purchase must wait at least 3 days to sell their tokens.
  • There is a sell limit threshold, by default set to 1 million tokens. This can be updated by the team at any time ********
  • In addition, there is a price impact limit which prevents sells which would decrease the token's price by more than 0.5% in a single transaction.
  • There is also a maximum holding amount, initially set to 1,000 tokens.
  • The owner of the contract can exclude and include accounts from transfer fees, holding limit, and maximum transaction amount.
  • The owner can also update the number of tokens to sell for liquidity, the uniswap router and pair adresses, the maximum holding amount (down to 500 minimum), the sell limit threshold (down to 500 minimum), the sell delay (up to a 5 day maximum), and the price impact (between 0.5% and 2%).
  • The owner also has the ability to withdraw any BNB or tokens in the contract at any time.
  • Lines 1017-1018 in the contract places a sell limit on the uniswap v2 router and the ETH pair. This limit should only apply to the pair as to not prevent the router from sucessfully transacting.
  • Ownership has not been renounced (and the project has not been deployed to the main net to our knowledge).
  • As the project is implemented with solidity version ^0.8.0, it is protected from overflows.
Audit Findings Summary
  • No external threats were identified.
  • We recommend that the team renounces ownership after a successful launch.
  • As with any token, please ensure trust in the team prior to investing as they have notable control in the ecosystem.
  • Date: July 23rd, 2021

External Threat 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
OraclesN/APASS
SuicideN/APASS
State Change External CallsN/APASS
Unchecked RetvalN/APASS
User Supplied AssertionN/APASS
Critical Solidity CompilerN/APASS
Overall Contract Safety PASS

Function Graph

ERC20 Token Graph


Inheritence Chart

Multi-file Token


Functions Overview


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

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

 +  DogeVikingMetaData (IERC20Metadata)
    - [Ext] name
    - [Ext] symbol
    - [Ext] decimals

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

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

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

 +  DogeViking (DogeVikingMetaData, Ownable)
    - [Pub]  #
    - [Ext] totalSupply
    - [Ext] isExcludedFromFees
    - [Prv] _getRate
    - [Prv] _reflectionFromToken
    - [Prv] _tokenFromReflection
    - [Pub] balanceOf
    - [Ext] totalFees
    - [Prv] _removeAllFees #
    - [Prv] _restoreAllFees #
    - [Ext] setSwapAndLiquifyingState #
       - modifiers: onlyOwner
    - [Prv] _calculateFee
    - [Prv] _calculateTxFee
    - [Prv] _calculateLiquidityFee
    - [Prv] _calculatePoolFee
    - [Prv] _reflectFee #
    - [Prv] _takeLiquidity #
    - [Ext]  ($)
    - [Prv] _transferToken #
    - [Prv] _swapTokensForEth #
    - [Prv] _addLiquidity #
    - [Prv] _swapAndLiquefy #
       - modifiers: lockTheSwap
    - [Prv] _transfer #
    - [Prv] _approve #
    - [Ext] transfer #
    - [Ext] approve #
    - [Ext] transferFrom #
    - [Ext] allowance
    - [Ext] increaseAllowance #
    - [Ext] decreaseAllowance #
    - [Ext] setLiquidityFee #
       - modifiers: onlyOwner
    - [Ext] setDogeVikingFundFee #
       - modifiers: onlyOwner
    - [Ext] setTxFee #
       - modifiers: onlyOwner
    - [Ext] setPoolAddress #
       - modifiers: onlyOwner
    - [Ext] setNumberTokensSellToAddToLiquidity #
       - modifiers: onlyOwner
    - [Ext] updateRouter #
       - modifiers: onlyOwner
    - [Ext] excludeFromFees #
       - modifiers: onlyOwner
    - [Ext] includeInFees #
       - modifiers: onlyOwner
    - [Ext] removeHoldingLimit #
       - modifiers: onlyOwner
    - [Ext] addHoldinglimit #
       - modifiers: onlyOwner
    - [Ext] removeMaxTxAmount #
       - modifiers: onlyOwner
    - [Ext] addMaxTxAmount #
       - modifiers: onlyOwner
    - [Ext] setMaxHoldingAmount #
       - modifiers: onlyOwner
    - [Ext] setSellLimitThreshold #
       - modifiers: onlyOwner
    - [Ext] setSellDelay #
       - modifiers: onlyOwner
    - [Ext] setliquidityRatioBps #
       - modifiers: onlyOwner
    - [Ext] withdrawETH #
       - modifiers: onlyOwner
    - [Ext] withdrawERC20 #
       - modifiers: onlyOwner