We express our gratitude to the SOLIDUS AI TECH team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
The Payment smart contract facilitates the deposit and withdrawal of AITech tokens for payment purposes. It allows users to withdraw in AITech or other ERC20, with other ERC20 withdrawals executed via PancakeSwap for specific users.
Document
Review Scope
The system users should acknowledge all the risks summed up in the risks section of the report
Functional requirements are detailed.
Technical description is detailed.
The code mostly follows best practices and style guides.
See low and informational issues for more information.
The development environment is configured.
Code coverage of the project is 100% (branch coverage).
Deployment and basic user interactions are covered with tests.
The Payment smart contract facilitates the deposit and withdrawal of AITech tokens for payment purposes. It allows users to withdraw in AITech or other ERC20, with other ERC20 withdrawals executed via PancakeSwap for specific users. The contract manages fee allocation, staking, and burning of tokens during deposits. It ensures secure transactions through signature verification and includes functions to update configurations and handle emergencies. The contract also incorporates mechanisms to pause operations during maintenance or upgrades.
Admin can approve Pancake SwapRouter to use AITech token for swapping.
Admin can revokes the approval of the PancakeSwap router to spend AITECH tokens.
Admin can set the AITech token address, to migrate to new AITech token contract.
Admin can set the PancakeSwap router address.
Admin can set the signer address to use its private key to sign the withdraw request.
Admin can configure system staking rate.
Admin can configure system burn rate.
Admin can configure system fee rate.
Admin can configure system minimum and maximum withdraw amount.
Admin can configure staking wallet.
Admin can configure fee wallet.
Admin can emergency transfer any token from the contract to any address. This function is used only when any unexpected issue occurs.
Interactions with External DeFi Protocols: Dependence on external DeFi protocols inherits their risks and vulnerabilities. This might lead to direct financial losses if these protocols are exploited, indirectly affecting the audited project.
Owner's Unrestricted State Modification: The absence of restrictions on state variable modifications by the owner leads to arbitrary changes, affecting contract integrity and user trust, especially during critical operations like minting phases.
Coarse-grained Authorization Model Risks: The broad authorization model increases the risk of protocol control loss if any authorized address is compromised, potentially leading to unauthorized actions and significant financial loss.
Single Points of Failure and Control: The project is fully or partially centralized, introducing single points of failure and control. This centralization can lead to vulnerabilities in decision-making and operational processes, making the system more susceptible to targeted attacks or manipulation.
System Reliance on External Contracts: The functioning of the system significantly relies on specific external contracts. Any flaws or vulnerabilities in these contracts adversely affect the audited project, potentially leading to security breaches or loss of funds.
The current version of the code does not support fee-on-transfer tokens. Adding such tokens in the future can create risks.
A signature from the protocol's centralized backend is needed to withdraw the previously deposited funds. This mechanism carries a potential risk, as it could be vulnerable to unauthorized funds access or misuse, potentially leading to funds locks, unauthorised funds access, and compromising user assets.
Code ― | Title | Status | Severity | |
---|---|---|---|---|
F-2024-4256 | Fees Change Can be Frontrunned | Fixed | Medium | |
F-2024-4258 | Missing Checks for Zero Address | Fixed | Low | |
F-2024-4244 | Redundant Assignment of _isPaused Variable Increases Gas Consumption | Fixed | Observation | |
F-2024-4243 | Public Functions Should Be Declared as External | Fixed | Observation | |
F-2024-4242 | Use of transfer() to Send Native Assets may Revert | Fixed | Observation | |
F-2024-4240 | Redundant Import | Fixed | Observation | |
F-2024-4239 | Floating Pragma | Accepted | Observation |
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
Severity
Description
Severity
Description
Severity
Description
The scope of the project includes the following smart contracts from the provided repository:
Scope Details
contracts/Payment.sol
contracts/PaymentConstant.sol