Introduction
We express our gratitude to the ADI Chain team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
GaslessPaymaster implements an ERC-4337 (account abstraction) paymaster that sponsors gas fees on behalf of users, enabling gasless transactions.
Document | |
|---|---|
| Name | Smart Contract Code Review and Security Analysis Report for ADI Chain |
| Audited By | Olesia Bilenka; Ivan Bondar |
| Approved By | Ivan Bondar |
| Website | https://www.adi.foundation/→ |
| Changelog | 04/02/2026 - Preliminary Report |
| 11/02/2026 - Interim report | |
| 24/02/2026 - Final Report | |
| Platform | Ethereum |
| Language | Solidity |
| Tags | Signatures, Meta Transactions, Centralization, ERC4337 |
| Methodology | https://docs.hacken.io/methodologies/smart-contracts→ |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for ADI Chain
- Audited By
- Olesia Bilenka; Ivan Bondar
- Approved By
- Ivan Bondar
- Website
- https://www.adi.foundation/→
- Changelog
- 04/02/2026 - Preliminary Report
- 11/02/2026 - Interim report
- 24/02/2026 - Final Report
- Platform
- Ethereum
- Language
- Solidity
- Tags
- Signatures, Meta Transactions, Centralization, ERC4337
Review Scope | |
|---|---|
| Repository | https://gitlab.sre.ideasoft.io/adi-foundation/custody-core/smart-contracts/-/blob/main/contracts/GaslessPaymaster.sol→ |
| Initial Commit | b017eb6 |
| Final Commit | 3ca0338 |
Review Scope
- Initial Commit
- b017eb6
- Final Commit
- 3ca0338
Audit Summary
The system users should acknowledge all the risks summed up in the risks section of the report
{Finding_Table?columns=title,severity,status&setting.filter.type=Vulnerability}
Documentation quality
Functional requirements are provided.
Project overview is detailed
Main flows are described
Includes system architecture
Technical description is complete.
Run instructions are provided.
NatSpec is sufficient.
Technical specification is provided.
Code quality
The development environment is configured.
Test coverage
Code coverage of the project is 87.16% (branch coverage).
Deployment and basic user interactions are covered with tests.
System Overview
GaslessPaymaster implements an ERC-4337 (account abstraction) paymaster that sponsors gas fees on behalf of users, enabling gasless transactions. It integrates with the eth-infinitism/account-abstraction v0.7 EntryPoint singleton — the protocol-level contract that orchestrates UserOperation validation, execution, and gas accounting. The paymaster holds an ETH deposit at the EntryPoint, which is debited to cover gas costs for sponsored operations and refunded for unused gas after execution.The contract provides two independent authorization paths for gas sponsorship:
Whitelist path — An admin-configured per-address allowlist with optional fee-per-gas caps, gas-volume caps, time windows, and transaction count limits. A global
maxCostPerOperationbound applies across both paths. Whitelisted senders require no signature; the paymaster sponsors any operation from an active whitelisted address that satisfies the configured constraints.Signature path — An off-chain verifier (holding
VERIFIER_ROLE) signs a commitment hash over a subset ofUserOperationfields and fee caps. The on-chain contract recovers the signer, verifies the role, enforces fee caps embedded in thepaymasterAndData, and marks the signature as used to prevent replay.
The contract inherits BasePaymaster (which provides EntryPoint integration, deposit/stake management, and Ownable access control), OpenZeppelin's AccessControl (for role-based administration), and Pausable (for emergency stops). This dual inheritance creates two independent authority systems governing different aspects of the contract.
Files in scope
GaslessPaymaster.sol — ERC-4337 paymaster supporting dual-path gas sponsorship (whitelist and verifier signature). Validates
UserOperationsduring the EntryPoint's validation phase, returns context for post-execution processing, and emits events in_postOp. Manages whitelist configurations, transaction counters, and signature replay tracking.
Privileged Roles
VERIFIER_ROLE - only allowed signer in
_validatePaymasterUserOpunless the caller is whitelisted.DEFAULT_ADMIN_ROLE - can pause the contracts, setup whitelisted addresses, revoke signatures.
owner - ability to withdraw deposit, as well as add/unlock/withdraw stake from the EntryPoint. Gated by pause state via
_checkOwneroverride; fund management is blocked while the contract is paused.entryPoint - only allowed caller of
validatePaymasterUserOpandpostOp.
Potential Risks
Permissions, Authorization & Access
Dual Authority Model from Mixed Inheritance: The contract inherits Ownable (via BasePaymaster) and AccessControl (directly), establishing two independent authority systems. At deployment, ownership is transferred to
defaultAdmin, aligning both systems initially. However,ownerandDEFAULT_ADMIN_ROLEcan subsequently diverge,transferOwnershipandrenounceOwnershipare callable by the owner independently of AccessControl, andDEFAULT_ADMIN_ROLEcan be granted to additional addresses independently of Ownable. Continued alignment of the two authority systems depends on operational discipline.Standing Authorization via Whitelist: Whitelisted addresses receive ongoing gas sponsorship without per-operation verifier approval, bounded only by configured fee caps, time windows, and transaction count limits.
Centralization
Single Point of Failure for Fund Custody: The
owneraddress can unconditionally withdraw the entire EntryPoint deposit without time-lock, or multi-signature constraints.Centralized Verifier Trust: The signature path relies on off-chain verifiers holding
VERIFIER_ROLE. Compromise of a verifier key permits issuance of arbitrary sponsorship signatures until the role is revoked.
Gas Accounting & Operational Continuity
Pre-Funded Deposit Model: All sponsored operations draw from a shared deposit at the EntryPoint. No on-chain mechanism exists for automatic pause or alert when the deposit falls below a safe threshold.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2026-1500 | Unsigned preVerificationGas in Paymaster Commitment Hash Enables Full Deposit Drain via a Single Sponsored UserOperation | fixed | Critical | |
| F-2026-1500 | Whitelisted Addresses Can Drain Full Deposit Regardless of Configured Caps | fixed | High | |
| F-2026-1500 | Missing requiredPreFund Validation Allows Uncontrolled Operation Costs | fixed | High | |
| F-2026-1501 | Split Ownership Between Ownable and AccessControl Allows Deployer to Drain Paymaster Funds | fixed | Medium | |
| F-2026-1521 | Improper Comparison of Packed accountGasLimits Allows Bypass of callGasLimit Cap | fixed | Low | |
| F-2026-1504 | No Global Safety Caps for Gas Parameters in Signature Validation Path | fixed | Low | |
| F-2026-1501 | Missing Input Validation on Admin Configuration Functions | fixed | Low | |
| F-2026-1501 | Paused State Does Not Gate Fund Withdrawal Functions | fixed | Low | |
| F-2026-1501 | Atomic Whitelist Configuration Not Supported | fixed | Low | |
| F-2026-1492 | Excessively Trusted Whitelisted Users Bypass all Transaction Protections | fixed | Low |
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 | |
|---|---|
| Repository | https://gitlab.sre.ideasoft.io/adi-foundation/custody-core/smart-contracts/-/blob/main/contracts/GaslessPaymaster.sol→ |
| Initial Commit | b017eb6 |
| Final Commit | 3ca0338 |
| Whitepaper | https://docs.adi.foundation/whitepaper→ |
| Requirements | ./Readme.md |
| Technical Requirements | ./Readme.md |
Scope Details
- Initial Commit
- b017eb6
- Final Commit
- 3ca0338
- Whitepaper
- https://docs.adi.foundation/whitepaper→
- Requirements
- ./Readme.md
- Technical Requirements
- ./Readme.md
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.