Unable to find manual contract audit (e.g. Certik, PeckShield, Solidity...)
TheKing.swapBack() (#546-603) sends eth to arbitrary user
Dangerous calls:
- (tmpSuccess) = address(marketingWallet).call{gas: 30000,value: amountETHMarketing}() (#578-581)
- (tmpSuccess2) = address(King).call{gas: 30000,value: amountETHKing}() (#582-585)
Ensure that an arbitrary user cannot withdraw unauthorized funds.
Additional information: link
Reentrancy in TheKing._transferFrom(address,address,uint256) (#474-502):
External calls:
- swapBack() (#488)
- router.swapExactTokensForETHSupportingFeeOnTransferTokens(amountToSwap,0,path,address(this),block.timestamp) (#559-565)
- (tmpSuccess) = address(marketingWallet).call{gas: 30000,value: amountETHMarketing}() (#578-581)
- (tmpSuccess2) = address(King).call{gas: 30000,value: amountETHKing}() (#582-585)
- router.addLiquidityETH{value: amountETHLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#593-600)
External calls sending eth:
- swapBack() (#488)
- (tmpSuccess) = address(marketingWallet).call{gas: 30000,value: amountETHMarketing}() (#578-581)
- (tmpSuccess2) = address(King).call{gas: 30000,value: amountETHKing}() (#582-585)
- router.addLiquidityETH{value: amountETHLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#593-600)
State variables written after the call(s):
- _checkTxLimit(sender,recipient,amount) (#490)
- King = marketingWallet (#386)
- King = recipient (#423)
- _balances[sender] = _balances[sender].sub(amount,Insufficient Balance) (#492-495)
- _balances[recipient] = _balances[recipient].add(amountReceived) (#499)
- amountReceived = takeFee(sender,recipient,amount) (#496-498)
- _balances[address(this)] = _balances[address(this)].add(feeAmount) (#527)
Apply the check-effects-interactions pattern.
Additional information: link
TheKing.recoverLostTokens(address,uint256) (#609-614) ignores return value by IERC20(_token).transfer(msg.sender,_amount) (#613)
Use SafeERC20, or ensure that the transfer/transferFrom return value is checked.
Additional information: link
Too many vulnerabilities (Unchecked transfer, Reentrancy vulnerability, etc.). High risk of a scam. DYOR & manual audit are advised.
TheKing.swapBack().tmpSuccess (#578) is written in both
(tmpSuccess) = address(marketingWallet).call{gas: 30000,value: amountETHMarketing}() (#578-581)
tmpSuccess = false (#589)
TheKing.swapBack().tmpSuccess2 (#582) is written in both
(tmpSuccess2) = address(King).call{gas: 30000,value: amountETHKing}() (#582-585)
tmpSuccess2 = false (#590)
Fix or remove the writes.
Additional information: link
Combination 1: Reentrancy vulnerabilities + Functions that send Ether to arbitraty destination. Usual for scams. May be justified by some complex mechanics (e.g. rebase, reflections). DYOR & manual audit are advised.
Combination 2: Unchecked transfer + Functions that send Ether to arbitraty destination. Usual for scams. May be justified by some complex mechanics (e.g. rebase, reflections). DYOR & manual audit are advised.
Combination 3: Reentrancy vulnerabilities + Unchecked transfer vulnerability. Usual for scams. May be justified by some complex mechanics (e.g. rebase, reflections). DYOR & manual audit are advised.
TheKing.swapBack() (#546-603) ignores return value by router.addLiquidityETH{value: amountETHLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#593-600)
Ensure that all the return values of the function calls are used.
Additional information: link
TheKing.setMaxTxAmount(uint256,uint256) (#313-317) should emit an event for:
- _maxTxAmount = amount (#316)
TheKing.setFees(uint256,uint256,uint256) (#319-330) should emit an event for:
- liquidityFee = newLiquidityFee (#327)
- marketingFee = newMarketingFee (#328)
- kingFee = newkingFee (#329)
TheKing.setSwapThreshold(uint256) (#366-368) should emit an event for:
- swapThreshold = threshold (#367)
TheKing.setResetPeriodInSeconds(uint256) (#378-383) should emit an event for:
- resetPeriod = newResetPeriod (#382)
TheKing.setSwapBackSettings(bool,uint256) (#445-451) should emit an event for:
- swapThreshold = newSwapBackLimit (#450)
Emit an event for critical parameter changes.
Additional information: link
Auth.transferOwnership(address).adr (#199) lacks a zero-check on :
- owner = adr (#200)
TheKing.setFeeReceivers(address,address).newLiquidityReceiver (#371) lacks a zero-check on :
- autoLiquidityReceiver = newLiquidityReceiver (#374)
TheKing.setFeeReceivers(address,address).newMarketingWallet (#372) lacks a zero-check on :
- marketingWallet = newMarketingWallet (#375)
Check that the address is not zero.
Additional information: link
Reentrancy in TheKing._transferFrom(address,address,uint256) (#474-502):
External calls:
- swapBack() (#488)
- router.swapExactTokensForETHSupportingFeeOnTransferTokens(amountToSwap,0,path,address(this),block.timestamp) (#559-565)
- (tmpSuccess) = address(marketingWallet).call{gas: 30000,value: amountETHMarketing}() (#578-581)
- (tmpSuccess2) = address(King).call{gas: 30000,value: amountETHKing}() (#582-585)
- router.addLiquidityETH{value: amountETHLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#593-600)
External calls sending eth:
- swapBack() (#488)
- (tmpSuccess) = address(marketingWallet).call{gas: 30000,value: amountETHMarketing}() (#578-581)
- (tmpSuccess2) = address(King).call{gas: 30000,value: amountETHKing}() (#582-585)
- router.addLiquidityETH{value: amountETHLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#593-600)
State variables written after the call(s):
- _checkTxLimit(sender,recipient,amount) (#490)
- biggestBuy = 0 (#387)
- biggestBuy = usedEth (#424)
- _checkTxLimit(sender,recipient,amount) (#490)
- hasSold[sender] = true (#441)
- _checkTxLimit(sender,recipient,amount) (#490)
- lastKingChange = block.timestamp (#388)
- lastKingChange = block.timestamp (#425)
Reentrancy in TheKing.constructor() (#261-281):
External calls:
- pair = IDEXFactory(router.factory()).createPair(router.WETH(),address(this)) (#263-266)
State variables written after the call(s):
- King = msg.sender (#276)
- _allowances[address(this)][address(router)] = uint256(- 1) (#267)
- _balances[msg.sender] = _totalSupply (#279)
- autoLiquidityReceiver = msg.sender (#274)
- isFeeExempt[DEAD] = true (#268)
- isFeeExempt[msg.sender] = true (#270)
- isFeeExempt[address(this)] = true (#271)
- isTxLimitExempt[DEAD] = true (#269)
- isTxLimitExempt[msg.sender] = true (#272)
- isTxLimitExempt[pair] = true (#273)
- marketingWallet = msg.sender (#275)
- totalFee = liquidityFee.add(marketingFee).add(kingFee) (#277)
- totalFeeIfSelling = totalFee (#278)
Apply the check-effects-interactions pattern.
Additional information: link
Reentrancy in TheKing._transferFrom(address,address,uint256) (#474-502):
External calls:
- swapBack() (#488)
- router.swapExactTokensForETHSupportingFeeOnTransferTokens(amountToSwap,0,path,address(this),block.timestamp) (#559-565)
- (tmpSuccess) = address(marketingWallet).call{gas: 30000,value: amountETHMarketing}() (#578-581)
- (tmpSuccess2) = address(King).call{gas: 30000,value: amountETHKing}() (#582-585)
- router.addLiquidityETH{value: amountETHLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#593-600)
External calls sending eth:
- swapBack() (#488)
- (tmpSuccess) = address(marketingWallet).call{gas: 30000,value: amountETHMarketing}() (#578-581)
- (tmpSuccess2) = address(King).call{gas: 30000,value: amountETHKing}() (#582-585)
- router.addLiquidityETH{value: amountETHLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#593-600)
Event emitted after the call(s):
- KingSold(King,biggestBuy) (#438)
- _checkTxLimit(sender,recipient,amount) (#490)
- NewKing(King,biggestBuy) (#426)
- _checkTxLimit(sender,recipient,amount) (#490)
- Transfer(sender,address(this),feeAmount) (#528)
- amountReceived = takeFee(sender,recipient,amount) (#496-498)
- Transfer(msg.sender,recipient,amountReceived) (#500)
Reentrancy in TheKing.constructor() (#261-281):
External calls:
- pair = IDEXFactory(router.factory()).createPair(router.WETH(),address(this)) (#263-266)
Event emitted after the call(s):
- Transfer(address(0),msg.sender,_totalSupply) (#280)
Reentrancy in TheKing.swapBack() (#546-603):
External calls:
- router.swapExactTokensForETHSupportingFeeOnTransferTokens(amountToSwap,0,path,address(this),block.timestamp) (#559-565)
- (tmpSuccess) = address(marketingWallet).call{gas: 30000,value: amountETHMarketing}() (#578-581)
- (tmpSuccess2) = address(King).call{gas: 30000,value: amountETHKing}() (#582-585)
External calls sending eth:
- (tmpSuccess) = address(marketingWallet).call{gas: 30000,value: amountETHMarketing}() (#578-581)
- (tmpSuccess2) = address(King).call{gas: 30000,value: amountETHKing}() (#582-585)
Event emitted after the call(s):
- KingPayout(King,amountETHKing) (#586)
Reentrancy in TheKing.swapBack() (#546-603):
External calls:
- router.swapExactTokensForETHSupportingFeeOnTransferTokens(amountToSwap,0,path,address(this),block.timestamp) (#559-565)
- (tmpSuccess) = address(marketingWallet).call{gas: 30000,value: amountETHMarketing}() (#578-581)
- (tmpSuccess2) = address(King).call{gas: 30000,value: amountETHKing}() (#582-585)
- router.addLiquidityETH{value: amountETHLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#593-600)
External calls sending eth:
- (tmpSuccess) = address(marketingWallet).call{gas: 30000,value: amountETHMarketing}() (#578-581)
- (tmpSuccess2) = address(King).call{gas: 30000,value: amountETHKing}() (#582-585)
- router.addLiquidityETH{value: amountETHLiquidity}(address(this),amountToLiquify,0,0,autoLiquidityReceiver,block.timestamp) (#593-600)
Event emitted after the call(s):
- AutoLiquify(amountETHLiquidity,amountToLiquify) (#601)
Apply the check-effects-interactions pattern.
Additional information: link
TheKing._checkTxLimit(address,address,uint256) (#395-443) uses timestamp for comparisons
Dangerous comparisons:
- block.timestamp - lastKingChange > resetPeriod (#400)
Avoid relying on block.timestamp.
Additional information: link
TheKing._maxTxAmount (#247) is set pre-construction with a non-constant function or state variable:
- _totalSupply / 100
TheKing._maxWalletAmount (#248) is set pre-construction with a non-constant function or state variable:
- _totalSupply / 50
TheKing.swapThreshold (#249) is set pre-construction with a non-constant function or state variable:
- _totalSupply / 100
Remove any initialization of state variables via non-constant state variables or function calls. If variables must be set upon contract deployment, locate initialization in the constructor instead.
Additional information: link
Pragma version^0.7.4 (#1) allows old versions
solc-0.7.4 is not recommended for deployment
Deploy with any of the following Solidity versions: 0.5.16 - 0.5.17, 0.6.11 - 0.6.12, 0.7.5 - 0.7.6 Use a simple pragma version that allows any of these versions. Consider using the latest version of Solidity for testing.
Additional information: link
Low level call in TheKing.swapBack() (#546-603):
- (tmpSuccess) = address(marketingWallet).call{gas: 30000,value: amountETHMarketing}() (#578-581)
- (tmpSuccess2) = address(King).call{gas: 30000,value: amountETHKing}() (#582-585)
Avoid low-level calls. Check the call success. If the call is meant for a contract, check for code existence
Additional information: link
Function IDEXRouter.WETH() (#101) is not in mixedCase
Parameter TheKing.recoverLostTokens(address,uint256)._token (#609) is not in mixedCase
Parameter TheKing.recoverLostTokens(address,uint256)._amount (#609) is not in mixedCase
Constant TheKing._name (#215) is not in UPPER_CASE_WITH_UNDERSCORES
Constant TheKing._symbol (#216) is not in UPPER_CASE_WITH_UNDERSCORES
Constant TheKing._decimals (#217) is not in UPPER_CASE_WITH_UNDERSCORES
Variable TheKing.DEAD (#219) is not in mixedCase
Variable TheKing.ZERO (#220) is not in mixedCase
Variable TheKing._totalSupply (#223) is not in mixedCase
Variable TheKing._balances (#227) is not in mixedCase
Variable TheKing._allowances (#228) is not in mixedCase
Variable TheKing.King (#240) is not in mixedCase
Follow the Solidity naming convention.
Additional information: link
Variable IDEXRouter.addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256).amountADesired (#111) is too similar to IDEXRouter.addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256).amountBDesired (#112)
Prevent variables from having similar names.
Additional information: link
TheKing.slitherConstructorVariables() (#212-616) uses literals with too many digits:
- DEAD = 0x000000000000000000000000000000000000dEaD (#219)
TheKing.slitherConstructorVariables() (#212-616) uses literals with too many digits:
- ZERO = 0x0000000000000000000000000000000000000000 (#220)
Use: Ether suffix, Time suffix, or The scientific notation
Additional information: link
TheKing.DEAD (#219) should be constant
TheKing.ZERO (#220) should be constant
TheKing._totalSupply (#223) should be constant
TheKing.routerAddress (#221) should be constant
Add the constant attributes to state variables that never change.
Additional information: link
authorize(address) should be declared external:
- Auth.authorize(address) (#183-185)
unauthorize(address) should be declared external:
- Auth.unauthorize(address) (#187-189)
transferOwnership(address) should be declared external:
- Auth.transferOwnership(address) (#199-203)
balanceOf(address) should be declared external:
- ERC20Interface.balanceOf(address) (#209)
getCirculatingSupply() should be declared external:
- TheKing.getCirculatingSupply() (#305-307)
Use the external attribute for functions never called from the contract.
Additional information: link
Unable to find website, listings and other project-related information
Young tokens have high risks of scam / price dump / death
Token has no active CoinGecko listing / rank
Token has no active CoinMarketCap listing / rank
Unable to find Telegram and Twitter accounts