King Sale

Smart Contract Audit Report

Audit Summary

King Sale Audit Report King Sale is developing two launchpads, two staking platforms, and a platform for users to lock tokens.

For this audit, we reviewed the following implementation contracts on the Binance Smart Chain Testnet:

Audit Findings

High findings were identified and the team must resolve these issues. In addition, centralized aspects are present.
Date: August 11th, 2023.
Updated: September 8th, 2023 to reflect the contract's latest Testnet addresses.

Finding #1 - LaunchpadBNB - High (Resolved)

Description: The sendBnb() function sets the bnbAmount value allocated to the _investor to zero and then subsequently transfers this zero BNB value to the _investor.
Risk/Impact: Any BNB that the _investor address contributed will be forfeited, and they will no longer be eligible for a refund.
Recommendation: A uint256 local variable should be introduced that stores the bnbAmount allocated to the _investor before it is set to zero. This local variable BNB value should then be transferred to the _investor.
Resolution: The team has modified the sendBnb() function to properly transfer the appropriate BNB amount.

Finding #2 - LaunchpadTOKEN - High (Resolved)

Description: The sendBnb() function incorrectly transfers the participateAmount value allocated to msg.sender rather than _investor.
Risk/Impact: Any collecting tokens that the _investor address contributed will be forfeited, and they will no longer be eligible for a refund.
Recommendation: A uint256 local variable should be introduced that stores the participateAmount allocated to the _investor before it is set to zero. This local variable collecting token value should then be transferred to the _investor.
Resolution: The team has modified the sendBnb() function to properly transfer the appropriate token amount.

Finding #3 - StakingSAME & StakingDifference - High (Resolved)

Description: The KingStaking contract enables users to specify any token address as the staking token; however, the deposit() function does not include logic to support fee-on-transfer tokens. When depositing a fee-on-transfer token, the assigned user.amount for the deposit will be greater than the actual amount transferred to the contract.
Risk/Impact: When any user withdraws a fee-on-transfer token, the function will attempt to transfer a greater number of tokens than what was initially transferred to the contract by the user. As a result, the transaction will either fail if the contract lacks a sufficient token balance or a portion of the withdrawn tokens will be funded by another user's deposit.
Recommendation: The team should add fee-on-transfer support logic to the deposit() function by setting user.amount and totalStakedTokens as the difference between the contract's token balance before and after the token transfer occurs.
Resolution: The team has modified the deposit() functions to not support fee-on-transfer tokens unless the contract has been excluded from the token's fee mechanism.

Finding #4 - StakingDifference - High

