Introduction
We express our gratitude to the SUI Agents team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
SUIAI is an ERC20 token that facilitates seamless initialization and minting of tokens to the owner address.
Document | |
---|---|
Name | Smart Contract Code Review and Security Analysis Report for SUI Agents |
Audited By | Jakub Heba |
Approved By | Przemyslaw Swiatowiec |
Website | https://suiagents.ai/→ |
Changelog | 05/12/2024 - Preliminary Report, 17/12/2024 - Secondary Report |
Platform | EVM, Sui |
Language | Solidity, MOVE |
Tags | ERC20 |
Methodology | https://hackenio.cc/sc_methodology→ |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for SUI Agents
- Audited By
- Jakub Heba
- Approved By
- Przemyslaw Swiatowiec
- Website
- https://suiagents.ai/→
- Changelog
- 05/12/2024 - Preliminary Report, 17/12/2024 - Secondary Report
- Platform
- EVM, Sui
- Language
- Solidity, MOVE
- Tags
- ERC20
- Methodology
- https://hackenio.cc/sc_methodology→
Review Scope | |
---|---|
Repository | https://github.com/Devermint/SUIAIContracts/tree/main→ |
Commit | 242bc8758b681c95f17783ea50151daa552dcfdc |
SUIAI.sol - ERC20 token | https://etherscan.io/address/0xd19b72e027cd66bde41d8f60a13740a26c4be8f3#code→ |
Review Scope
- Commit
- 242bc8758b681c95f17783ea50151daa552dcfdc
- SUIAI.sol - ERC20 token
- https://etherscan.io/address/0xd19b72e027cd66bde41d8f60a13740a26c4be8f3#code→
Audit Summary
The system users should acknowledge all the risks summed up in the risks section of the report
Documentation quality
Functional requirements are missed.
Technical description is not provided.
Code quality
The code is utilizing OpenZeppelin contracts for ERC20 token creation, ownership management and burning mechanism.
Several template code patterns were found.
Test coverage
Code coverage of the SUIAI coin on Sui side is 100% (branch coverage).
All two functions, that is
mint()
andburn()
are covered.
System Overview
SUIAI — simple ERC-20 token that allows minting any amount of tokens to the owner, as well as burning them by anyone.
It has the following attributes:
Name: SUI Agents
Symbol: SUIAI
Decimals: 18 (default)
Unlimited total supply
On the Sui side, the SUIAI token has identical configuration, but uses 9 decimals only.
Privileged roles
The owner of SUIAI can mint tokens to
to
address, as well as transfer ownership via single-step ownership transfer.
Potential Risks
Due to the possibility of unlimited minting of tokens to the address indicated by the owner, there is a risk of centralization and inflation of the token value in the case of too many coins being created.
Findings
Code ― | Title | Status | Severity | |
---|---|---|---|---|
F-2024-7515 | Unrestricted mint function with no supply cap | accepted | Low | |
F-2024-7513 | Unprotected initialize function | accepted | Low | |
F-2024-7512 | Unauthorized token burn via burnFrom function | accepted | Low | |
F-2024-7510 | Single-step ownership transfer | accepted | Low | |
F-2024-7508 | Owner can renounce the ownership of the contract | accepted | Low | |
F-2024-7509 | Floating pragma | accepted | Observation |
Identify vulnerabilities in your smart contracts.
Appendix 1. Definitions
Severities
When auditing smart contracts, Hacken is using a risk-based approach that considers Likelihood, Impact, Exploitability and Complexity metrics to evaluate findings and score severities.
Reference on how risk scoring is done is available through the repository in our Github organization:
Severity | Description |
---|---|
Critical | Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation. |
High | High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation. |
Medium | Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category. |
Low | Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution. |
Severity
- Critical
Description
- Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation.
Severity
- High
Description
- High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation.
Severity
- Medium
Description
- Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category.
Severity
- Low
Description
- Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution.
Potential Risks
The "Potential Risks" section identifies issues that are not direct security vulnerabilities but could still affect the project’s performance, reliability, or user trust. These risks arise from design choices, architectural decisions, or operational practices that, while not immediately exploitable, may lead to problems under certain conditions. Additionally, potential risks can impact the quality of the audit itself, as they may involve external factors or components beyond the scope of the audit, leading to incomplete assessments or oversight of key areas. This section aims to provide a broader perspective on factors that could affect the project's long-term security, functionality, and the comprehensiveness of the audit findings.
Appendix 2. Scope
The scope of the project includes the following smart contracts from the provided repository:
Scope Details | |
---|---|
Repository | https://github.com/hknio/Devermint___SUIAIContracts→ |
Commit | 242bc8758b681c95f17783ea50151daa552dcfdc |
Whitepaper | - |
Requirements | - |
Technical Requirements | - |
Scope Details
- Commit
- 242bc8758b681c95f17783ea50151daa552dcfdc
- Whitepaper
- -
- Requirements
- -
- Technical Requirements
- -
Assets in Scope
sui/my_coin/sources/my_coin.move
SUIAI.sol
Appendix 3. Additional Valuables
Additional Recommendations
The smart contracts in the scope of this audit could benefit from the introduction of automatic emergency actions for critical activities, such as unauthorized operations like ownership changes or proxy upgrades, as well as unexpected fund manipulations, including large withdrawals or minting events. Adding such mechanisms would enable the protocol to react automatically to unusual activity, ensuring that the contract remains secure and functions as intended.
To improve functionality, these emergency actions could be designed to trigger under specific conditions, such as:
Detecting changes to ownership or critical permissions.
Monitoring large or unexpected transactions and minting events.
Pausing operations when irregularities are identified.
These enhancements would provide an added layer of security, making the contract more robust and better equipped to handle unexpected situations while maintaining smooth operations.