King Addendum

CertiKFiles named in the report

CertiK reviewed King Finance (King Addendum) on 8 Feb 2023: 12 findings, 0 critical; all acknowledged, none fixed.

No open critical findings
Open the reportOpen King Finance’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings12

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High020
Medium010
Low090
HighCentralization Risks in King.solAcknowledged

In the contract `King` the role `_owner` has authority over the functions shown in the diagram below. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority. ![](https://accelerator-tasks-prod.acc.corp.certik.com/af0485e88af34bdbabd52df6fea5cbbc/diagrams/centralization_King-King-_owner.svg) In the contract `King` the role `kingPassContract` has authority over the functions shown in the diagram below. Any compromise to the `kingPassContract` account may allow the hacker to take advantage of this authority and lock tokens to activate the KingPass contract. ![](https://accelerator-tasks-prod.acc.corp.certik.com/af0485e88af34bdbabd52df6fea5cbbc/diagrams/centralization_King-King-kingPassContract.svg)

HighInitial Token DistributionAcknowledged

`100_000_000 * 10 ** 9` tokens were sent to the `owner()` when deploying the contract. This could be a centralization risk as the deployer can distribute tokens without obtaining the consensus of the community.

MediumUsage of `tx.origin`Acknowledged

Contracts that authorize users using the `tx.origin` variable are typically vulnerable to phishing attacks which can trick users into performing authenticated actions on the vulnerable contract. There are multiple reasons why using `tx.origin` is not safe from the security perspective. Refer to : * [Solidity Documentation on `tx.origin`](https://docs.soliditylang.org/en/latest/security-considerations.html#tx-origin) * <https://github.com/ethereum/solidity/issues/683> ```solidity=453 require(userLastTradeData[tx.origin].lastBuyTime + 3 <= block.timestamp,"You cannot do multi-buy orders."); ```

LowDivide Before MultiplyAcknowledged

Performing integer division before multiplication truncates the low bits, losing the precision of calculation. ```solidity=514 txFees = amount * (totalBuyFee * kingPassFeeDiscount / 1000) / 1000; ``` --- ```solidity=524 txFees = amount * (totalSellFee * kingPassFeeDiscount / 1000) / 1000; ```

LowHardcode AddressAcknowledged

There are many hardcode addresses in this codebase.

LowLack of Reasonable BoundaryAcknowledged

The variables `minimumWeiForTokenomics` do not have reasonable boundaries, so the owner can be given arbitrary values after deploying.

LowMissing Zero Address ValidationAcknowledged

Addresses should be checked before assignment or external call to make sure they are not zero addresses. ```solidity=209 pancakeV2Pair = _pair; ``` - `_pair` is not zero-checked before being used. --- ```solidity=287 marketingAddress = marketing; ``` - `marketing` is not zero-checked before being used. --- ```solidity=288 devAddress = dev; ``` - `dev` is not zero-checked before being used. --- ```solidity=289 buybackAddress = buyback; ``` - `buyback` is not zero-checked before being used.

LowPotential Sandwich AttacksAcknowledged

A sandwich attack may happen when an attacker observes a transaction swapping tokens or adding liquidity without setting restrictions on slippage or minimum output amount. The attacker can manipulate the exchange rate by front running (before the transaction being attacked) a transaction to purchase one of the assets and make profits by back running (after the transaction being attacked) a transaction to sell the asset. The following functions are called without setting restrictions on slippage or minimum output amount, so transactions triggering these functions are vulnerable to sandwich attacks, especially when the input amount is large: - `swapExactTokensForETHSupportingFeeOnTransferTokens()`

Lowthe new `marketingAddress`, `devAddress` and `buyAcknowledged

In `constructor()`, the `marketingAddress`, `devAddress`, and `buybackAddress` are excluded from fees, but in the function `setFeesAddress()`, the new `marketingAddress`, `devAddress`, and `buybackAddress` are not excluded from fees and the old ones are not included in fees.

Lowthe new `pancakeV2Pair` has not been added to `auAcknowledged

In `constructor()`, the `pancakeV2Pair` is added to `automatedMarketMakerPairs`, but in the function `updatePancakeV2Router()`, the new `pancakeV2Pair` is not added to the `automatedMarketMakerPairs` and the old one is not removed from the `automatedMarketMakerPairs`.

Show 2 more
LowThird Party DependencyAcknowledged

The contract is serving as the underlying entity to interact with one or more third party protocols. The scope of the audit treats third party entities as black boxes and assume their functional correctness. However, in the real world, third parties can be compromised and this may lead to lost or stolen assets. In addition, upgrades of third parties can possibly create severe impacts, such as increasing fees of third parties, migrating to new LP pools, etc. ```solidity=65 IPancakeV2Router02 public pancakeV2Router; ``` - The contract `King` interacts with third party contract with `IPancakeV2Router02` interface via `pancakeV2Router`. --- ```solidity=87 address public kingPassContract; ``` - The contract `King` interacts with third party contract with `IKingPass` interface via `kingPassContract`.

LowVested user can not buy from pairAcknowledged

It appears from the comment on line 435 that vested users can only buy, not transfer or sell. However, the `trade_type` is always 0, and line 439 always checks that the user is a vested user. This means that once `from` is a vested user, they cannot buy from the pair.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (1)

  • contracts/King.sol

Part of King Finance’s security record

King Finance
Audits2 audits by 2 firmsLast audit Feb 2025, by Cyberscope.
Critical findingsNo open critical findingsAcross 2 reports.
Open King Finance’s security record

Security firm

CertiK

1,044 projects reviewed · 1,375 reports · latest May 2025

See CertiK’s audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us