Description: The owner can withdraw any staking tokens from the contract at any time via the recoverWrongTokens() function.
function recoverWrongTokens(address _tokenAddress, uint256 _tokenAmount)
   external
   onlyOwner
{
   require(
       _tokenAddress != address(rewardToken),
       "Cannot be reward token"
   );

   IERC20(_tokenAddress).transfer(address(msg.sender), _tokenAmount);
Risk/Impact: The owner can withdraw any user's staked tokens at any time.
Recommendation: The team should either remove this function or modify it to ensure that the _tokenAddress parameter cannot be the contract's staking token.
Resolution: The team has not yet addressed this issue.

Finding #5 - StakingSAME - High

Description: The owner can withdraw any staking tokens from the contract at any time via the recoverWrongTokens() function and emergencyRewardWithdraw() function.
function recoverWrongTokens(address _tokenAddress, uint256 _tokenAmount)
   external
   onlyOwner
{
   require(
       _tokenAddress != address(rewardToken),
       "Cannot be reward token"
   );

   IERC20(_tokenAddress).transfer(address(msg.sender), _tokenAmount);

...

function emergencyRewardWithdraw(uint256 _amount) external onlyOwner {
   stakedToken.transfer(address(msg.sender), _amount);
}
Risk/Impact: The owner can withdraw any user's staked tokens at any time.
Recommendation: The team should either remove these functions or modify them to ensure that the contract's staking token cannot be withdrawn. The team could also modify the functions to ensure that the totalStakedTokens value cannot be withdrawn.
Resolution: The team has not yet addressed this issue.

Finding #6 - TokensLocker - High

Description: The owner can withdraw any locked tokens from the contract at any time via the withdrawBep20Tokens() function.
function withdrawBep20Tokens(address _token, uint256 percentage)
   public
   onlyOwner
{
   uint256 tokenBalance = IERC20(_token).balanceOf(address(this));
   require(tokenBalance > 0, "No enough tokens in the pool");

   uint256 tokensToTransfer = tokenBalance.mul(percentage).div(100);

   IERC20(_token).transfer(msg.sender, tokensToTransfer);
}
Risk/Impact: The owner can withdraw any currently locked tokens in the contract at any time.
Recommendation: The team should either remove this function or modify it to ensure that any tokens currently locked in the contract can't be withdrawn.
Resolution: The team has not yet addressed this issue.

Finding #7 - StakingSAME & StakingDifference - Low (Resolved)

Description: The emergencyWithdraw() function reduces the withdrawal amount by a penaltyAmount, but the earlyPenalty percentage is permanently set to zero.
Risk/Impact: A penalty will never be applied to emergency withdrawals.
Recommendation: The KingStaking or Staking contracts should either be modified to allow the creator or owner to set the earlyPenalty value or all logic regarding the earlyPenalty should be removed for additional gas savings on each call.
Resolution: The team has modified the contracts to set the earlyPenalty percentage to 5% on deployment. The owner can now update this percentage at any time.

Finding #8 - LaunchpadBNB - Informational (Resolved)

Description: The participateToSale() function increments investorCount by one and adds the caller to the investors array each time it's called. If a user calls this function multiple times and later calls claimBnb() or the sendBnb() function is called on their behalf after the sale is canceled, the investorCount becomes inaccurate as it will decrement by only one, despite having been increased multiple times for that user.
Recommendation: The team should either avoid incrementing investorCount and adding the user to the investors array if the user has previously called the participateToSale() function, or decrement investorCount in the claimBnb() and sendBnb() functions based on the number of times the user has called participateToSale().
Resolution: The team has modified the participateToSale() function to only increment investorCount and add the user to the investors array if the user has not previously called the participateToSale() function.

Finding #9 - LaunchpadBNB - Informational (Resolved)

Description: The second syncPool() call within the claimBnb() function is redundant. For the transaction to execute, the pool status must be "3". If it is set to 3, the syncPool() function will not execute any logic.
Recommendation: The second syncPool() call in the claimBnb() function could be removed for additional gas savings on each call.
Resolution: The team has implemented the above recommendation.

Finding #10 - LaunchpadBNB - Informational (Resolved)

Description: In the participateToSale() function, the msg.value <= maximumParticipate condition is redundant as the maximum amount was previously checked in the first require statement below:
require(
   shares[msg.sender].bnbAmount.add(msg.value) <= maximumParticipate,
   "Maximum amount reached"
);

...

else {
   require(
         msg.value >= minimumParticipate &&
            msg.value <= maximumParticipate &&      
            msg.value <= remainingBNB,
         "Keep amount within min/max ranges"
   );
}
Recommendation: The msg.value <= maximumParticipate condition could be removed for additional gas savings on each call.
Resolution: The team has implemented the above recommendation.

Finding #11 - LaunchpadBNB & LaunchpadTOKEN - Informational (Resolved)

Description: In the claimTokens() function, the addition of (shares[msg.sender].totalClaim) is redundant as this value will always equal zero.
shares[msg.sender].totalClaim = firstRelease.add(shares[msg.sender].totalClaim);
Recommendation: shares[msg.sender].totalClaim could simply be set to firstRelease as follows for additional gas savings on each call:
shares[msg.sender].totalClaim = firstRelease;
Resolution: The team has implemented the above recommendation.

Finding #12 - deployer & Launchpad - Informational

Description: The insuranceFund state variable may be set and updated but is not used in the contracts.
Recommendation: The team should either remove this state variable to reduce contract size and deployment costs or utilize it in a way that fits their intended functionality.

Finding #13 - TokensLocker - Informational

Description: The following require statement in the lockAndVesting function() is redundant as the function also enforces that _initialReleaseTime must be greater than block.timestamp which is sufficient enough:
require(_initialReleaseTime > 0, "Lock time should be greater than 0");
Recommendation: The above require statement could be removed from the lockAndVesting function() for additional gas savings on each call.

Finding #14 - KingSale - Informational

Description: Although the SafeMath and SafeMathUpgradeable libraries are utilized, the contract is implemented with Solidity v0.8.x which has built-in overflow checks.
Recommendation: SafeMath and SafeMathUpgradeable could be safely removed to reduce contract size, deployment costs, and gas costs on all transactions that utilize it.

Contracts Overview

deployerBnb Contract:
  • Any user can use this contract to create a new launchpad contract by providing the token address, router address, pool and vesting details, pool start time, and indicating whether the pool is whitelisted and if the LP tokens should be burned.
  • The caller must provide an amount of BNB to cover the cost of the contract's creation fee.
  • The specified Router address must have been added to the list of valid Router addresses by the owner.
  • If the creator specified that the LP tokens will not be burned, the lock time associated with the pool must exceed the contract's minimum lock time of 30 days.
  • The total number of tokens covering the sale, the token fee, and a liquidity-add are transferred from the caller to the newly created Launchpad contract. The caller must grant the contract a sufficient allowance in order for the transaction to successfully occur.
  • The caller is assigned as the owner of the pool and the owner of this contract gets assigned as the owner of the newly created Launchpad contract.
  • The owner can withdraw any tokens or BNB from the contract at any time.
  • The owner can set the creation fee to any value at any time.
  • The owner can set the token fee percentage, BNB fee percentage, and insurance fund to any values at any time.
  • The owner can update the token locker address at any time.
  • The owner can add/remove any address from the Router whitelist at any time.
  • The owner can upgrade the contract at any time.
LaunchpadBNB Contract:
  • A new contract is created via the deployer contract and initialized using the details of the sale specified by the creator.
  • Any user can initiate a purchase when the status of the sale is set to "live" by providing an amount of BNB.
  • If the sale enforces a whitelist, the caller must have been added to the contract's whitelist by the pool owner or the sale's public time must have been reached.
  • The total amount of BNB provided per user cannot exceed the maximum cap set by the creator.
  • The amount of BNB provided per transaction must exceed the minimum value set by the creator.
  • The number of tokens allocated to the user is based on the amount of provided BNB and the tokens per BNB rate set by the creator.
  • The contract owner or pool owner can cancel the sale before its been finalized which will transfer all of the sale tokens in the contract to the pool owner and declare the sale as canceled.
  • If the sale has been canceled, any user that has initiated a purchase can claim their provided BNB as a refund at any time.
  • The sale will end once either the hard cap of raised BNB has been met or once the end time of the sale has passed and the soft cap of raised BNB has been met.
  • The status of the sale is automatically set to canceled if the end time of the sale has passed and the soft cap of raised BNB has not been met.
  • After the sale has successfully ended, the pool owner can finalize the pool at any time.
  • Upon finalizing, liquidity will be added for the token using a percentage of the raised BNB and a percentage of the total number of tokens.
  • If the creator specified that LP is to be burned, the LP tokens generated through the liquidity-add are permanently locked in the 0x00 address.
  • If the creator specified that LP is not to be burned, the LP tokens are locked in the TokensLocker contract for the number of days specified during creation (minimum 30) and ownership of the lock is granted to the pool owner.
  • Any tokens that have not been purchased are transferred from the contract to the pool owner.
  • A token fee is deducted from the total token amount and is transferred to the contract owner.
  • A BNB fee is deducted from the total raised BNB and is transferred to the contract owner. The remaining BNB is sent to the pool owner.
  • Users that have contributed to the sale can claim tokens after the sale has been finalized.
  • If a vesting schedule is not set for the sale, the user is transferred the full number of tokens due to them from the contract.
  • If a vesting schedule is set, an initial portion of the total number of tokens due to the user is transferred to their wallet address based on the initial release percentage set by the creator.
  • Users can claim a percentage (set by the creator) of the remaining tokens due to them each time the "release cycle" duration has passed since their previous claim. The user's first claim may occur after the release cycle duration has passed since the sale has been finalized.
  • Once the current status of the sale is set to "finalized" the contract owner or pool owner can manually release tokens to each investor, covering up to 50 investors per transaction.
  • If the current status of the sale is "canceled" the contract owner or pool owner can refund the BNB contributed by each investor, covering up to 50 investors per transaction.
  • The pool owner can add any addresses to the sale whitelist at any time.
  • The contract owner can set the pool owner address to any address at any time.
  • The contract owner can set the token locker address to any address at any time.
  • The contract owner can withdraw any BNB and tokens from the contract at any time. The team must ensure the contract has a sufficient token balance to support claiming and a sufficient BNB balance to support refunds if the sale is canceled.
  • The owner can upgrade the contract at any time.
deployerBep20 Contract:
  • Any user can use this contract to create a new launchpad contract by providing the sale token address, collecting token address, router address, pool and vesting details, pool start time, and indicating whether the pool is whitelisted and if the LP tokens should be burned.
  • The caller must provide an amount of BNB to cover the cost of the contract's creation fee.
  • The specified collecting token address must have been added to the list of valid token addresses by the owner.
  • The specified Router address must have been added to the list of valid Router addresses by the owner.
  • If the creator specified that the LP tokens will not be burned, the lock time associated with the pool must exceed the contract's minimum lock time of 30 days.
  • The total number of tokens covering the sale, the token fee, and a liquidity-add are transferred from the caller to the newly created Launchpad contract. The caller must grant the contract a sufficient allowance in order for the transaction to successfully occur.
  • The caller is assigned as the owner of the pool and the owner of this contract gets assigned as the owner of the newly created Launchpad contract.
  • The owner can withdraw any tokens or BNB from the contract at any time.
  • The owner can set the creation fee to any value at any time.
  • The owner can set the token fee percentage, BNB fee percentage, and insurance fund to any values at any time.
  • The owner can update the token locker address at any time.
  • The owner can add any address to the token whitelist at any time.
  • The owner can add/remove any address from the Router whitelist at any time.
  • The owner can upgrade the contract at any time.
LaunchpadBep20 Contract:
  • A new contract is created via the deployer contract and initialized using the details of the sale specified by the creator.
  • Any user can initiate a purchase when the status of the sale is set to "live" by specifying an amount of the collecting token.
  • The specified number of tokens are transferred from the caller to the contract. The caller must grant the contract a sufficient allowance in order for the transaction to successfully occur.
  • If the sale enforces a whitelist, the caller must have been added to the contract's whitelist by the pool owner or the sale's public time must have been reached.
  • The total amount of collecting tokens provided per user cannot exceed the maximum cap set by the creator.
  • The number of collecting tokens provided per transaction must exceed the minimum value set by the creator.
  • The number of tokens allocated to the user is based on the amount of provided collecting tokens and the tokens per BNB rate set by the creator.
  • The contract owner or pool owner can cancel the sale before its been finalized which will transfer all of the sale tokens in the contract to the pool owner and declare the sale as canceled.
  • If the sale has been canceled, any user that has initiated a purchase can claim their provided collected tokens as a refund at any time.
  • The sale will end once either the hard cap of raised collecting tokens has been met or once the end time of the sale has passed and the soft cap of raised BNB has been met.
  • The status of the sale is automatically set to canceled if the end time of the sale has passed and the soft cap of raised collecting tokens has not been met.
  • After the sale has successfully ended, the pool owner can finalize the pool at any time.
  • Upon finalizing, liquidity will be added for the token using a percentage of the raised collecting tokens and a percentage of the total number of tokens.
  • If the creator specified that LP is to be burned, the LP tokens generated through the liquidity-add are permanently locked in the 0x00 address.
  • If the creator specified that LP is not to be burned, the LP tokens are locked in the TokensLocker contract for the number of days specified during creation (minimum 30) and ownership of the lock is granted to the pool owner.
  • Any tokens that have not been purchased are transferred from the contract to the pool owner.
  • A token fee is deducted from the total token amount and is transferred to the contract owner.
  • A BNB fee is deducted from the total raised collecting tokens and is transferred to the contract owner. The remaining collecting tokens are sent to the pool owner.
  • Users that have contributed to the sale can claim tokens after the sale has been finalized.
  • If a vesting schedule is not set for the sale, the user is transferred the full number of tokens due to them from the contract.
  • If a vesting schedule is set, an initial portion of the total number of tokens due to the user is transferred to their wallet address based on the initial release percentage set by the creator.
  • Users can claim a percentage (set by the creator) of the remaining tokens due to them each time the "release cycle" duration has passed since their previous claim. The user's first claim may occur after the release cycle duration has passed since the sale has been finalized.
  • Once the current status of the sale is set to "finalized" the contract owner or pool owner can manually release tokens to each investor, covering up to 50 investors per transaction.
  • If the current status of the sale is "canceled" the contract owner or pool owner can refund the collecting tokens contributed by each investor, covering up to 50 investors per transaction.
  • The pool owner can add up to 15 addresses per transaction to the sale whitelist at any time.
  • The contract owner can set the pool owner address to any address at any time.
  • The contract owner can set the token locker address to any address at any time.
  • The contract owner can withdraw any BNB and tokens from the contract at any time. The team must ensure the contract has a sufficient token balance to support claiming and a sufficient BNB balance to support refunds if the sale is canceled.
KingStakingDifference Contract:
  • Any user can use this contract to deploy a new Staking contract. Upon creation, the user will specify the staking pool's staking token, reward token, start block and end block, deposit limit per user, lock time, reward supply, and decimal value.
  • The caller must provide an amount of BNB to cover the cost of the contract's creation fee.
  • The staking token and reward token may not be set to the same address.
  • The total supply value returned from both the staking and reward token contracts must be any unsigned integer.
  • The specified reward supply is transferred from the caller to the Staking contract. The caller must grant the contract a sufficient allowance in order for the transaction to successfully occur.
  • The owner can set the creation fee to any value at any time.
  • The owner can withdraw the contract's full BNB balance at any time.
  • The owner can upgrade the contract at any time.
StakingDifference Contract:
  • Any user can initiate a deposit by specifying a number of staking tokens that will be transferred to the contract. The caller must grant the contract a sufficient allowance in order for the transaction to successfully occur.
  • If a user limit was set upon creation, the total number of staked tokens per user cannot exceed the contract's maximum cap.
  • The platform does not support the depositing of fee-on-transfer tokens unless this contract has been excluded from the token's fee mechanism.
  • Any user that has deposited tokens can specify a number of tokens to withdraw once the contract's lock time (set by the creator) has passed since the user's previous deposit.
  • Any pending rewards are automatically calculated and transferred to the user on deposits and withdrawals.
  • Any user that has deposited tokens can initiate an emergency withdrawal which will withdraw the user's staked tokens and forfeit all rewards.
  • The owner can withdraw any reward tokens from the contract at any time. The team must ensure a sufficient number of reward tokens are in the contract to support rewards for all users.
  • The owner can withdraw any staking tokens from the contract at any time.
  • If the contract has a staking limit per user, the owner can increase the limit to any value at any time. The owner may also disable the limit at any time. Once disabled, it can never be enabled.
  • The owner can update the reward per block to any value before the start block has passed.
  • The owner can update the start and end blocks of the pool before the current start block has passed.
  • The owner can set the pool's end block to the current block at any time which will stop rewards.
KingStakingSAME Contract:
  • Any user can use this contract to deploy a new Staking contract. Upon creation, the user will specify the staking pool's staking token, start block and end block, deposit limit per user, lock time, reward supply, and decimal value.
  • The staking token and reward token are set to the same address.
  • The total supply value returned from the token contract must be any unsigned integer.
  • The caller must provide an amount of BNB to cover the cost of the contract's creation fee.
  • The specified reward supply is transferred from the caller to the Staking contract. The caller must grant the contract a sufficient allowance in order for the transaction to successfully occur.
  • The owner can set the creation fee to any value at any time.
  • The owner can withdraw the contract's full BNB balance at any time.
  • The owner can upgrade the contract at any time.
StakingSAME Contract:
  • Any user can initiate a deposit by specifying a number of staking tokens that will be transferred to the contract. The caller must grant the contract a sufficient allowance in order for the transaction to successfully occur.
  • If a user limit was set upon creation, the total number of staked tokens per user cannot exceed the contract's maximum cap.
  • Any user that has deposited tokens can specify a number of tokens to withdraw once the contract's lock time (set by the creator) has passed since the user's previous deposit.
  • Any pending rewards are automatically calculated and transferred to the user on deposits and withdrawals.
  • Any user that has deposited tokens can initiate an emergency withdrawal which will withdraw the user's staked tokens and forfeit all rewards.
  • The owner can withdraw any staking/reward tokens from the contract at any time. The team must ensure a sufficient number of reward tokens are in the contract to support rewards for all users.
  • If the contract has a staking limit per user, the owner can increase the limit to any value at any time. The owner may also disable the limit at any time. Once disabled, it can never be enabled.
  • The owner can update the reward per block to any value before the start block has passed.
  • The owner can update the start and end blocks of the pool before the current start block has passed.
  • The owner can set the pool's end block to the current block at any time which will stop rewards.
  • The owner can upgrade the contract at any time.
TokensLocker Contract:
  • Any user can initiate a new standard lock by specifying a token address, a number of tokens to lock, a lock time, and whether or not the token is an LP token.
  • The specified number of tokens are transferred from the caller to the contract. The caller must grant the contract a sufficient allowance in order for the transaction to successfully occur.
  • The contract does not support the locking of fee-on-transfer tokens for standard locks unless this contract has been excluded from the token's fee mechanism.
  • Each standard lock is assigned a unique lock ID and the caller is assigned as the owner of the lock.
  • Any standard lock owner can extend the unlock time for any of their lock IDs to any time in the future at any time.
  • Any standard lock owner can specify any of their lock IDs to unlock once the expire time associated with the lock has passed. The full number of tokens are transferred from the contract to the caller.
  • Any user can initiate a new vesting lock by specifying a token address, a number of tokens to lock, an initial release time, an initial release percentage, a release cycle time, and a release percentage.
  • The caller must also provide an amount of BNB to cover the contract's lock fee.
  • The contract does not support the locking of fee-on-transfer tokens for vesting locks unless this contract has been excluded from the token's fee mechanism.
  • Each vesting lock is assigned a unique lock ID and the caller is assigned as the owner of the lock.
  • Any vesting lock owner can extend the next claim time for any of their lock IDs to any time in the future if the current next claim time has been reached.
  • Any vesting lock owner can unlock the initial percentage of tokens for any of their lock IDs once the initial release time assigned to the lock has passed.
  • After the initial percentage of tokens has been unlocked, any vesting lock owner can unlock the standard percentage of tokens every time the release cycle duration since the previous claim has passed.
  • Any lock owner can transfer ownership of any of their lock IDs to any address at any time.
  • The owner can withdraw any tokens from the contract at any time.
  • The owner can withdraw the contract's full BNB balance at any time.
  • The owner can include and exclude accounts from the standard lock fee at any time. The standard lock fee is not currently enforced in the contract.
  • The owner can upgrade the contract at any time.

Audit Results

Vulnerability Category Notes Result
Arbitrary Jump/Storage Write N/A PASS
Centralization of Control
  • The owner can withdraw any staking tokens from the Staking contracts at any time.
  • The owner can withdraw any locked tokens from the TokensLocker contract at any time.
  • The contract owner can update the pool owner address to any address at any time in the Launchpad contracts.
  • The contract owner can withdraw any BNB and tokens from the Launchpad contracts at any time.
  • The team can upgrade the upgradeable contracts at any time.
FAIL
Compiler Issues N/A PASS
Delegate Call to Untrusted Contract N/A PASS
Dependence on Predictable Variables N/A PASS
Ether/Token Theft N/A PASS
Flash Loans N/A PASS
Front Running N/A PASS
Improper Events N/A PASS
Improper Authorization Scheme N/A PASS
Integer Over/Underflow N/A PASS
Logical Issues N/A PASS
Oracle Issues N/A PASS
Outdated Compiler Version N/A PASS
Race Conditions N/A PASS
Reentrancy N/A PASS
Signature Issues N/A PASS
Sybil Attack N/A PASS
Unbounded Loops N/A PASS
Unused Code N/A PASS
Overall Contract Safety   WARNING

deployer and Launchpad Contracts

Smart Contract Audit - Inheritance

Smart Contract Audit - Graph


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

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

 +  Proxy 
    - [Int] _delegate #
    - [Int] _implementation
    - [Int] _fallback #
    - [Ext]  ($)
    - [Ext]  ($)
    - [Int] _beforeFallback #

 + [Int] IBeacon 
    - [Ext] implementation

 + [Int] IERC1822Proxiable 
    - [Ext] proxiableUUID

 + [Lib] Address 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Int] functionDelegateCall #
    - [Int] functionDelegateCall #
    - [Int] verifyCallResult

 + [Lib] StorageSlot 
    - [Int] getAddressSlot
    - [Int] getBooleanSlot
    - [Int] getBytes32Slot
    - [Int] getUint256Slot

 +  ERC1967Upgrade 
    - [Int] _getImplementation
    - [Prv] _setImplementation #
    - [Int] _upgradeTo #
    - [Int] _upgradeToAndCall #
    - [Int] _upgradeToAndCallUUPS #
    - [Int] _getAdmin
    - [Prv] _setAdmin #
    - [Int] _changeAdmin #
    - [Int] _getBeacon
    - [Prv] _setBeacon #
    - [Int] _upgradeBeaconToAndCall #

 +  ERC1967Proxy (Proxy, ERC1967Upgrade)
    - [Pub]  ($)
    - [Int] _implementation

 +  TransparentUpgradeableProxy (ERC1967Proxy)
    - [Pub]  ($)
       - modifiers: ERC1967Proxy
    - [Ext] admin #
       - modifiers: ifAdmin
    - [Ext] implementation #
       - modifiers: ifAdmin
    - [Ext] changeAdmin #
       - modifiers: ifAdmin
    - [Ext] upgradeTo #
       - modifiers: ifAdmin
    - [Ext] upgradeToAndCall ($)
       - modifiers: ifAdmin
    - [Int] _admin
    - [Int] _beforeFallback #

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

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

 +  ProxyAdmin (Ownable)
    - [Pub] getProxyImplementation
    - [Pub] getProxyAdmin
    - [Pub] changeProxyAdmin #
       - modifiers: onlyOwner
    - [Pub] upgrade #
       - modifiers: onlyOwner
    - [Pub] upgradeAndCall ($)
       - modifiers: onlyOwner

 + [Lib] AddressUpgradeable 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Int] verifyCallResult

 +  Initializable 
    - [Int] _disableInitializers #

 +  ContextUpgradeable (Initializable)
    - [Int] __Context_init #
       - modifiers: onlyInitializing
    - [Int] __Context_init_unchained #
       - modifiers: onlyInitializing
    - [Int] _msgSender
    - [Int] _msgData

 +  OwnableUpgradeable (Initializable, ContextUpgradeable)
    - [Int] __Ownable_init #
       - modifiers: onlyInitializing
    - [Int] __Ownable_init_unchained #
       - modifiers: onlyInitializing
    - [Pub] owner
    - [Int] _checkOwner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Int] _transferOwnership #

 + [Lib] SafeMath 
    - [Int] tryAdd
    - [Int] trySub
    - [Int] tryMul
    - [Int] tryDiv
    - [Int] tryMod
    - [Int] add
    - [Int] sub
    - [Int] mul
    - [Int] div
    - [Int] mod
    - [Int] sub
    - [Int] div
    - [Int] mod

 +  ReentrancyGuardUpgradeable (Initializable)
    - [Int] __ReentrancyGuard_init #
       - modifiers: onlyInitializing
    - [Int] __ReentrancyGuard_init_unchained #
       - modifiers: onlyInitializing

 + [Lib] SafeMathUpgradeable 
    - [Int] tryAdd
    - [Int] trySub
    - [Int] tryMul
    - [Int] tryDiv
    - [Int] tryMod
    - [Int] add
    - [Int] sub
    - [Int] mul
    - [Int] div
    - [Int] mod
    - [Int] sub
    - [Int] div
    - [Int] mod

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

 + [Int] IUniswapV2Factory 
    - [Ext] feeTo
    - [Ext] feeToSetter
    - [Ext] getPair
    - [Ext] allPairs
    - [Ext] allPairsLength
    - [Ext] createPair #
    - [Ext] setFeeTo #
    - [Ext] setFeeToSetter #

 + [Int] ITokenLocker 
    - [Ext] lockTokens ($)
    - [Ext] transferLockerOwnerShip #

 +  Launchpad (OwnableUpgradeable, ReentrancyGuardUpgradeable)
    - [Ext]  ($)
    - [Pub]  #
    - [Pub] initialize #
       - modifiers: initializer
    - [Pub] participateToSale ($)
       - modifiers: nonReentrant
    - [Pub] claimBnb ($)
       - modifiers: nonReentrant
    - [Int] sendBnb #
    - [Pub] claimTokens #
       - modifiers: nonReentrant
    - [Int] sendTokens #
    - [Pub] claimVesting #
       - modifiers: nonReentrant
    - [Pub] cancelPool #
    - [Pub] syncPool #
    - [Ext] finalizePool #
       - modifiers: nonReentrant
    - [Int] addLiquidity #
    - [Int] addLpAndBurn #
    - [Pub] withdrawBnb #
       - modifiers: onlyOwner
    - [Pub] whiteListUsers #
    - [Pub] getWhiteListedUsers
    - [Pub] withdrawBep20Tokens #
       - modifiers: onlyOwner
    - [Pub] distributeTokens #
    - [Pub] distributeBnb #
    - [Pub] changeLockerAddress #
       - modifiers: onlyOwner
    - [Ext] setPoolOwner #
       - modifiers: onlyOwner

 +  deployer (OwnableUpgradeable)
    - [Pub]  #
    - [Pub] initialize #
       - modifiers: initializer
    - [Ext]  ($)
    - [Pub] createNewPool ($)
    - [Ext] withdrawBnb #
       - modifiers: onlyOwner
    - [Pub] withdrawBep20Tokens #
       - modifiers: onlyOwner
    - [Pub] changeFeeAmount #
       - modifiers: onlyOwner
    - [Pub] changeFeePercentages #
       - modifiers: onlyOwner
    - [Ext] changeLockerAddress #
       - modifiers: onlyOwner
    - [Ext] whiteListRouters #
       - modifiers: onlyOwner
    - [Ext] removeRouters #
       - modifiers: onlyOwner

