CertiK reviewed SocialPal (SocialPal - Audit 1) on 23 May 2024: 9 findings, 0 critical; none marked fixed.
The original report was removed from its address (seen 17 Oct 2026).
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 2 | 0 | 0 |
| Medium | 0 | 0 | 0 |
| Low | 7 | 0 | 0 |
In the SPL contract, the role `_owner` has authority over the functions shown in the list below. - `setNoFeeWallet()`: Used to set the enable status of `noFee` for an account. - `toggleCanSwapFees()`: Used to set the `canSwapFees` status. - `changeDevWallet()`: Used to change the `devWallet` to a new one. - `disableSwapFees()`: Used to set `buyfee` and `sellfee` to 0. - `setPresaleAddress()`: Used to set `isPresaleAddress`, `_noFee` and `liquidityAdd` status. - `setStakingAddress()`: Used to set the staking contract. - `enableTrading()`: Used to enable the trading. - `changeFeeAllocations()`: Used to set `devAllocation` and `liquidityAllocation`. - `changeSwapThreshold()`: Used to set `swapThreshold`. - `triggerInternalSwap()`: Owner could trigger the `InternalSwap`. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and modify important state variables in the contract at will, which will affect the normal use of the contract. In addition, since the SPL contract inherits the Ownable contract, the role `_owner` has authority over the functions shown in the list below. - `renounceOwnership()` - Renounce the ownership of contract to leave the contract without an owner. - `transferOwnership()` - Transfers ownership of the contract to a new account. Any compromise to the `_owner` account may allow the hacker to take advantage of this authority and change the owner's permissions at will.
All of the SPL tokens (140_000_000) are sent to the contract deployer. 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. ```solidity=426 balance[msg.sender] = _totalSupply; ``` As of 05/20/2024, the addresses of major holders are listed below: - 32.1330% of the tokens are in the address [**0x802167C58CE9a51AE38150105fD81fac6eA93EC5**](https://bscscan.com/address/0x802167C58CE9a51AE38150105fD81fac6eA93EC5) - 28.6666% of the tokens are in the contract address [**PinkLock02**](https://bscscan.com/address/0x407993575c91ce7643a4d4cCACc9A98c36eE1BBE) - 25.1371% of the tokens are in the contract address [**PancakePair**](https://bscscan.com/address/0x0e8A399e3C7F3cB937E7cb52Efe384F26d4c248d).
This [Checks-Effects-Interactions Pattern](https://docs.soliditylang.org/en/latest/security-considerations.html#use-the-checks-effects-interactions-pattern) is a best practice for writing secure smart contracts that involves performing all state changes before making any external function calls. In the `SPL` contract, function `_transfer()` violates the this pattern. ### External call(s) ```solidity=519 internalSwap((contractTokenBalance * devAllocation) / 100); ``` * This function call executes the following external call(s). * In `SPL.internalSwap`, * `swapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(contractTokenBalance,0,path,address(this),block.timestamp)` * In `SPL.internalSwap`, * `(success,None) = devWallet.call{gas: 35000,value: address(this).balance}("")` ```solidity=523 swapAndLiquify(contractTokenBalance * liquidityAllocation / 100); ``` * This function call executes the following external call(s). * In `SPL.swapAndLiquify`, * `swapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(firstmath,0,path,address(this),block.timestamp)` * In `SPL.swapAndLiquify`, * `swapRouter.addLiquidityETH{value: newBalance}(address(this),secondMath,0,0,DEAD,block.timestamp)` ### State variables written after the call(s) ```solidity=531 balance[from] -= amount; ``` ```solidity=533 balance[to] += amountAfterFee; emit Transfer(from, to, amountAfterFee); ```
Chain IDs 4, 3, and 5 represent the Ethereum test networks `Ropsten`, `Rinkeby`, and `Goerli`, respectively. However, these test networks have been gradually deprecated, and the currently active Ethereum test network is Sepolia.
Contract `SPL` is vulnerable to [a known ERC20 race condition issue](https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729), which could lead to token theft. When a user calls `approve()` for a second time on a spender that has already been allowed, the spender could call `transferFrom()` to transfer the previous value and still receive the authorization to transfer the new value. Exploit scenario: 1. Alice calls `approve(Bob, 100)` to allow Bob to spend 100 tokens. 2. Alice changes her mind and calls `approve(Bob, 50)`. 3. Bob observes the second `approve(Bob, 50)` function call and calls `transferFrom(Alice, Bob, 100)` before the second `approve(Bob, 50)` call. 4. The above scenario can be achieved by front-running. In this case, Bob can transfer another 50 tokens from Alice and in total, he transferred 150 tokens from Alice.
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 frontrunning (executing before the target) a transaction to purchase one of the assets and make profits by backrunning (executing after the target) a transaction to sell the asset. These 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. ```solidity function swapAndLiquify(uint256 contractTokenBalance) internal inSwapFlag { ... try swapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens( firstmath, 0, path, address(this), block.timestamp) {} catch {return;} ... } ``` ```solidity function internalSwap(uint256 contractTokenBalance) internal inSwapFlag { ... try swapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens( contractTokenBalance, 0, path, address(this), block.timestamp ) {} catch { return; } ... } ```
In the `SPL` contract, certain portions of the code are unnecessary and can be optimized: 1. The following line grants the maximum allowable tokens from `msg.sender` to the `swapRouter`. This action is generally not needed unless it directly involves token transactions initiated by `msg.sender`: ```solidity=431 _approve(msg.sender, address(swapRouter), type(uint256).max); ``` It's superfluous to set such a high allowance for `msg.sender` when the contract itself manages its allowances more typically. --- 2. This snippet checks if the allowance for the `swapRouter` from the contract itself (`address(this)`) is set to the maximum, and if not, sets it to the maximum value: ```solidity=631 if (_allowances[address(this)][address(swapRouter)] != type(uint256).max) { _allowances[address(this)][address(swapRouter)] = type(uint256).max; } ``` However, this check is redundant. The contract already grants the maximum allowance to the `swapRouter`, and the maximum allowance does not decrease with each `transferFrom` operation due to the nature of how allowances are managed in this contract. Thus, continuously setting it to the maximum is unnecessary and wastes gas.
The **require** can be used to check for conditions and throw an exception if the condition is not met. It is better to provide a string message containing details about the error that will be passed back to the caller.
The contract is serving as the underlying entity to interact with one or more third party protocols or contracts. The scope of the audit treats third party entity 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=378 IRouter02 public swapRouter; ``` - The contract `SPL` interacts with third party contract with `IRouter02` interface via `swapRouter`, such as the following example: ```solidity=412 swapRouter = IRouter02(0x10ED43C718714eb63d5aA57B78B54704E256024E); ``` --- ```solidity=429 lpPair = IFactoryV2(swapRouter.factory()).createPair(swapRouter.WETH(), address(this)); ``` - The contract `SPL` interacts with third party contract with `IFactoryV2` interface via `swapRouter.factory()`.
| Address | Chain | Source code |
|---|---|---|
| 0x3b25…e6940x3b25c77a806ba3f014358180a99ed91cf5dbe694 | Chain: BNB Chain | Source code: Verified source |
| 0x6ba2…4e7a0x6ba2a0c9145622a081040a37a1eef28052624e7a | Chain: BNB Chain | Source code: Verified source |
1,045 projects reviewed · 1,376 reports · latest May 2025
See CertiK’s auditsSomething 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