DealGuard Info

DealGuard is a DAO designed for seamless peer-to-peer (P2P) transactions between individuals who may not know or trust each other. Using smart contract technology, DealGuard ensures secure trades by locking funds in the contract, accessible only by the buyer and/or seller. It’s the ultimate solution for any transaction involving crypto payments—safe, transparent, and reliable.

DealGuard Logo

Team and KYC Verification

The team has securely submitted their personal information to SolidProof.io for verification.

In the event of any fraudulent activities, this information will be promptly reported to the relevant authorities to ensure accountability and compliance.

TrustNet Score

The TrustNet Score evaluates crypto projects based on audit results, security, KYC verification, and social media presence. This score offers a quick, transparent view of a project's credibility, helping users make informed decisions in the Web3 space.

55.69
Poor Excellent

Real-Time Threat Detection

Real-time threat detection, powered by Cyvers.io, is currently not activated for this project.

This advanced feature provides continuous monitoring and instant alerts to safeguard your assets from potential security threats. Real-time detection enhances your project's security by proactively identifying and mitigating risks. For more information, click here.

Security Assessments

Select the audit
"Static Analysis Dynamic Analysis Symbolic Execution SWC Check Manual Review"
Contract address
0x667E...347D
Network
Base Mainnet
License N/A
Compiler N/A
Type N/A
Language Solidity
Onboard date 2024/12/30
Revision date 2024/12/30

Summary and Final Words

No crucial issues found

The contract does not contain issues of high or medium criticality. This means that no known vulnerabilities were found in the source code.

Contract owner cannot mint

It is not possible to mint new tokens.

Contract owner cannot blacklist addresses.

It is not possible to lock user funds by blacklisting addresses.

Contract owner cannot set high fees

The fees, if applicable, can be a maximum of 25% or lower. The contract can therefore not be locked. Please take a look in the comment section for more details.

Contract cannot be locked

Owner cannot lock any user funds.

Token cannot be burned

There is no burning within the contract without any allowances

Ownership is not renounced

The owner retains significant control, which could potentially be used to modify key contract parameters.

Contract is not upgradeable

The contract does not use proxy patterns or other mechanisms to allow future upgrades. Its behavior is locked in its current state.

Scope of Work

This audit encompasses the evaluation of the files listed below, each verified with a SHA-1 Hash. The team referenced above has provided the necessary files for assessment.

The auditing process consists of the following systematic steps:

  1. Specification Review: Analyze the provided specifications, source code, and instructions to fully understand the smart contract's size, scope, and functionality.
  2. Manual Code Examination: Conduct a thorough line-by-line review of the source code to identify potential vulnerabilities and areas for improvement.
  3. Specification Alignment: Ensure that the code accurately implements the provided specifications and intended functionalities.
  4. Test Coverage Assessment: Evaluate the extent and effectiveness of test cases in covering the codebase, identifying any gaps in testing.
  5. Symbolic Execution: Analyze the smart contract to determine how various inputs affect execution paths, identifying potential edge cases and vulnerabilities.
  6. Best Practices Evaluation: Assess the smart contracts against established industry and academic best practices to enhance efficiency, maintainability, and security.
  7. Actionable Recommendations: Provide detailed, specific, and actionable steps to secure and optimize the smart contracts.

A file with a different Hash has been intentionally or otherwise modified after the security review. A different Hash may indicate a changed condition or potential vulnerability that was not within the scope of this review.

Final Words

The following provides a concise summary of the audit report, accompanied by insightful comments from the auditor. This overview captures the key findings and observations, offering valuable context and clarity.


Ownership Privileges
  • The owner or second signer can initiate the approval.
  • The owner or second signer can approve the operation.
  • The governance contract and owner or signer can set the fee wallet.
  • The owner or governance contract can approve or remove the tokens.
  • The owner or governance contract can add a conciliator to the contract.
  • The owner or governance contract can assign the conciliator on escrow manually.
  • The owner or governance contract can assign a conciliator on the dispute manually.

Note - This Audit report consists of a security analysis of the DealGuard smart contract. This analysis did not include functional testing (or unit testing) of the contract’s logic. Moreover, we only audited one token contract for the DealGuard team. Other contracts associated with the project were not audited by our team. We recommend investors do their own research before investing.

Files and details

Functions
public

/

State variables
public

/

Total lines
of code

/

Capabilities
Hover on items

/

Findings and Audit result

high Issues | 1 findings

Resolved

#1 high Issue
Missing FOT tokens into account
DealGuardEscrow.sol
L455-499
Description

The function assumes standard ERC-20 tokens for transfers and does not handle Fee-on-Transfer (FOT) tokens, which deduct a fee on each transfer. Using FOT tokens could result in parties receiving less than their intended amounts, causing financial discrepancies. Incorrect payment amounts for both buyer and seller when FOT tokens are used.

medium Issues | 8 findings

Resolved

#1 medium Issue
Missing 'isContract' check.
DealGuardEscrow.sol
L146-148
Description