deployer and Launchpad Contracts

Smart Contract Audit - Inheritance

Smart Contract Audit - Graph


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

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

 +  Proxy 
    - [Int] _delegate #
    - [Int] _implementation
    - [Int] _fallback #
    - [Ext]  ($)
    - [Ext]  ($)
    - [Int] _beforeFallback #

 + [Int] IBeacon 
    - [Ext] implementation

 + [Int] IERC1822Proxiable 
    - [Ext] proxiableUUID

 + [Lib] Address 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Int] functionDelegateCall #
    - [Int] functionDelegateCall #
    - [Int] verifyCallResult

 + [Lib] StorageSlot 
    - [Int] getAddressSlot
    - [Int] getBooleanSlot
    - [Int] getBytes32Slot
    - [Int] getUint256Slot

 +  ERC1967Upgrade 
    - [Int] _getImplementation
    - [Prv] _setImplementation #
    - [Int] _upgradeTo #
    - [Int] _upgradeToAndCall #
    - [Int] _upgradeToAndCallUUPS #
    - [Int] _getAdmin
    - [Prv] _setAdmin #
    - [Int] _changeAdmin #
    - [Int] _getBeacon
    - [Prv] _setBeacon #
    - [Int] _upgradeBeaconToAndCall #

 +  ERC1967Proxy (Proxy, ERC1967Upgrade)
    - [Pub]  ($)
    - [Int] _implementation

 +  TransparentUpgradeableProxy (ERC1967Proxy)
    - [Pub]  ($)
       - modifiers: ERC1967Proxy
    - [Ext] admin #
       - modifiers: ifAdmin
    - [Ext] implementation #
       - modifiers: ifAdmin
    - [Ext] changeAdmin #
       - modifiers: ifAdmin
    - [Ext] upgradeTo #
       - modifiers: ifAdmin
    - [Ext] upgradeToAndCall ($)
       - modifiers: ifAdmin
    - [Int] _admin
    - [Int] _beforeFallback #

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

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

 +  ProxyAdmin (Ownable)
    - [Pub] getProxyImplementation
    - [Pub] getProxyAdmin
    - [Pub] changeProxyAdmin #
       - modifiers: onlyOwner
    - [Pub] upgrade #
       - modifiers: onlyOwner
    - [Pub] upgradeAndCall ($)
       - modifiers: onlyOwner

 + [Lib] AddressUpgradeable 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Int] verifyCallResult

 +  Initializable 
    - [Int] _disableInitializers #

 +  ContextUpgradeable (Initializable)
    - [Int] __Context_init #
       - modifiers: onlyInitializing
    - [Int] __Context_init_unchained #
       - modifiers: onlyInitializing
    - [Int] _msgSender
    - [Int] _msgData

 +  OwnableUpgradeable (Initializable, ContextUpgradeable)
    - [Int] __Ownable_init #
       - modifiers: onlyInitializing
    - [Int] __Ownable_init_unchained #
       - modifiers: onlyInitializing
    - [Pub] owner
    - [Int] _checkOwner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Int] _transferOwnership #

 + [Lib] SafeMath 
    - [Int] tryAdd
    - [Int] trySub
    - [Int] tryMul
    - [Int] tryDiv
    - [Int] tryMod
    - [Int] add
    - [Int] sub
    - [Int] mul
    - [Int] div
    - [Int] mod
    - [Int] sub
    - [Int] div
    - [Int] mod

 +  ReentrancyGuard 
    - [Pub]  #

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

 + [Int] IUniswapV2Factory 
    - [Ext] feeTo
    - [Ext] feeToSetter
    - [Ext] getPair
    - [Ext] allPairs
    - [Ext] allPairsLength
    - [Ext] createPair #
    - [Ext] setFeeTo #
    - [Ext] setFeeToSetter #

 + [Int] ITokenLocker 
    - [Ext] lockTokens ($)
    - [Ext] transferLockerOwnerShip #

 +  Launchpad (Ownable, ReentrancyGuard)
    - [Ext]  ($)
    - [Pub]  #
    - [Pub] participateToSale #
       - modifiers: nonReentrant
    - [Pub] exitPresale #
       - modifiers: nonReentrant
    - [Int] sendBnb #
    - [Pub] claimTokens #
       - modifiers: nonReentrant
    - [Int] sendTokens #
    - [Pub] claimVesting #
       - modifiers: nonReentrant
    - [Pub] cancelPool #
    - [Pub] syncPool #
    - [Ext] finalizePool #
       - modifiers: nonReentrant
    - [Int] addLiquidity #
    - [Int] addLpAndBurn #
    - [Pub] withdrawBnb #
       - modifiers: onlyOwner
    - [Pub] whiteListUsers #
    - [Pub] getWhiteListedUsers
    - [Pub] withdrawBep20Tokens #
       - modifiers: onlyOwner
    - [Pub] distributeTokens #
    - [Pub] distributeBnb #
    - [Ext] setPoolOwner #
       - modifiers: onlyOwner

 +  deployer (OwnableUpgradeable)
    - [Pub]  #
    - [Pub] initialize #
       - modifiers: initializer
    - [Ext]  ($)
    - [Pub] createNewPool ($)
    - [Ext] withdrawBnb #
       - modifiers: onlyOwner
    - [Pub] withdrawBep20Tokens #
       - modifiers: onlyOwner
    - [Pub] changeFeeAmount #
       - modifiers: onlyOwner
    - [Pub] changeFeePercentages #
       - modifiers: onlyOwner
    - [Ext] changeLockerAddress #
       - modifiers: onlyOwner
    - [Ext] whiteListRouters #
       - modifiers: onlyOwner
    - [Ext] removeRouters #
       - modifiers: onlyOwner
    - [Ext] whiteListTokens #
       - modifiers: onlyOwner

