The current test suite for the in-scope smart contracts is incomplete, resulting in insufficient test coverage. The coverage can be assessed using the command forge coverage --ir-minimum, which reveals the extent of testing across the contracts in scope, as shown in the table below.
Despite the presence of 9 tests covering certain key functionalities (such as creating and aborting buy/sell offers, etc.), these tests mostly explore predefined code execution paths and do not comprehensively assess all possible scenarios. Notably, the CapitalPool.sol contract currently has 0% test coverage, and other critical contracts are only partially tested.
Achieving near-complete test coverage is crucial for the robustness of smart contract systems, especially given the internal complexity of Tadle. Comprehensive testing, including unit tests and fuzzing, should be implemented across all code paths to ensure the system's security and reliability.
The lack of comprehensive test coverage poses significant risks to the integrity and security of the smart contract system. Without thorough testing, vulnerabilities may go undetected, leading to potential exploitation by malicious actors. This could result in financial loss, data breaches, and a loss of user trust.
This issue can be rated with a severity level of "medium", as was the case in previous audits, such as: [https://solodit.xyz/issues/m04-incomplete-set-of-unit-tests-openzeppelin-notional-governance-contracts-v2-audit-markdown], [https://solodit.xyz/issues/incomplete-test-suite-openzeppelin-origin-governance-audit-markdown]. [https://solodit.xyz/issues/insufficient-tests-consensys-nuts-finance-btcplus-markdown].
manual review, vscode, foundry
To mitigate these risks, it is essential to write proper tests for all possible code flows, especially edge cases, to ensure that the system works as intended under all conditions.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.