TraderDAOai v3 Security Audit Report
Are Your Funds Safe?
Our expert team at Callisto Network has conducted an in-depth security audit of the TraderDAOai v3 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 TraderDAOai v3 smart contract in May 2023. It analyzes the contract’s security in-depth and highlights any identified vulnerabilities.
1. Scope of the Audit
Blockchain: Arbitrum.
The audit focused on the following TraderDAO v3 contracts:
-
Commit: 9d4f1b1993ed76de25d7f3555a8b4eebdb8ad768
2. Audit Findings
Our audit reported a total of 0 finding(s), categorized as follows:
- 0 high-severity issue(s).
- 0 medium severity issue(s).
- 0 low-severity issue(s).
In addition to these findings, our audit identified 19 additional points, detailed in the following sections:
- 3 note(s).
- 16 owner privilege(s).
No critical security issues were found.
2.1 Owner privileges of Ambassador_Redeem_Contract
- Contract
Ambassador_Redeem_Contract
contract inherits basic access control properties from Openzeppelin’s Ownable contract, where the contract’s ownership can be transferred or renounced. Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner. - Function
SetPause()
allows the owner to pause or resume the contracts functionalities available to the users. Users would be unable to redeem USDT tokes for the signature signed by thesignerAddress
if the contract is paused. - Function
SetSigner()
allows the owner to update thesignerAddress
. All previous un-redeemed signatures will be invalid if thesignerAddress
is updated. New signatures must be generated for previous unclaimed signatures. - Function
Save()
allows the owner to withdraw ERC-20 tokens from the contract.
[/bsf-info-box]
2.2 Owner privileges of Liquidity_Wallet
2.2.1 Functions SetDecimal() and SetRate() allow gov address to modify POT<>USDT conversion rate
The functions SetDecimal()
and SetRate()
allow the gov
address to modify POT<>USDT conversion parameters. With current values of Rate = 100
and Decimals = 10**18
, the 1 POT = 0.0001 USDT
Users should know that the gov
address can set any conversion rate without restriction.
[/bsf-info-box][bsf-info-box icon_type=”custom” icon_img=”id^11679|url^https://callisto.network/wp-content/uploads/2023/04/star-svgrepo-com.png|caption^null|alt^null|title^star-svgrepo-com|description^null” img_width=”20″ icon_animation=”fadeIn” title=”Code Snippet:”]
[/bsf-info-box]
2.2.2 Owner Privileges
- Contract
Liquidity_Wallet
contract inherits basic access control properties from Openzeppelin’s Ownable contract, where the contract’s ownership can be transferred or renounced. Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner. - Function
SetPause()
allows the owner to pause or resume the contracts functionalities available to the users. Users cannot trade POT tokens for USDT tokens if the contract is paused. - Function
SetGov()
allows the owner to update thegov
address. - Function
Save()
allows the owner to withdraw ERC-20 tokens from the contract. - Function
SetFee()
allow thegov
address to set a fee for the user’s claim amount.
[/bsf-info-box]
2.3 POT_Token.sol
2.3.1 Owner Privileges
- Contract
POT_Token
contract inherits basic access control properties from Openzeppelin’s Ownable contract, where the contract’s ownership can be transferred or renounced. Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner. - Function
ownerMint
allows the owner to mint arbitrary tokens. - Function
SetSigner()
allows the owner to update thesignerAddress
. All previous un-redeemed signatures will be invalid if thesignerAddress
is updated. New signatures must be generated for previous unclaimed signatures.
[/bsf-info-box]
2.4.1 Users Claim Reward with USDT tokens
[/bsf-info-box][bsf-info-box icon_type=”custom” icon_img=”id^11679|url^https://callisto.network/wp-content/uploads/2023/04/star-svgrepo-com.png|caption^null|alt^null|title^star-svgrepo-com|description^null” img_width=”20″ icon_animation=”fadeIn” title=”Recommendation:”]
Consider reviewing the implementation or updating documentation based on the business requirements.
[/bsf-info-box]
2.4.2 Owner Privileges
- The function
SetSigner()
allows the owner to update thesignerAddress
. All previous un-redeemed signatures will be invalid if thesignerAddress
is updated. New signatures must be generated for previous unclaimed signatures. - Function
SetPause()
allows the owner to pause or resume the contract’s functionalities available to the users. Users cannot deposit USDT tokens or claim rewards if the contract is paused. - Function
Save()
allows the owner to withdraw ERC-20 tokens from the contract.
[/bsf-info-box]
2.4.3 Deposit with Arbitrary Parameters
The function deposit()
can be called by any user with any parameters. It allows an attacker to deposit with id_
that already exists.
[/bsf-info-box][bsf-info-box icon_type=”custom” icon_img=”id^11679|url^https://callisto.network/wp-content/uploads/2023/04/star-svgrepo-com.png|caption^null|alt^null|title^star-svgrepo-com|description^null” img_width=”20″ icon_animation=”fadeIn” title=”Code Snippet:”]
[/bsf-info-box]
2.5 Follow Good Coding Practice
- Missing docstrings
The contracts in the code base lack documentation. This hinders reviewers’ understanding of the code’s intention, which is fundamental to correctly assess not only security but also correctness. Additionally, 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.
- 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.
- Missing zero address checks
In several places in the code, addresses are passed as parameters to functions. In many of these instances, the functions do not validate that the passed address is not the address 0. While this does not currently pose a security risk, consider adding checks for the passed addresses being nonzero to prevent unexpected behavior where required, or documenting the fact that a zero address is indeed a valid parameter.
- Insufficient event logging
Multiple functions with owner privileges in the contracts do not emit an event. Events are useful to inform external dapps or users that an important state was modified on the contract.
[/bsf-info-box]
3. Security Practices
4. Conclusion
The audited smart contract can be deployed. No security issues were found in the audited contracts.
Users should be aware of the complete centralization of TraderDAO
, where the owner can withdraw any tokens from smart contacts without limitation. Users can claim USDT from TraderDAO
only if the owner adds enough USDT to contracts. The owner can mint POT
tokens without restriction.
Audited contracts don’t implement the functionality described in the Litepaper; therefore, it uses a centralized server-side for all TraderDAO
logic.
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.