KingStaking and Staking Contracts

Smart Contract Audit - Inheritance

Smart Contract Audit - Graph


 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public
 
 +  Proxy 
    - [Int] _delegate #
    - [Int] _implementation
    - [Int] _fallback #
    - [Ext]  ($)
    - [Ext]  ($)
    - [Int] _beforeFallback #

 + [Int] IBeacon 
    - [Ext] implementation

 + [Int] IERC1822Proxiable 
    - [Ext] proxiableUUID

 + [Lib] Address 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Int] functionDelegateCall #
    - [Int] functionDelegateCall #
    - [Int] verifyCallResult

 + [Lib] StorageSlot 
    - [Int] getAddressSlot
    - [Int] getBooleanSlot
    - [Int] getBytes32Slot
    - [Int] getUint256Slot

 +  ERC1967Upgrade 
    - [Int] _getImplementation
    - [Prv] _setImplementation #
    - [Int] _upgradeTo #
    - [Int] _upgradeToAndCall #
    - [Int] _upgradeToAndCallUUPS #
    - [Int] _getAdmin
    - [Prv] _setAdmin #
    - [Int] _changeAdmin #
    - [Int] _getBeacon
    - [Prv] _setBeacon #
    - [Int] _upgradeBeaconToAndCall #

 +  ERC1967Proxy (Proxy, ERC1967Upgrade)
    - [Pub]  ($)
    - [Int] _implementation

 +  TransparentUpgradeableProxy (ERC1967Proxy)
    - [Pub]  ($)
       - modifiers: ERC1967Proxy
    - [Ext] admin #
       - modifiers: ifAdmin
    - [Ext] implementation #
       - modifiers: ifAdmin
    - [Ext] changeAdmin #
       - modifiers: ifAdmin
    - [Ext] upgradeTo #
       - modifiers: ifAdmin
    - [Ext] upgradeToAndCall ($)
       - modifiers: ifAdmin
    - [Int] _admin
    - [Int] _beforeFallback #

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

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

 +  ProxyAdmin (Ownable)
    - [Pub] getProxyImplementation
    - [Pub] getProxyAdmin
    - [Pub] changeProxyAdmin #
       - modifiers: onlyOwner
    - [Pub] upgrade #
       - modifiers: onlyOwner
    - [Pub] upgradeAndCall ($)
       - modifiers: onlyOwner

 + [Lib] AddressUpgradeable 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Int] verifyCallResult

 +  Initializable 
    - [Int] _disableInitializers #

 +  ContextUpgradeable (Initializable)
    - [Int] __Context_init #
       - modifiers: onlyInitializing
    - [Int] __Context_init_unchained #
       - modifiers: onlyInitializing
    - [Int] _msgSender
    - [Int] _msgData

 +  OwnableUpgradeable (Initializable, ContextUpgradeable)
    - [Int] __Ownable_init #
       - modifiers: onlyInitializing
    - [Int] __Ownable_init_unchained #
       - modifiers: onlyInitializing
    - [Pub] owner
    - [Int] _checkOwner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Int] _transferOwnership #

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

 + [Lib] SafeMath 
    - [Int] tryAdd
    - [Int] trySub
    - [Int] tryMul
    - [Int] tryDiv
    - [Int] tryMod
    - [Int] add
    - [Int] sub
    - [Int] mul
    - [Int] div
    - [Int] mod
    - [Int] sub
    - [Int] div
    - [Int] mod

 +  ReentrancyGuard 
    - [Pub]  #

 +  Staking (Ownable, ReentrancyGuard)
    - [Pub]  #
    - [Ext] deposit #
       - modifiers: nonReentrant
    - [Ext] withdraw #
       - modifiers: nonReentrant
    - [Ext] emergencyWithdraw #
       - modifiers: nonReentrant
    - [Ext] emergencyRewardWithdraw #
       - modifiers: onlyOwner
    - [Ext] recoverWrongTokens #
       - modifiers: onlyOwner
    - [Ext] stopReward #
       - modifiers: onlyOwner
    - [Ext] updatePoolLimitPerUser #
       - modifiers: onlyOwner
    - [Ext] updateRewardPerBlock #
       - modifiers: onlyOwner
    - [Ext] updateStartAndEndBlocks #
       - modifiers: onlyOwner
    - [Ext] pendingReward
    - [Int] _updatePool #
    - [Int] _getMultiplier
    - [Ext]  ($)

 +  KingStaking (OwnableUpgradeable)
    - [Pub]  #
    - [Ext]  ($)
    - [Pub] initialize #
       - modifiers: initializer
    - [Ext] deployPool ($)
    - [Ext] changeFeeAmount #
       - modifiers: onlyOwner
    - [Ext] withdrawBnb #
       - modifiers: onlyOwner

