Old SquidGrow Token Contract

CertiK2 addresses on Ethereum and BNB Chain

Audit

Part of CertiK’s series

CertiK reviewed SquidGrow (Old SquidGrow Token Contract) on 27 Oct 2023: 23 findings, 0 critical; none marked fixed.

No open critical findings
Open the reportOpen SquidGrow’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings23

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

SeverityOpenAcknowledgedFixed
Critical000
High300
Medium100
Low1900
HighCentralization Risks in `SquidGrow.sol`Open

In the contract `SquidGrow` the role `authorized` has authority over the following functions: - authorize() - unauthorize() - transferOwnership() - renounceOwnership() - setFeeExempt() - setisBot() - setisInternal() - setbotOn() - syncContractPair() - approvals() - setPairReceiver() - setstartSwap() - setSwapBackSettings() - setMaxes() - rescueBEP20() - setExemptAddress() - setDivisors() - setStructure() - setInternalAddresses() Any compromise to the `authorized` account may allow the hacker to take advantage of this authority and - remove all funds (BNB, LP tokens, SquidGrow, etc) from the contract through functions `approvals()`, `rescueBEP20()`, and `syncContractPair()`; - set the `liquidity_receiver` to an address they control through `setPairReceiver()`; - authorize multiple addresses they control, set unintended internal addresses, and exempt addresses; - set their controlled address to be exempt from fees while exchanging large amounts of the token; - set addresses which are not bots to `isBot` status, causing addresses to be subject to larger fees; - set addresses they control to `isInternal` status so they can exceed the `maxWallet` value; - update the divisors, fees, maxes, and threshold value to the disadvantage of the user;

HighCentralized Risk in `addLiquidity`Open

The `addLiquidity()` function calls the `router.addLiquidityETH` function with the `to` address specified as `liquidity_receiver` for acquiring the generated LP tokens from the `SquidGrow-BNB` pool. As a result, over time the `liquidity_reciever` address will accumulate a significant portion of LP tokens. If the `liquidity_receiver` is an EOA (Externally Owned Account), mishandling of its private key can have devastating consequences to the project as a whole. ```solidity router.addLiquidityETH{value: BNBAmount}( address(this), tokenAmount, 0, 0, liquidity_receiver, block.timestamp ); ```

HighInitial Token DistributionOpen

All `SquidGrow` is sent to the `owner` address when deploying the contract. This could be a centralization risk as the `owner` can distribute tokens without obtaining the consensus of the community.

Mediumtransfer may still be taxable when `swapping` isOpen

When `swapAndLiquify()` is called, `swapping` is set to true. The transaction will include a secondary call to function `transfer()`. Even though `swapping` is true, function `taxableEvent()` still allows for the possibility of taxes to be taken in the secondary transfer.

Low`amountReceived` may be ZeroOpen

Function `_transfer()` disallows an input `amount` to be zero. However, fees collected could be 100% of the `amount` value. In that case, `amountReceived` will be 0, and a user will have paid for a transaction in which the `recipient` gets nothing.

Low`isDistributor` status cannot be revokedOpen

Once an account gains `isDistributor` status, it cannot be revoked.

Low`owner` is Unused in `SquidGrow`Open

Contract `SquidGrow` inherits abstract contract `Auth`. This contract specifies both an `owner` and uses a mapping `authorizations` to track privileged accounts. State variable `owner` and modifier `onlyOwner` are unused within the contract. As such, the cited functions and state variables are unneeded.

LowDivide Before MultiplyOpen

Performing integer division before multiplication truncates the low bits, losing the precision of calculation. ```solidity=278 uint256 feeAmount = amount.mul(getTotalFee(sender, recipient)).div(feeDenominator); ``` ```solidity=279 uint256 bAmount = feeAmount.mul(burnFee).div(totalFees); ``` --- ```solidity=355 uint256 acBNBa = acBNB.mul(_na).div(_da); ``` ```solidity=356 uint256 acBNBf = acBNBa.mul(25).div(100); ``` --- ```solidity=405 uint256 unitBalance= deltaBalance.div(denominator.sub(liquidity_divisor)); ``` ```solidity=406 uint256 BNBToAddLiquidityWith = unitBalance.mul(liquidity_divisor); ```

LowERC20 Approval Race ConditionOpen

The approval function of the ERC20 standard possesses a well-known vulnerability whereby two consecutive approvals can be exploited to instead “reset” the approval by consuming the approval that is meant to be replaced with a new one.

LowFunction `setstartSwap()` can be called more thanOpen

Function `setstartSwap()` can be updated more than once, which updates the `startedTime` to `block.timestamp.add(_input)`. If this function is called after `startedTime` has passed the first time, then any user making a transfer in the same block as the update may be subject to the 99% transfer fee.

