CertiK reviewed Pige Inu on 26 Aug 2022: 13 findings, 0 critical; 4 acknowledged, 9 open.
Report hosted on skynet.certik.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 0 | 2 | 0 |
| Medium | 0 | 2 | 0 |
| Low | 9 | 0 | 0 |
`public` functions that are never called by the contract could be declared as `external`. `external` functions are more efficient than `public` functions.
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 front-running (before the transaction is attacked) a transaction to purchase one of the assets and make profits by back-running (after the transaction is 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: - `uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens()` - `uniswapV2Router.addLiquidityETH()`
The `PIGEINU` contract will set the EOA `0xA4b0588Df297921eF93fDa96979Bf0Db97E2F0df` as `_owner` in its constructor. However, the owner role has no privileges on any specific functions. The `onlyOwner` modifier is never used. Additionally, anyone can call the `renounceOwnership` function. This function is supposed to be restricted, only used by the owner. It seems all these related codes are redundant. ```solidity function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } constructor () { _owner = 0xA4b0588Df297921eF93fDa96979Bf0Db97E2F0df; emit OwnershipTransferred(address(0), _owner); ... } ``` Another redundant code in the contract: ```solidity function _getCurrentSupply() private view returns(uint256) { return (_tTotal); } ``` Another redundant code in the contract: ```solidity uint256 public Percent_Burn = 0; uint256 tokens_to_Burn = contractTokenBalance * Percent_Burn / 100; _tTotal = _tTotal - tokens_to_Burn; _tOwned[Wallet_Burn] = _tOwned[Wallet_Burn] + tokens_to_Burn; _tOwned[address(this)] = _tOwned[address(this)] - tokens_to_Burn; ```
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=381 IUniswapV2Router02 public uniswapV2Router; ``` - The contract `PIGEINU` interacts with third-party contract with `IUniswapV2Router02` interface via `uniswapV2Router`.
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. ```solidity=17 library SafeMath { ``` - An implementation of `SafeMath` library is found. --- ```solidity=327 using SafeMath for uint256; ``` - `SafeMath` library is used for `uint256` type in `PIGEINU` contract. ```solidity=459 _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); ``` - `SafeMath.sub` is called in `transferFrom` function of `PIGEINU` contract. *Note: Only a sample of 2 `SafeMath` library usage in this contract (out of 4) are shown above.*
One or more state variables are never used in the codebase. Variable `MAX` in `PIGEINU` is never used in `PIGEINU`. ```solidity=357 uint256 private constant MAX = ~uint256(0); ``` ```solidity=326 contract PIGEINU is Context, IERC20 { ``` --- Variable `_previousMaxWalletToken` in `PIGEINU` is never used in `PIGEINU`. ```solidity=375 uint256 private _previousMaxWalletToken = _maxWalletToken; ``` ```solidity=326 contract PIGEINU is Context, IERC20 { ``` --- Variable `_previousMaxTxAmount` in `PIGEINU` is never used in `PIGEINU`. ```solidity=378 uint256 private _previousMaxTxAmount = _maxTxAmount; ``` ```solidity=326 contract PIGEINU is Context, IERC20 { ```
It is not recommended to use Solidity's `transfer()` and `send()` functions for transferring Ether, 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=543 wallet.transfer(amount); ``` - `PIGEINU.sendToWallet` uses `transfer()`.
The linked variables could be declared as `constant` since these state variables are never modified.
The linked 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. A big advantage of immutable variables is that reading them is significantly cheaper than reading from regular state variables since they will not be stored in storage.
| Address | Chain | Source code |
|---|---|---|
| 0x1fdb…49e20x1fdb2c3851d067502ce2122be80a41ea212949e2 | 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