KingStaking and Staking Contracts

Smart Contract Audit - Inheritance

Smart Contract Audit - Graph


 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public
 
 +  Proxy 
    - [Int] _delegate #
    - [Int] _implementation
    - [Int] _fallback #
    - [Ext]  ($)
    - [Ext]  ($)
    - [Int] _beforeFallback #

 + [Int] IBeacon 
    - [Ext] implementation

 + [Int] IERC1822Proxiable 
    - [Ext] proxiableUUID

 + [Lib] Address 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Int] functionDelegateCall #
    - [Int] functionDelegateCall #
    - [Int] verifyCallResult

 + [Lib] StorageSlot 
    - [Int] getAddressSlot
    - [Int] getBooleanSlot
    - [Int] getBytes32Slot
    - [Int] getUint256Slot

 +  ERC1967Upgrade 
    - [Int] _getImplementation
    - [Prv] _setImplementation #
    - [Int] _upgradeTo #
    - [Int] _upgradeToAndCall #
    - [Int] _upgradeToAndCallUUPS #
    - [Int] _getAdmin
    - [Prv] _setAdmin #
    - [Int] _changeAdmin #
    - [Int] _getBeacon
    - [Prv] _setBeacon #
    - [Int] _upgradeBeaconToAndCall #

 +  ERC1967Proxy (Proxy, ERC1967Upgrade)
    - [Pub]  ($)
    - [Int] _implementation

 +  TransparentUpgradeableProxy (ERC1967Proxy)
    - [Pub]  ($)
       - modifiers: ERC1967Proxy
    - [Ext] admin #
       - modifiers: ifAdmin
    - [Ext] implementation #
       - modifiers: ifAdmin
    - [Ext] changeAdmin #
       - modifiers: ifAdmin
    - [Ext] upgradeTo #
       - modifiers: ifAdmin
    - [Ext] upgradeToAndCall ($)
       - modifiers: ifAdmin
    - [Int] _admin
    - [Int] _beforeFallback #

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

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

 +  ProxyAdmin (Ownable)
    - [Pub] getProxyImplementation
    - [Pub] getProxyAdmin
    - [Pub] changeProxyAdmin #
       - modifiers: onlyOwner
    - [Pub] upgrade #
       - modifiers: onlyOwner
    - [Pub] upgradeAndCall ($)
       - modifiers: onlyOwner

 + [Lib] AddressUpgradeable 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Int] verifyCallResult

 +  Initializable 
    - [Int] _disableInitializers #

 +  ContextUpgradeable (Initializable)
    - [Int] __Context_init #
       - modifiers: onlyInitializing
    - [Int] __Context_init_unchained #
       - modifiers: onlyInitializing
    - [Int] _msgSender
    - [Int] _msgData

 +  OwnableUpgradeable (Initializable, ContextUpgradeable)
    - [Int] __Ownable_init #
       - modifiers: onlyInitializing
    - [Int] __Ownable_init_unchained #
       - modifiers: onlyInitializing
    - [Pub] owner
    - [Int] _checkOwner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Int] _transferOwnership #

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

 + [Lib] SafeMath 
    - [Int] tryAdd
    - [Int] trySub
    - [Int] tryMul
    - [Int] tryDiv
    - [Int] tryMod
    - [Int] add
    - [Int] sub
    - [Int] mul
    - [Int] div
    - [Int] mod
    - [Int] sub
    - [Int] div
    - [Int] mod

 +  ReentrancyGuard 
    - [Pub]  #

 +  Staking (Ownable, ReentrancyGuard, Initializable)
    - [Pub]  #
    - [Pub] initialize #
       - modifiers: initializer
    - [Ext] deposit #
       - modifiers: nonReentrant
    - [Ext] withdraw #
       - modifiers: nonReentrant
    - [Ext] emergencyWithdraw #
       - modifiers: nonReentrant
    - [Ext] emergencyRewardWithdraw #
       - modifiers: onlyOwner
    - [Ext] recoverWrongTokens #
       - modifiers: onlyOwner
    - [Ext] stopReward #
       - modifiers: onlyOwner
    - [Ext] updatePoolLimitPerUser #
       - modifiers: onlyOwner
    - [Ext] updateRewardPerBlock #
       - modifiers: onlyOwner
    - [Ext] updateStartAndEndBlocks #
       - modifiers: onlyOwner
    - [Ext] pendingReward
    - [Int] _updatePool #
    - [Int] _getMultiplier
    - [Ext]  ($)

 +  KingStaking (OwnableUpgradeable)
    - [Pub]  #
    - [Ext]  ($)
    - [Pub] initialize #
       - modifiers: initializer
    - [Ext] deployPool ($)
    - [Ext] changeFeeAmount #
       - modifiers: onlyOwner
    - [Ext] withdrawBnb #
       - modifiers: onlyOwner