Show 10 more
LowInaccurate Formula for `getCirculatingSupply()`Open

Function `getCirculatingSupply()` has the following formula: ```solidity return _totalSupply.sub(balanceOf(DEAD)).sub(balanceOf(address(0))); ``` The `_totalSupply` already excludes the `balanceOf(address(0))`, and this value should not be subtracted away. Since tokens cannot be transferred to `address(0)` and since there is no burning mechanic which sends tokens tokens to `address(0)`, the inaccurate formula will show the correct value.

LowMeaning of ConditionsOpen

The conditional logic of the cited functions appears to allow for unforeseen fringe cases that may cause issues in the protocol. As set up, it is difficult to determine the meaning behind the checks made in each of the functions. Please clarify what each `if` condition is meant to determine in the functions cited. Additionally some of the logic appears to be counter to its intended use. For instance, function `checkBot()` may set either the `sender` or `recipient` as true in mapping `isBot` if the `msg.sender` is not the `tx.origin`. However, a recipient has no control over who sends tokens to them, and the `msg.sender` is never `tx.origin` when the `sender` is the `pair` address. If the `pair` address is updated to not be internal, then both the `pair` address and the `recipient` are set as bots. The `pair` being set as a bot may produce complications within the contract logic.

LowMiscalculation of Max HoldingOpen

The transaction may be charged fees, so the max holding of the receiver should be the sum of the held tokens and the amount received from the transfer. The fees should not be included in the max holding. ```solidity=259 require((_balances[recipient].add(amount)) <= _maxWalletToken, "Exceeds maximum wallet amount.");} ``` - Max holding is checked. ```solidity=239 uint256 amountReceived = shouldTakeFee(sender, recipient) ? taketotalFee(sender, recipient, amount) : amount; ``` - Receiving amount is adjusted. ```solidity=240 _balances[recipient] = _balances[recipient].add(amountReceived); ``` - Balance is increased by the adjusted amount.

LowMissing Emit EventsOpen

Sensitive functions controlled by privileged roles or which make important updates to the project should emit events.

LowMissing Input ValidationOpen

The following checks should be made for input parameters. ### SquidGrow.sol - Function `setFeeExempt()` is missing a check that `_address` is not labeled as a bot. - Function `setisBot()` is missing a check that the `_address` is not `DEAD`. - Function `setisBot()` is missing a check that the `_address` is not exempt from fees. - Function `setPairReceiver()` is missing a check that `_address` is not `DEAD`. - Function `setDivisors()` is missing a check that the sum of the inputs is nonzero; if all values are set to 0, this will cause a revert in function `swapAndLiquify()`. - Function `setStructure()` is missing a check that the sum of `transferFee` and `totalFee` does not exceed 100% of the transfer amount.

LowMissing Zero Address ValidationOpen

Addresses should be checked before assignment or external call to ensure `address(0)` is not used.

LowPotentially Incompatible DecimalsOpen

The use of 19 as the `_decimals` value may cause the token to be incompatible with some projects.

LowPrevious `owner` Remains `authorized`Open

When function `transferOwnership()` is called, the `owner` is changed to the new input `adr`, but the previous owner address remains in the `authorizations` mapping as `true`.

LowState Variable Should Be Declared ConstantOpen

State variables that never change should be declared as `constant` to save gas.

LowUnchecked Value of ERC-20 `transfer()` CallOpen

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

Show 3 more
LowUnnecessary Use of SafeMathOpen

The `SafeMath` library is used unnecessarily. With Solidity compiler versions 0.8.0 or newer, arithmetic operations will automatically revert in case of integer overflow or underflow.

LowUsage of `transfer`/`send` for sending EtherOpen

Use of Solidity's `transfer()` and `send()` functions for transferring Ether is not recommended, since some contracts may not be able to receive the funds. The cited 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.

LowVariables Can Be Declared as ImmutableOpen

Variables assigned in the constructor can be declared as `Immutable`. Immutable state variables can be assigned during contract creation, but will remain constant throughout the lifetime of a deployed contract. An advantage of immutable variables is that reading them is significantly cheaper than reading from regular state variables since they are not located in storage.

Contracts in scope2

AddressChainSource code
0x88479186bac914e4313389a64881f5ed0153c765Chain: EthereumSource code: Verified source
0x88479186bac914e4313389a64881f5ed0153c765Chain: BNB ChainSource code: Verified source

Part of SquidGrow’s security record

SquidGrow
Audits16 audits by 2 firmsLast audit Sep 2024, by Hacken.
Critical findingsNo open critical findingsAcross the 16 reports, 1 critical finding was reported. It is marked fixed by the firm that reported it.
Open SquidGrow’s security record

Security firm

CertiK

1,045 projects reviewed · 1,376 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