PandAI Token Security Audit Report
Are Your Funds Safe?
Our expert team at Callisto Network has conducted an in-depth security audit of the PandAI Token smart contract. This audit aims to ensure the security of your funds by identifying and assessing any potential vulnerabilities. Here, we present our findings:
Executive Summary
This report presents the results of the security audit conducted by the Callisto Network Security Department on the PandAI Token smart contract in February 2023. It analyzes the contract’s security in-depth and highlights any identified vulnerabilities.
1. Scope of the Audit
2. Audit Findings
Our audit reported a total of 1 finding(s), categorized as follows:
- 0 high-severity issue(s).
- 0 medium severity issue(s).
- 1 low-severity issue(s).
In addition to these findings, our audit identified 2 additional points, detailed in the following sections:
- 1 note(s).
- 1 owner privilege(s).
No critical security issues were found.
2.1 Known Vulnerabilities of ERC-20 Token
Add the following code to the
transfer(_to address, ...)
function:require( _to != address(this) );
[/bsf-info-box]
2.2 Owner Privileges
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.
[/bsf-info-box]
2.3 Follow Good Coding Practices
-
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 also be documented. Consider following the Ethereum Natural Specification Format (NatSpec) when writing docstrings.
-
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.
-
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.
-
PandAI Token has 6 decimals
Tokens with 18 decimals are the current norm. For instance, USDC has 6 decimals, cTokens from Compound, and WBTC has 8. Your internal calculations may be inaccurate if you handle PandAI tokens without considering these cases.
[/bsf-info-box]
3. Security Practices
4. 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.
About Callisto Network
Founded by Dexaran, co-founder of Ethereum Classic, Callisto Network is a blockchain platform that prioritizes security. We’ve conducted over 330 smart contract audits across platforms like Ethereum, Ethereum Classic, and EOS. In addition to our audits, we’ve developed the ERC 223 token standard and CallistoNFT standard, enhancements over existing standards that address flaws and offer new capabilities, further establishing us as industry leaders in crypto-security.