Liquid Protocol ($LP) - Audit

CertiK1 address on Ethereum

CertiK reviewed Liquid Protocol (Liquid Protocol ($LP) - Audit) on 11 Oct 2023: 15 findings, 0 critical; 6 marked fixed, 9 open.

No open critical findings
Open the reportOpen Liquid Protocol’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings15

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

SeverityOpenAcknowledgedFixed
Critical000
High102
Medium002
Low802
HighInitial Token DistributionOpen

All of the `1e6 * 10**9` tokens are sent to the contract deployer or one or several externally-owned account (EOA) addresses. This is a centralization risk because the deployer or the owner(s) of the EOAs can distribute tokens without obtaining the consensus of the community. Any compromise to these addresses may allow a hacker to steal and sell tokens on the market, resulting in severe damage to the project.

LowDivide Before MultiplyOpen

Performing integer division before multiplication truncates the low bits, losing the precision of calculation. ```solidity=563 uint256 unitBalance= deltaBalance / (denominator - temp.liquidity); ``` ```solidity=564 uint256 bnbToAddLiquidityWith = unitBalance * temp.liquidity; ```

LowPotential non-emit Event TransferOpen

In the function `_tokenTransfer()`, when the `rLiquidity` or `tLiquidity` is greater than 0, the event `Transfer` is emitted with a value equal to the sum of `tLiquidity`, `tMarketing` and `tDonation`. Consequently, if the `rLiquidity` and `tLiquidity` both equal 0, the event cannot be emitted, even if `rMarketing`, `tMarketing`, `rDonation`, and `tDonation` are greater than 0.

LowPotential Sandwich AttacksOpen

A sandwich attack might 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 frontrunning (before the transaction being attacked) a transaction to purchase one of the assets and make profits by backrunning (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: - router.swapExactTokensForETHSupportingFeeOnTransferTokens - router.addLiquidityETH

LowState Variable Should Be Declared ConstantOpen

State variables that never change should be declared as `constant` to save gas. ```solidity=153 uint256 private _tTotal = 1e6 * 10**_decimals; ``` - `_tTotal` should be declared `constant`.

LowThird-Party Dependency UsageOpen

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 assumes 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=147 IRouter public router; ``` - The contract `liquidprotocol` interacts with third party contract with `IRouter` interface via `router`.

LowUnchecked Value of ERC-20 `transfer()`/`transferFOpen

The linked `transfer()`/`transferFrom()` invocations do not check the return value of the function call which should yield a `true` result in case of proper ERC-20 implementation.

LowUnused Return ValueOpen

The smart contract does not check or store the return value of an external call in a local or state variable, which may introduce vulnerabilities due to the unhandled outcome. ```solidity=586 router.addLiquidityETH{value: bnbAmount}( address(this), tokenAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable owner(), block.timestamp ); ```

LowUsage of `transfer`/`send` for Sending Native TokOpen

It is not recommended to use Solidity's `transfer()` and `send()` functions for transferring native tokens, since some contracts may not be able to receive the funds. Those functions forward only a fixed amount of gas (2300 specifically) and the receiving contracts may run out of gas before finishing the transfer. Also, EVM instructions' gas costs may increase in the future. Thus, some contracts that can receive now may stop working in the future due to the gas limitation. ```solidity=681 payable(msg.sender).transfer(weiAmount); ``` - `liquidprotocol.rescueBNB` uses `transfer()`.

Contracts in scope1

AddressChainSource code
0x3e8203e0b1d56984abc66f183a8d0b1a09a7e607Chain: EthereumSource code: Verified source

Part of Liquid Protocol’s security record

Liquid Protocol
Audits1 audit by 1 firmLast audit Oct 2023, by CertiK.
Critical findingsNo open critical findingsIn 1 report.
Open Liquid Protocol’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