TokensLocker Contract

Smart Contract Audit - Inheritance

Smart Contract Audit - Graph


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

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

 +  Proxy 
    - [Int] _delegate #
    - [Int] _implementation
    - [Int] _fallback #
    - [Ext]  ($)
    - [Ext]  ($)
    - [Int] _beforeFallback #

 + [Int] IBeacon 
    - [Ext] implementation

 + [Int] IERC1822Proxiable 
    - [Ext] proxiableUUID

 + [Lib] Address 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Int] functionDelegateCall #
    - [Int] functionDelegateCall #
    - [Int] verifyCallResult

 + [Lib] StorageSlot 
    - [Int] getAddressSlot
    - [Int] getBooleanSlot
    - [Int] getBytes32Slot
    - [Int] getUint256Slot

 +  ERC1967Upgrade 
    - [Int] _getImplementation
    - [Prv] _setImplementation #
    - [Int] _upgradeTo #
    - [Int] _upgradeToAndCall #
    - [Int] _upgradeToAndCallUUPS #
    - [Int] _getAdmin
    - [Prv] _setAdmin #
    - [Int] _changeAdmin #
    - [Int] _getBeacon
    - [Prv] _setBeacon #
    - [Int] _upgradeBeaconToAndCall #

 +  ERC1967Proxy (Proxy, ERC1967Upgrade)
    - [Pub]  ($)
    - [Int] _implementation

 +  TransparentUpgradeableProxy (ERC1967Proxy)
    - [Pub]  ($)
       - modifiers: ERC1967Proxy
    - [Ext] admin #
       - modifiers: ifAdmin
    - [Ext] implementation #
       - modifiers: ifAdmin
    - [Ext] changeAdmin #
       - modifiers: ifAdmin
    - [Ext] upgradeTo #
       - modifiers: ifAdmin
    - [Ext] upgradeToAndCall ($)
       - modifiers: ifAdmin
    - [Int] _admin
    - [Int] _beforeFallback #

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

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

 +  ProxyAdmin (Ownable)
    - [Pub] getProxyImplementation
    - [Pub] getProxyAdmin
    - [Pub] changeProxyAdmin #
       - modifiers: onlyOwner
    - [Pub] upgrade #
       - modifiers: onlyOwner
    - [Pub] upgradeAndCall ($)
       - modifiers: onlyOwner

 + [Lib] AddressUpgradeable 
    - [Int] isContract
    - [Int] sendValue #
    - [Int] functionCall #
    - [Int] functionCall #
    - [Int] functionCallWithValue #
    - [Int] functionCallWithValue #
    - [Int] functionStaticCall
    - [Int] functionStaticCall
    - [Int] verifyCallResult

 +  Initializable 
    - [Int] _disableInitializers #

 +  ContextUpgradeable (Initializable)
    - [Int] __Context_init #
       - modifiers: onlyInitializing
    - [Int] __Context_init_unchained #
       - modifiers: onlyInitializing
    - [Int] _msgSender
    - [Int] _msgData

 +  OwnableUpgradeable (Initializable, ContextUpgradeable)
    - [Int] __Ownable_init #
       - modifiers: onlyInitializing
    - [Int] __Ownable_init_unchained #
       - modifiers: onlyInitializing
    - [Pub] owner
    - [Int] _checkOwner
    - [Pub] renounceOwnership #
       - modifiers: onlyOwner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Int] _transferOwnership #

 + [Lib] SafeMath 
    - [Int] tryAdd
    - [Int] trySub
    - [Int] tryMul
    - [Int] tryDiv
    - [Int] tryMod
    - [Int] add
    - [Int] sub
    - [Int] mul
    - [Int] div
    - [Int] mod
    - [Int] sub
    - [Int] div
    - [Int] mod

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

 + [Int] IUniswapV2Factory 
    - [Ext] feeTo
    - [Ext] feeToSetter
    - [Ext] getPair
    - [Ext] allPairs
    - [Ext] allPairsLength
    - [Ext] createPair #
    - [Ext] setFeeTo #
    - [Ext] setFeeToSetter #

 + [Lib] CountersUpgradeable 
    - [Int] current
    - [Int] increment #
    - [Int] decrement #
    - [Int] reset #

 +  ReentrancyGuardUpgradeable (Initializable)
    - [Int] __ReentrancyGuard_init #
       - modifiers: onlyInitializing
    - [Int] __ReentrancyGuard_init_unchained #
       - modifiers: onlyInitializing

 +  TokensLocker (OwnableUpgradeable, ReentrancyGuardUpgradeable)
    - [Pub] initialize #
       - modifiers: initializer
    - [Ext]  ($)
    - [Ext] lockTokens ($)
       - modifiers: nonReentrant
    - [Prv] _isValidLpToken
    - [Int] _parseFactoryAddress
    - [Ext] transferLockerOwnerShip #
    - [Pub] extendLockerExpireTime #
    - [Pub] unlockTokens #
    - [Pub] getMyLockers
    - [Pub] isVesting
    - [Pub] lockAndVesting ($)
       - modifiers: nonReentrant
    - [Pub] unlockVesting #
       - modifiers: nonReentrant
    - [Pub] withdrawBnb #
       - modifiers: onlyOwner
    - [Pub] withdrawBep20Tokens #
       - modifiers: onlyOwner
    - [Ext] setFeesExcluded #
       - modifiers: onlyOwner
    - [Ext] changeFees #
       - modifiers: onlyOwner

