Introduction
We express our gratitude to the AdPriva team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
The Anchor contract provides a public, verifiable log of AdPriva proof batches, recording batch hashes and Merkle roots on-chain for auditability while relying on off-chain filtering to identify authorized submissions.
Document | |
|---|---|
| Name | Smart Contract Code Review and Security Analysis Report for AdPriva |
| Audited By | Kornel Światłowski |
| Approved By | Turgay Arda Usman |
| Website | - |
| Changelog | 14/01/2026 - Preliminary Report |
| 22/01/2026 - Final Report | |
| Platform | Base |
| Language | Solidity |
| Tags | Event Emitter |
| Methodology | https://docs.hacken.io/methodologies/smart-contracts→ |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for AdPriva
- Audited By
- Kornel Światłowski
- Approved By
- Turgay Arda Usman
- Website
- -
- Changelog
- 14/01/2026 - Preliminary Report
- 22/01/2026 - Final Report
- Platform
- Base
- Language
- Solidity
- Tags
- Event Emitter
Review Scope | |
|---|---|
| Initial Repository | https://github.com/AdPriva/contracts→ |
| Initial Commit | 411fa915898be15c59209d0a4704de8c305a8061 |
| Final Repository | https://github.com/AdPriva/adpriva-contracts→ |
| Final Commit | 9a4dccfdda19a15170c35fb8d8684be0e3d9f10d |
Review Scope
- Initial Repository
- https://github.com/AdPriva/contracts→
- Initial Commit
- 411fa915898be15c59209d0a4704de8c305a8061
- Final Repository
- https://github.com/AdPriva/adpriva-contracts→
- Final Commit
- 9a4dccfdda19a15170c35fb8d8684be0e3d9f10d
Audit Summary
The system users should acknowledge all the risks summed up in the risks section of the report
Documentation quality
Functional requirements are detailed.
Project overview is detailed
All roles in the system are described.
All interactions are described.
Technical description is detailed.
Run instructions are provided.
Technical specification is provided.
NatSpec is sufficient.
Code quality
The development environment is configured.
Insufficient Gas modeling.
Code follows Solidity Style Guide.
NatSpec covers the code and is detailed.
Test coverage
Code coverage of the project is 100% (branch coverage).
Deployment and basic user interactions are covered with tests.
Negative cases coverage is present.
System Overview
The Anchor contract provides a public, verifiable log of AdPriva proof batches, recording batch hashes and Merkle roots on-chain for auditability while relying on off-chain filtering to identify authorized submissions.
Privileged roles
The project does not contain privileged roles.
Potential Risks
No potential risks found in this section.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2026-1477 | Unnecessary Default Value Assignment Of Counter Variable | accepted | Observation | |
| F-2026-1477 | Public Anchor Functions Allow Event Spamming | accepted | Observation | |
| F-2026-1477 | Redundant Timestamp Emission Increases Transaction Cost | accepted | Observation | |
| F-2026-1477 | Repeated Array Length Calculation Increases Gas Consumption | accepted | Observation | |
| F-2026-1477 | Custom Errors Can Be Used for Gas Efficiency | accepted | Observation | |
| F-2026-1477 | Floating Pragma | fixed | Observation |
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 | |
|---|---|
| Initial Repository | https://github.com/AdPriva/contracts→ |
| Initial Commit | 411fa915898be15c59209d0a4704de8c305a8061 |
| Final Repository | https://github.com/AdPriva/adpriva-contracts→ |
| Final Commit | 9a4dccfdda19a15170c35fb8d8684be0e3d9f10d |
| Whitepaper | N/A |
| Requirements | NatSpec |
| Technical Requirements | NatSpec |
Scope Details
- Initial Repository
- https://github.com/AdPriva/contracts→
- Initial Commit
- 411fa915898be15c59209d0a4704de8c305a8061
- Final Repository
- https://github.com/AdPriva/adpriva-contracts→
- Final Commit
- 9a4dccfdda19a15170c35fb8d8684be0e3d9f10d
- Whitepaper
- N/A
- Requirements
- NatSpec
- Technical Requirements
- NatSpec
Assets in Scope
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.
Frameworks and Methodologies
This security assessment was conducted in alignment with recognised penetration testing standards, methodologies and guidelines, including the NIST SP 800-115 – Technical Guide to Information Security Testing and Assessment →, and the Penetration Testing Execution Standard (PTES) →, These assets provide a structured foundation for planning, executing, and documenting technical evaluations such as vulnerability assessments, exploitation activities, and security code reviews. Hacken’s internal penetration testing methodology extends these principles to Web2 and Web3 environments to ensure consistency, repeatability, and verifiable outcomes.