Analysis f6221f11-b039-4def-b445-06349f371938 Started Sat Jul 24 2021 18:37:28 GMT+0000 (Coordinated Universal Time) Finished Sat Jul 24 2021 19:23:54 GMT+0000 (Coordinated Universal Time) Mode Deep Client Tool Mythx-Vscode-Extension Main Source File /Cakeboss/Cakeboss.Sol DETECTED VULNERABILITIES HIGH MEDIUM LOW 0 46 26 ISSUES MEDIUM SWC-000 Function could be marked as external. The function definition of "renounceOwnership" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { 321 322 323 324 325 326 327 328 MEDIUM SWC-000 Function could be marked as external. The function definition of "transferOwnership" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "name" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "symbol" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } 326 327 328 329 330 331 332 333 334 } function name() public view virtual returns (string memory) { return _name; } function symbol() public view virtual returns (string memory) { 423 424 425 426 427 428 429 } function symbol() public view virtual returns (string memory) { return _symbol; } function decimals() public view virtual returns (uint8) { 427 428 429 430 431 432 433 MEDIUM SWC-000 Function could be marked as external. The function definition of "decimals" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "transfer" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "allowance" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations } function decimals() public view virtual returns (uint8) { return _decimals; } function totalSupply() public view virtual override returns (uint256) { 431 432 433 434 435 436 437 } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { 443 444 445 446 447 448 449 450 } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { 448 449 450 451 452 453 454 MEDIUM SWC-000 Function could be marked as external. The function definition of "approve" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "transferFrom" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "increaseAllowance" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { 452 453 454 455 456 457 458 459 } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { 457 458 459 460 461 462 463 464 465 } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { 463 464 465 466 467 468 469 470 MEDIUM SWC-000 Function could be marked as external. The function definition of "decreaseAllowance" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "distributeDividends" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { 468 469 470 471 472 473 474 475 } function distributeDividends() public override payable { require(totalSupply() > 0); if (msg.value > 0) { magnifiedDividendPerShare = magnifiedDividendPerShare.add( (msg.value).mul(magnitude) / totalSupply() ); emit DividendsDistributed(msg.sender, msg.value); totalDividendsDistributed = totalDividendsDistributed.add(msg.value); } } 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 MEDIUM SWC-000 Function could be marked as external. The function definition of "distributeCAKEDividends" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "withdrawDividend" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations function distributeCAKEDividends(uint256 amount) public { require(totalSupply() > 0); if (amount > 0) { magnifiedDividendPerShare = magnifiedDividendPerShare.add( (amount).mul(magnitude) / totalSupply() ); emit DividendsDistributed(msg.sender, amount); totalDividendsDistributed = totalDividendsDistributed.add(amount); } } function withdrawDividend() public virtual override { 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 } function withdrawDividend() public virtual override { _withdrawDividendOfUser(msg.sender); } function _withdrawDividendOfUser(address payable user) internal returns (uint256) { 644 645 646 647 648 649 650 MEDIUM SWC-000 Function could be marked as external. The function definition of "dividendOf" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "withdrawnDividendOf" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "updateMaxWallet" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations } function dividendOf(address _owner) public view override returns(uint256) { return withdrawableDividendOf(_owner); } function withdrawableDividendOf(address _owner) public view override returns(uint256) { 666 667 668 669 670 671 672 } function withdrawnDividendOf(address _owner) public view override returns(uint256) { return withdrawnDividends[_owner]; } function accumulativeDividendOf(address _owner) public view override returns(uint256) { 674 675 676 677 678 679 680 } function updateMaxWallet(uint256 maxWallet) public onlyOwner { _maxWalletToken = maxWallet * (10**18); } function updateMaxBuyTranscationAmount(uint256 maxBuy) public onlyOwner { 856 857 858 859 860 861 862 MEDIUM SWC-000 Function could be marked as external. The function definition of "updateMaxBuyTranscationAmount" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "updateMaxSellTransactionAmount" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations } function updateMaxBuyTranscationAmount(uint256 maxBuy) public onlyOwner { maxBuyTranscationAmount = maxBuy * (10**18); } function updateMaxSellTransactionAmount(uint256 maxSell) public onlyOwner { 860 861 862 863 864 865 866 } function updateMaxSellTransactionAmount(uint256 maxSell) public onlyOwner { maxSellTransactionAmount = maxSell * (10**18); } function updateDividendTracker(address newAddress) public onlyOwner { 864 865 866 867 868 869 870 MEDIUM SWC-000 Function could be marked as external. The function definition of "updateDividendTracker" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "updateUniswapV2Router" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations } function updateDividendTracker(address newAddress) public onlyOwner { require(newAddress != address(dividendTracker), "CakeBoss: The dividend tracker already has that address"); CakeBossDividendTracker newDividendTracker = CakeBossDividendTracker(payable(newAddress)); require(newDividendTracker.owner() == address(this), "CakeBoss: The new dividend tracker must be owned by the CakeBoss token contract"); newDividendTracker.excludeFromDividends(address(newDividendTracker)); newDividendTracker.excludeFromDividends(address(this)); newDividendTracker.excludeFromDividends(address(uniswapV2Router)); emit UpdateDividendTracker(newAddress, address(dividendTracker)); dividendTracker = newDividendTracker; } function updateUniswapV2Router(address newAddress) public onlyOwner { 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 } function updateUniswapV2Router(address newAddress) public onlyOwner { require(newAddress != address(uniswapV2Router), "CakeBoss: The router already has that address"); emit UpdateUniswapV2Router(newAddress, address(uniswapV2Router)); uniswapV2Router = IUniswapV2Router02(newAddress); } function excludeFromFees(address account, bool excluded) public onlyOwner { 884 885 886 887 888 889 890 891 892 MEDIUM SWC-000 Function could be marked as external. The function definition of "excludeMultipleAccountsFromFees" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "setAutomatedMarketMakerPair" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "SetupLiquidityTokenAddress" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFees[accounts[i]] = excluded; } emit ExcludeMultipleAccountsFromFees(accounts, excluded); } function setAutomatedMarketMakerPair(address pair, bool value) public onlyOwner { 897 898 899 900 901 902 903 904 905 906 907 } function setAutomatedMarketMakerPair(address pair, bool value) public onlyOwner { require(pair != uniswapV2Pair, "CakeBoss: The PancakeSwap pair cannot be removed from automatedMarketMakerPairs"); _setAutomatedMarketMakerPair(pair, value); } function _setAutomatedMarketMakerPair(address pair, bool value) private { 905 906 907 908 909 910 911 912 913 address private _liquidityTokenAddress; //Sets up the LP-Token Address required for LP Release function SetupLiquidityTokenAddress(address liquidityTokenAddress) public onlyOwner{ _liquidityTokenAddress=liquidityTokenAddress; _liquidityUnlockTime=block.timestamp+DefaultLiquidityLockTime; } //////////////////////////////////////////////////////////////////////////////////////////////////////// 923 924 925 926 927 928 929 930 MEDIUM SWC-000 Function could be marked as external. The function definition of "TeamlimitLiquidityReleaseTo20Percent" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "TeamUnlockLiquidityInSeconds" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations //Should be called once start was successful. bool public liquidityRelease20Percent; function TeamlimitLiquidityReleaseTo20Percent() public onlyOwner{ liquidityRelease20Percent=true; } function TeamUnlockLiquidityInSeconds(uint256 secondsUntilUnlock) public onlyOwner{ 937 938 939 940 941 942 943 } function TeamUnlockLiquidityInSeconds(uint256 secondsUntilUnlock) public onlyOwner{ _prolongLiquidityLock(secondsUntilUnlock+block.timestamp); } function _prolongLiquidityLock(uint256 newUnlockTime) private{ // require new unlock time to be longer than old one 941 942 943 944 945 946 947 MEDIUM SWC-000 Function could be marked as external. The function definition of "TeamReleaseLiquidity" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "updateLiquidityWallet" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations //Release Liquidity Tokens once unlock time is over function TeamReleaseLiquidity() public onlyOwner { //Only callable if liquidity Unlock time is over require(block.timestamp >= _liquidityUnlockTime, "Not yet unlocked"); IERC20 liquidityToken = IERC20(_liquidityTokenAddress); uint256 amount = liquidityToken.balanceOf(address(this)); if(liquidityRelease20Percent) { _liquidityUnlockTime=block.timestamp+DefaultLiquidityLockTime; //regular liquidity release, only releases 20% at a time and locks liquidity for another week amount=amount*2/10; liquidityToken.transfer(liquidityWallet, amount); } else { //Liquidity release if something goes wrong at start //liquidityRelease20Percent should be called once everything is clear liquidityToken.transfer(liquidityWallet, amount); } } function updateLiquidityWallet(address newLiquidityWallet) public onlyOwner { 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 } function updateLiquidityWallet(address newLiquidityWallet) public onlyOwner { require(newLiquidityWallet != liquidityWallet, "CakeBoss: The liquidity wallet is already this address"); excludeFromFees(newLiquidityWallet, true); emit LiquidityWalletUpdated(newLiquidityWallet, liquidityWallet); liquidityWallet = newLiquidityWallet; } function getLiquidityReleaseTimeInSeconds() public view returns (uint256){ if(block.timestamp<_liquidityUnlockTime){ 972 973 974 975 976 977 978 979 980 981 MEDIUM SWC-000 Function could be marked as external. The function definition of "getLiquidityReleaseTimeInSeconds" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "updateGasForProcessing" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "isExcludedFromFees" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations liquidityWallet = newLiquidityWallet; } function getLiquidityReleaseTimeInSeconds() public view returns (uint256){ if(block.timestamp<_liquidityUnlockTime){ return _liquidityUnlockTime-block.timestamp; } return 0; } function updateGasForProcessing(uint256 newValue) public onlyOwner { 978 979 980 981 982 983 984 985 986 987 } function updateGasForProcessing(uint256 newValue) public onlyOwner { require(newValue >= 200000 && newValue <= 500000, "CakeBoss: gasForProcessing must be between 200,000 and 500,000"); require(newValue != gasForProcessing, "CakeBoss: Cannot update gasForProcessing to same value"); emit GasForProcessingUpdated(newValue, gasForProcessing); gasForProcessing = newValue; } function updateClaimWait(uint256 claimWait) external onlyOwner { 985 986 987 988 989 990 991 992 993 994 } function isExcludedFromFees(address account) public view returns(bool) { return _isExcludedFromFees[account]; } function withdrawableDividendOf(address account) public view returns(uint256) { 1004 1005 1006 1007 1008 1009 1010 MEDIUM SWC-000 Function could be marked as external. The function definition of "withdrawableDividendOf" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "dividendTokenBalanceOf" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "setAntiBotEnabled" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations } function withdrawableDividendOf(address account) public view returns(uint256) { return dividendTracker.withdrawableDividendOf(account); } function dividendTokenBalanceOf(address account) public view returns (uint256) { 1008 1009 1010 1011 1012 1013 1014 } function dividendTokenBalanceOf(address account) public view returns (uint256) { return dividendTracker.balanceOf(account); } function getAccountDividendsInfo(address account) 1012 1013 1014 1015 1016 1017 1018 } function setAntiBotEnabled(bool _enabled) public onlyOwner { antiBotEnabled = _enabled; emit antiBotEnabledUpdated(_enabled); } function getAntiBotEnabled() public view returns (bool) { 1059 1060 1061 1062 1063 1064 1065 1066 1067 MEDIUM SWC-000 Function could be marked as external. The function definition of "updateMarketingFee" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "updateLiquidityFee" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "updateETHRewardsFee" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations } function updateMarketingFee(uint8 newFee) public onlyOwner { require(newFee >= 0 && newFee <= 10, "CakeBoss: Marketing tax must be between 0 and 10"); marketingFee = newFee; } function updateLiquidityFee(uint8 newFee) public onlyOwner { 1281 1282 1283 1284 1285 1286 1287 1288 } function updateLiquidityFee(uint8 newFee) public onlyOwner { require(newFee >= 0 && newFee <= 10, "CakeBoss: Liquidity tax must be between 0 and 10"); liquidityFee = newFee; } function updateETHRewardsFee(uint8 newFee) public onlyOwner { 1286 1287 1288 1289 1290 1291 1292 1293 } function updateETHRewardsFee(uint8 newFee) public onlyOwner { require(newFee >= 0 && newFee <= 15, "CakeBoss: ETH Rewards tax must be between 0 and 15"); liquidityFee = newFee; } function withdrawRemainingToken(address account) public onlyOwner { 1291 1292 1293 1294 1295 1296 1297 1298 MEDIUM SWC-000 Function could be marked as external. The function definition of "withdrawRemainingToken" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "withdrawRemainingBEP20Token" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "burnRemainingToken" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations } function withdrawRemainingToken(address account) public onlyOwner { uint256 balance = balanceOf(address(this)); super._transfer(address(this), account, balance); } function withdrawRemainingBEP20Token(address bep20, address account) public onlyOwner { 1296 1297 1298 1299 1300 1301 1302 1303 } function withdrawRemainingBEP20Token(address bep20, address account) public onlyOwner { ERC20 BEP20 = ERC20(bep20); uint256 balance = BEP20.balanceOf(address(this)); BEP20.transfer(account, balance); } function burnRemainingToken() public onlyOwner { 1301 1302 1303 1304 1305 1306 1307 1308 1309 } function burnRemainingToken() public onlyOwner { uint256 balance = balanceOf(address(this)); super._transfer(address(this), 0x000000000000000000000000000000000000dEaD, balance); } function checkBot(address sender,address recipient) private { 1307 1308 1309 1310 1311 1312 1313 1314 MEDIUM SWC-000 Function could be marked as external. The function definition of "withdrawDividend" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-000 Function could be marked as external. The function definition of "getAccountAtIndex" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations } function withdrawDividend() public pure override { require(false, "CakeBoss_Dividend_Tracker: withdrawDividend disabled. Use the 'claim' function on the main CakeBoss contract."); } function excludeFromDividends(address account) external onlyOwner { 1377 1378 1379 1380 1381 1382 1383 } function getAccountAtIndex(uint256 index) public view returns ( address, int256, int256, uint256, uint256, uint256, uint256, uint256) { if(index >= tokenHoldersMap.size()) { return (0x0000000000000000000000000000000000000000, -1, -1, 0, 0, 0, 0, 0); } address account = tokenHoldersMap.getKeyAtIndex(index); return getAccount(account); } function canAutoClaim(uint256 lastClaimTime) private view returns (bool) { 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 MEDIUM SWC-000 Function could be marked as external. The function definition of "process" is marked "public". However, it is never directly called by another function in the same contract or in any of its descendants. Consider to mark it as "external" instead. Source file /cakeboss/cakeboss.sol Locations } function process(uint256 gas) public returns (uint256, uint256, uint256) { uint256 numberOfTokenHolders = tokenHoldersMap.keys.length; if(numberOfTokenHolders == 0) { return (0, 0, lastProcessedIndex); } uint256 _lastProcessedIndex = lastProcessedIndex; uint256 gasUsed = 0; uint256 gasLeft = gasleft(); uint256 iterations = 0; uint256 claims = 0; while(gasUsed < gas && iterations < numberOfTokenHolders) { _lastProcessedIndex++; if(_lastProcessedIndex >= tokenHoldersMap.keys.length) { _lastProcessedIndex = 0; } address account = tokenHoldersMap.keys[_lastProcessedIndex]; if(canAutoClaim(lastClaimTimes[account])) { if(processAccount(payable(account), true)) { claims++; } } iterations++; uint256 newGasLeft = gasleft(); if(gasLeft > newGasLeft) { gasUsed = gasUsed.add(gasLeft.sub(newGasLeft)); } gasLeft = newGasLeft; } lastProcessedIndex = _lastProcessedIndex; return (iterations, claims, lastProcessedIndex); } function processAccount(address payable account, bool automatic) public onlyOwner returns (bool) { 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 MEDIUM SWC-107 Write to persistent state following external call The contract account state is accessed after an external call to a user defined address. To prevent reentrancy issues, consider accessing the state only before the call, especially if the callee is untrusted. Alternatively, a reentrancy lock can be used to prevent untrusted callees from re-entering the contract in an intermediate state. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-107 Read of persistent state following external call The contract account state is accessed after an external call to a user defined address. To prevent reentrancy issues, consider accessing the state only before the call, especially if the callee is untrusted. Alternatively, a reentrancy lock can be used to prevent untrusted callees from re-entering the contract in an intermediate state. Source file /cakeboss/cakeboss.sol Locations MEDIUM SWC-107 Write to persistent state following external call The contract account state is accessed after an external call to a user defined address. To prevent reentrancy issues, consider accessing the state only before the call, especially if the callee is untrusted. Alternatively, a reentrancy lock can be used to prevent untrusted callees from re-entering the contract in an intermediate state. Source file /cakeboss/cakeboss.sol Locations .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = _uniswapV2Pair; 829 830 831 832 833 function _setAutomatedMarketMakerPair(address pair, bool value) private { require(automatedMarketMakerPairs[pair] != value, "CakeBoss: Automated market maker pair is already set to that value"); automatedMarketMakerPairs[pair] = value; if(value) { 913 914 915 916 917 if(value) { dividendTracker.excludeFromDividends(pair); } 916 917 918 919 920 LOW SWC-103 A floating pragma is set. The current pragma Solidity directive is ""^0.7.6"". It is recommended to specify a fixed compiler version to ensure that the bytecode produced does not vary between builds. This is especially important if you rely on bytecode-level verification of the code. Source file /cakeboss/cakeboss.sol Locations LOW SWC-107 A call to a user-supplied address is executed. An external message call to an address specified by the caller is executed. Note that the callee account might contain arbitrary code and could re-enter any function within this contract. Reentering the contract in an intermediate state may lead to unexpected behaviour. Make sure that no state modifications are executed after this call and/or reentrancy guards are in place. Source file /cakeboss/cakeboss.sol Locations LOW SWC-107 Read of persistent state following external call The contract account state is accessed after an external call to a fixed address. To prevent reentrancy issues, consider accessing the state only before the call, especially if the callee is untrusted. Alternatively, a reentrancy lock can be used to prevent untrusted callees from re-entering the contract in an intermediate state. Source file /cakeboss/cakeboss.sol Locations */ pragma solidity ^0.7.6; //SPDX-License-Identifier: none 5 6 7 8 9 // Create a uniswap pair for this new token address _uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router = _uniswapV2Router; 826 827 828 829 830 831 // exclude from receiving dividends dividendTracker.excludeFromDividends(address(dividendTracker)); dividendTracker.excludeFromDividends(address(this)); dividendTracker.excludeFromDividends(address(_uniswapV2Router)); 835 836 837 838 839