About SourceHat

SourceHat has quickly grown to have one of the most experienced and well-equipped smart contract auditing teams in the industry. Our team has conducted 1800+ solidity smart contract audits covering all major project types and protocols, securing a total of over $50 billion U.S. dollars in on-chain value!
Our firm is well-reputed in the community and is trusted as a top smart contract auditing company for the review of solidity code, no matter how complex. Our team of experienced solidity smart contract auditors performs audits for tokens, NFTs, crowdsales, marketplaces, gambling games, financial protocols, and more!

Contact us today to get a free quote for a smart contract audit of your project!

What is a SourceHat Audit?

Typically, a smart contract audit is a comprehensive review process designed to discover logical errors, security vulnerabilities, and optimization opportunities within code. A SourceHat Audit takes this a step further by verifying economic logic to ensure the stability of smart contracts and highlighting privileged functionality to create a report that is easy to understand for developers and community members alike.

How Do I Interpret the Findings?

Each of our Findings will be labeled with a Severity level. We always recommend the team resolve High, Medium, and Low severity findings prior to deploying the code to the mainnet. Here is a breakdown on what each Severity level means for the project:

  • High severity indicates that the issue puts a large number of users' funds at risk and has a high probability of exploitation, or the smart contract contains serious logical issues which can prevent the code from operating as intended.
  • Medium severity issues are those which place at least some users' funds at risk and has a medium to high probability of exploitation.
  • Low severity issues have a relatively minor risk association; these issues have a low probability of occurring or may have a minimal impact.
  • Informational issues pose no immediate risk, but inform the project team of opportunities for gas optimizations and following smart contract security best practices.