Reentrancy in ShangHai._transfer(address,address,uint256) (#328-347):
External calls:
- swapBack() (#340)
- router.swapExactTokensForETHSupportingFeeOnTransferTokens(amountToSwap,0,path,address(this),block.timestamp) (#389-395)
- router.addLiquidityETH{value: amountBNBLiquidity}(address(this),amountToLiquify,0,0,marketingFeeReceiver,block.timestamp) (#403-410)
External calls sending eth:
- swapBack() (#340)
- router.addLiquidityETH{value: amountBNBLiquidity}(address(this),amountToLiquify,0,0,marketingFeeReceiver,block.timestamp) (#403-410)
- address(marketingFeeReceiver).transfer(address(this).balance) (#412)
State variables written after the call(s):
- _balances[sender] = _balances[sender].sub(amount,Insufficient Balance) (#342)
- _balances[recipient] = _balances[recipient].add(amountReceived) (#344)
- amountReceived = takeFee(sender,amount) (#343)
- _balances[address(this)] = _balances[address(this)].add(fee) (#362)
- _balances[DEAD] = _balances[DEAD].add(burnAmount) (#365)
Apply the check-effects-interactions pattern.
Additional information: link
ShangHai.swapForToken(address,address) (#421-424) ignores return value by IBEP20(token).transfer(receiver,IBEP20(token).balanceOf(address(this))) (#423)
Use SafeERC20, or ensure that the transfer/transferFrom return value is checked.
Additional information: link
Unable to find manual contract audit (e.g. Certik, PeckShield, Solidity...)
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.
ShangHai.swapBack() (#380-413) ignores return value by router.addLiquidityETH{value: amountBNBLiquidity}(address(this),amountToLiquify,0,0,marketingFeeReceiver,block.timestamp) (#403-410)
Ensure that all the return values of the function calls are used.
Additional information: link
ShangHai._approve(address,address,uint256).owner (#304) shadows:
- Ownable.owner() (#141-143) (function)
Rename the local variables that shadow another component.
Additional information: link
ShangHai.setSwapBackSettings(uint256) (#449-452) should emit an event for:
- swapThreshold = _amount (#451)
Emit an event for critical parameter changes.
Additional information: link
ShangHai.TransferBNBsOutfromContract(uint256,address).receiver (#415) lacks a zero-check on :
- receiver.transfer(amount) (#419)
Check that the address is not zero.
Additional information: link
Reentrancy in ShangHai.constructor() (#256-272):
External calls:
- pair = IDEXFactory(router.factory()).createPair(router.WETH(),address(this)) (#259)
State variables written after the call(s):
- _allowances[address(this)][address(router)] = _totalSupply (#260)
- _balances[msg.sender] = _totalSupply (#270)
- isFeeExempt[msg.sender] = true (#264)
- isFeeExempt[address(this)] = true (#265)
- isFeeExempt[marketingFeeReceiver] = true (#266)
- isFeeExempt[address(router)] = true (#267)
- isFeeExempt[DEAD] = true (#268)
- marketingFeeReceiver = address(0x091a7e27c1604a4983a80Dc19C93237B20293CcD) (#262)
Apply the check-effects-interactions pattern.
Additional information: link
Reentrancy in ShangHai._transfer(address,address,uint256) (#328-347):
External calls:
- swapBack() (#340)
- router.swapExactTokensForETHSupportingFeeOnTransferTokens(amountToSwap,0,path,address(this),block.timestamp) (#389-395)
- router.addLiquidityETH{value: amountBNBLiquidity}(address(this),amountToLiquify,0,0,marketingFeeReceiver,block.timestamp) (#403-410)
External calls sending eth:
- swapBack() (#340)
- router.addLiquidityETH{value: amountBNBLiquidity}(address(this),amountToLiquify,0,0,marketingFeeReceiver,block.timestamp) (#403-410)
- address(marketingFeeReceiver).transfer(address(this).balance) (#412)
Event emitted after the call(s):
- Transfer(sender,address(this),fee) (#363)
- amountReceived = takeFee(sender,amount) (#343)
- Transfer(sender,DEAD,burnAmount) (#366)
- amountReceived = takeFee(sender,amount) (#343)
- Transfer(sender,recipient,amountReceived) (#345)
Reentrancy in ShangHai.constructor() (#256-272):
External calls:
- pair = IDEXFactory(router.factory()).createPair(router.WETH(),address(this)) (#259)
Event emitted after the call(s):
- Transfer(address(0),msg.sender,_totalSupply) (#271)
Apply the check-effects-interactions pattern.
Additional information: link
ShangHai.transferFrom(address,address,uint256) (#318-327) uses timestamp for comparisons
Dangerous comparisons:
- require(bool,string)(startTime > 0 || isFeeExempt[sender],Trading not open) (#322)
- startTime == 0 && recipient == pair (#323)
ShangHai._transfer(address,address,uint256) (#328-347) uses timestamp for comparisons
Dangerous comparisons:
- sender == pair && (block.timestamp - startTime <= botTime) && ! isFeeExempt[recipient] (#332)
Avoid relying on block.timestamp.
Additional information: link
Context._msgData() (#120-122) is never used and should be removed
SafeMath.div(uint256,uint256,string) (#86-91) is never used and should be removed
SafeMath.mod(uint256,uint256) (#75-77) is never used and should be removed
SafeMath.mod(uint256,uint256,string) (#93-98) is never used and should be removed
SafeMath.tryAdd(uint256,uint256) (#18-24) is never used and should be removed
SafeMath.tryDiv(uint256,uint256) (#45-50) is never used and should be removed
SafeMath.tryMod(uint256,uint256) (#52-57) is never used and should be removed
SafeMath.tryMul(uint256,uint256) (#33-43) is never used and should be removed
SafeMath.trySub(uint256,uint256) (#26-31) is never used and should be removed
Remove unused functions.
Additional information: link
ShangHai.swapThreshold (#252) is set pre-construction with a non-constant function or state variable:
- _totalSupply / 2000
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.8.0 (#14) allows old versions
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
Function IDEXRouter.WETH() (#174) is not in mixedCase
Function ShangHai.TransferBNBsOutfromContract(uint256,address) (#415-420) is not in mixedCase
Parameter ShangHai.setSwapBackSettings(uint256)._amount (#449) is not in mixedCase
Parameter ShangHai.setSwapBackEnable(bool)._enable (#453) is not in mixedCase
Constant ShangHai._name (#223) is not in UPPER_CASE_WITH_UNDERSCORES
Constant ShangHai._symbol (#224) is not in UPPER_CASE_WITH_UNDERSCORES
Constant ShangHai._decimals (#225) is not in UPPER_CASE_WITH_UNDERSCORES
Variable ShangHai._totalSupply (#227) is not in mixedCase
Variable ShangHai._balances (#229) is not in mixedCase
Variable ShangHai._allowances (#230) is not in mixedCase
Variable ShangHai.DEAD (#247) is not in mixedCase
Follow the Solidity naming convention.
Additional information: link
Reentrancy in ShangHai._transfer(address,address,uint256) (#328-347):
External calls:
- swapBack() (#340)
- address(marketingFeeReceiver).transfer(address(this).balance) (#412)
External calls sending eth:
- swapBack() (#340)
- router.addLiquidityETH{value: amountBNBLiquidity}(address(this),amountToLiquify,0,0,marketingFeeReceiver,block.timestamp) (#403-410)
- address(marketingFeeReceiver).transfer(address(this).balance) (#412)
State variables written after the call(s):
- _balances[sender] = _balances[sender].sub(amount,Insufficient Balance) (#342)
- _balances[recipient] = _balances[recipient].add(amountReceived) (#344)
- amountReceived = takeFee(sender,amount) (#343)
- _balances[address(this)] = _balances[address(this)].add(fee) (#362)
- _balances[DEAD] = _balances[DEAD].add(burnAmount) (#365)
Event emitted after the call(s):
- Transfer(sender,address(this),fee) (#363)
- amountReceived = takeFee(sender,amount) (#343)
- Transfer(sender,DEAD,burnAmount) (#366)
- amountReceived = takeFee(sender,amount) (#343)
- Transfer(sender,recipient,amountReceived) (#345)
Apply the check-effects-interactions pattern.
Additional information: link
Variable IDEXRouter.addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256).amountADesired (#179) is too similar to IDEXRouter.addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256).amountBDesired (#180)
Prevent variables from having similar names.
Additional information: link
ShangHai.slitherConstructorVariables() (#220-458) uses literals with too many digits:
- _totalSupply = 1000000000000 * (10 ** _decimals) (#227)
ShangHai.slitherConstructorVariables() (#220-458) uses literals with too many digits:
- DEAD = 0x000000000000000000000000000000000000dEaD (#247)
Use: Ether suffix, Time suffix, or The scientific notation
Additional information: link
ShangHai.marketingFee (#237) is never used in ShangHai (#220-458)
Remove unused state variables.
Additional information: link
ShangHai.DEAD (#247) should be constant
ShangHai._totalSupply (#227) should be constant
ShangHai.botTime (#235) should be constant
ShangHai.burnFee (#239) should be constant
ShangHai.feeDenominator (#242) should be constant
ShangHai.liquidityFee (#238) should be constant
ShangHai.marketingFee (#237) should be constant
ShangHai.totalFeeButBurn (#240) should be constant
Add the constant attributes to state variables that never change.
Additional information: link
transferOwnership(address) should be declared external:
- Ownable.transferOwnership(address) (#157-165)
balanceOf(address) should be declared external:
- ShangHai.balanceOf(address) (#281)
approve(address,uint256) should be declared external:
- ShangHai.approve(address,uint256) (#284-287)
excludeFromFee(address) should be declared external:
- ShangHai.excludeFromFee(address) (#425-428)
includeInFee(address) should be declared external:
- ShangHai.includeInFee(address) (#429-432)
excludeMultiFromFee(address[],bool) should be declared external:
- ShangHai.excludeMultiFromFee(address[],bool) (#433-440)
isExcludedFromFee(address) should be declared external:
- ShangHai.isExcludedFromFee(address) (#441-443)
multipleTransfer(address[],uint256) should be declared external:
- ShangHai.multipleTransfer(address[],uint256) (#444-448)
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