EthereumCommonwealth / Auditing

Ethereum Commonwealth Security Department conducted over 400 security audits since 2018. Not even a single contract that we audited was hacked. You can access our audit reports in the ISSUES of this repo. We are accepting new audit requests.
https://audits.callisto.network/
GNU General Public License v3.0
132 stars 34 forks source link

PandAI Token #684

Closed yuriy77k closed 1 year ago

yuriy77k commented 1 year ago

Audit request

PandAI Token

We are PANDAI, the cutest AI meme token, making AI accessible for everyone.

Source code

https://bscscan.com/token/0x550d7984b7adfff88815e5528e12e322df6d3b9b#code

Payment plan

Disclosure policy

Standard disclosure policy.

Contact information (optional)

info@pandai.io

https://pandai.io/

Platform

BSC

yuriy77k commented 1 year ago

The audit fee is 1000 USDT. You may send USDT (ERC20 or BEP20) to: 0x6317c6944bd1cD3932d062cce39d7Fd602119529 (valid for Ethereum and Binance Smart Chain)

The estimated auditing time - is 3 days after payment.

yuriy77k commented 1 year ago

Payment transaction: https://etherscan.io/tx/0x76f4a35610d5604de3d6b546d4c4985fe7935be9be430d7f552348f6517b2747

yuriy77k commented 1 year ago

PandAI Token Contract Security Audit Report

1. Summary

PandAI Token smart contract security audit report performed by Callisto Security Audit Department

2. In scope

PandAIToken

3. Findings

In total, 1 issue were reported, including:

In total, 2 notes were reported, including:

No critical security issues were found.

3.1. Known vulnerabilities of ERC-20 / BEP-20 token

Severity: low

Description

Lack of transaction handling mechanism issue. WARNING! This is a very common issue, and it has already caused millions of dollars in losses for lots of token users! More details here.

Recommendation

Add the following code to the transfer(_to address, ...) function:

require( _to != address(this) );

3.2. Owner Privileges

Severity: owner privilege

Description

Currently, the total supply of the tokens is minted to the owner of the contract, and the distribution of tokens is controlled by the owner.

    constructor() ERC20("PandAI Token", "PANDAI") {
        _mint(msg.sender, 100000000000000 * 10 ** decimals());
    }

Consider transferring the tokens initially to a multi-sig account so that the tokens are protected by multiple members during the distribution and vesting period.

3.3. Follow good coding practice

Severity: Note

Description

  1. Missing docstrings

    The PandAIToken contract in the code base lack documentation. Docstrings improve readability and ease maintenance. They should explicitly explain the purpose or intention of the functions, the scenarios under which they can fail, the roles allowed to call them, the values returned, and the events emitted.

    Consider thoroughly documenting all functions (and their parameters) that are part of the contracts’ public API. Functions implementing sensitive functionality, even if not public, should be documented as well. When writing docstrings, consider following the Ethereum Natural Specification Format (NatSpec).

  2. Unlocked Pragma

    Contracts should be deployed using the same compiler version/flags with which they have been tested. Locking the floating pragma, i.e. by not using ^ in pragma solidity ^0.8.9, ensures that contracts do not accidentally get deployed using an older compiler version with unfixed bugs.

  3. Missing test suite

    The contract is missing a test suite to validate and verify the behavior of the contract functionalities. Add tests are recommended to ensure that the contract functions and behaves as expected.

  4. PandAI Token has 6 decimals

    Tokens with 18 decimals are the current norm, For instance, USDC has 6 decimals, cTokens from Compound and WBTC have 8. Your internal calculations may be inaccurate if you are handling PandAI tokens without considering these cases.

4. Security practices

5. Conclusion

The audited smart contract can be deployed. Only low severity issues were found during the audit.

It is recommended to adhere to the security practices described in pt. 4 of this report to ensure the contract's operability and prevent any issues that are not directly related to the code of this smart contract.

6. Revealing audit reports