The contract lacks a validation check to ensure that specific parameters are contract addresses. Without this check, there is a risk that non-contract addresses (such as externally owned accounts, or EOAs) could be mistakenly set for parameters intended to reference other contracts. This could lead to failures in executing critical interactions within the contract, as EOAs do not support contract-specific functions. To mitigate this, Implement a validation check to ensure that parameters designated as contract addresses are verified as such. This can be done using Solidity’s Address library function isContract, which checks if an address has associated contract code.

Acknowledged

#2 medium Issue
Missing Hardcap for maximum transactions per user
DealGuardEscrow.sol
L194-250
Description

The function currently uses limitTransactions(msg.sender) but does not enforce an explicit cap on the number of active or historical transactions a single user can have. Without a hard cap, a user might overwhelm the system by creating an excessive number of escrows, potentially leading to scalability issues or abuse.

Resolved

#3 medium Issue
Missing calculations for FOT tokens
DealGuardEscrow.sol
L253-273
Description

The function assumes that the IERC20(escrow.tokenAddress).transfer method will successfully transfer the exact refundAmount to the buyer. However, this approach does not account for Fee-on-Transfer (FOT) tokens, which deduct a fee during the transfer. In the case of FOT tokens, the actual amount received by the buyer will be less than the intended refundAmount, leading to discrepancies and potential issues. The contract should either disallow FOT tokens or handle them appropriately to ensure refunds are accurate.

Resolved

#4 medium Issue
Missing finalized status update in confirmDelivery
DealGuardEscrow.sol
L285-294
Description

The function does not update the finalized property of the Escrow struct to true after confirming the delivery and completing the escrow. This omission can lead to discrepancies in the state of the escrow, as external functions or checks relying on the finalized flag will not recognize that the escrow process has been completed. This could cause logical errors or unintended behavior in related functions or integrations.

Acknowledged

#5 medium Issue
Weak Randomness
DealGuardEscrow.sol
L353-357
Description

The _selectRandomConciliator function relies on block.timestamp and block.prevrandao for randomness, which is insecure as these values are predictable and can be manipulated by miners or external actors. This creates a vulnerability where the conciliator selection process could be exploited, compromising the fairness and integrity of dispute resolution. For critical operations requiring unbiased randomness, this approach is inadequate. The issue is of High Severity due to the potential for manipulation in scenarios with high incentives. A more secure method, such as Chainlink VRF or an off-chain randomness mechanism, should replace the current implementation to ensure reliability.

Acknowledged

#6 medium Issue
No validation for zero percentage for buyer or seller
DealGuardEscrow.sol
L455-499
Description

The function does not validate if either buyerPercentage or sellerPercentage is set to zero. This could result in a dispute resolution where one party gets nothing, which may be unfair or unintended. A check should be added to ensure that neither percentage is zero unless explicitly intended. Potential for unfair or unintended outcomes in dispute resolution.

Resolved

#7 medium Issue
Rounding errors
DealGuardEscrow.sol
L455-499
Description

The calculation of paymentToBuyer and paymentToSeller using percentages is prone to rounding errors due to integer division. This could result in a small amount being unaccounted for, leading to inconsistencies in payments and possible disputes. Small discrepancies in payments due to rounding errors.

Resolved

#8 medium Issue
The owner can set fees more than 25%.
DealGuardEscrow.sol
L181-185
Description

The contract contains the functionality in which the owner or governance contract can update any arbitrary value in the fee percentage, which is not recommended as high fees can cause the loss of funds for the user. There must be a check, so there should be a maximum fee that cannot be more than 25%.

low Issues | 6 findings

Acknowledged

#1 low Issue
Floating pragma solidity version
DealGuardEscrow.sol
L2
Description

Adding the constant version of solidity is recommended, as this prevents the unintentional deployment of a contract with an outdated compiler that contains unresolved bugs.

Resolved

#2 low Issue
Missing events arithmetic
DealGuardEscrow.sol
L146-148
Description

It is recommended to emit all the critical parameter changes.

Resolved

#3 low Issue
Missing zero or dead address check.
DealGuardEscrow.sol
L150-158
L160-164
L175-181
Description

It is recommended to check that the address cannot be set to zero or dead.

Resolved

#4 low Issue
Missing check for buyers and Seller
DealGuardEscrow.sol
L194-250
Description

The function does not verify that the buyer (the sender) and seller addresses are distinct. This oversight can lead to abuse where the user acts as both parties to spam the system or inflate metrics. Additionally, it should ensure that the seller address is valid and not a zero address to prevent invalid escrows.

Acknowledged

#5 low Issue
Redundant code
DealGuardEscrow.sol
L194-250
Description

The check require(tokenAddress != address(0), "Token address must be valid"); is redundant because the subsequent approvedTokens[tokenAddress] check inherently validates that the token is approved. If the token address were invalid or zero, the approvedTokens mapping would return false, making this requirement unnecessary.

Acknowledged

#6 low Issue
Missing Use-case for TermHash
DealGuardEscrow.sol
L194-250
Description

The termsHash parameter in the function appears to lack a functional role in the core escrow logic. It is likely used only for indexing or informational purposes. This raises concerns about whether it is necessary or could be removed to simplify the function.

optimization Issues | 1 findings

Acknowledged

#1 optimization Issue
Public function that could be declared external (external-function)
DealGuardEscrow.sol
L275-283
Description

Use the `external` attribute for functions never called from the contract.