Introduction
We express our gratitude to the EB1 team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
EB1 is a multi-stage allowlisted presale contract that lets users buy tokens with USDC/USDT or ETH.
Document | |
|---|---|
| Name | Smart Contract Code Review and Security Analysis Report for EB1 |
| Audited By | Olesia Bilenka, Seher Saylik |
| Approved By | Ivan Bondar |
| Website | https://eb1.io→ |
| Changelog | 06/06/2025 - Preliminary Report |
| 11/06/2025 - Final Report | |
| Platform | Ethereum |
| Language | Solidity |
| Tags | Presale |
| Methodology | https://hackenio.cc/sc_methodology→ |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for EB1
- Audited By
- Olesia Bilenka, Seher Saylik
- Approved By
- Ivan Bondar
- Website
- https://eb1.io→
- Changelog
- 06/06/2025 - Preliminary Report
- 11/06/2025 - Final Report
- Platform
- Ethereum
- Language
- Solidity
- Tags
- Presale
- Methodology
- https://hackenio.cc/sc_methodology→
Review Scope | |
|---|---|
| Repository | https://github.com/EB1-dev/eb1-hacken→ |
| Commit | 75ad515e4cff588d0486603b74b8069dfb5238c0 |
| Retest commit | 2d878553a1623ccdf8e05569c537d17ae63920ed |
Review Scope
- Repository
- https://github.com/EB1-dev/eb1-hacken→
- Commit
- 75ad515e4cff588d0486603b74b8069dfb5238c0
- Retest commit
- 2d878553a1623ccdf8e05569c537d17ae63920ed
Audit Summary
The system users should acknowledge all the risks summed up in the risks section of the report
Documentation quality
Functional requirements are partially missed.
Technical description is provided.
Code quality
The development environment is configured.
Test coverage
Code coverage of the project is 55.56% (branch coverage).
Deployment and basic user interactions are covered with tests.
Some important functionalities are never tested. For instance, the refund mechanism is never tested.
Negative cases coverage is missed.
Interactions by several users are not tested thoroughly.
System Overview
EB1 is a presale platform with the following contracts:
EB1Presale — an allowlisted presale contract where participants can purchase tokens in sequential pricing stages using USDC, USDT, or ETH. It automatically allocates as many tokens as possible in the current stage, issues a refund (chargeBack) if the stage runs out, and applies referral bonuses.
Privileged roles
The owner of the EB1Presale can:
update the protocol wallet address
set the current stage iterator
add a new stage
pause/unpause the contract
rescue stuck funds
Potential Risks
The protocol utilizes centralized oracles for external data inputs. Dependence on a singular or limited set of data sources can introduce accuracy and manipulation risks, potentially affecting the DApp's operations and decision-making processes.
Purchased tokens are only recorded in an internal ledger and never automatically delivered on-chain, so without a separate distribution mechanism users cannot actually retrieve the tokens they paid for.
Referral bonuses are silently skipped if the referral pool is exhausted (or if the referrer has no prior balance), so users may assume they’ll receive a reward when in fact none is granted, leading to confusion.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2025-1075 | Double Reward Claim Due to Referral Reward Is Added to Both referralEarnings and balances | mitigated | Medium | |
| F-2025-1078 | Unit Mismatch in tokensToChargeBack Causes Revert When a Stage Drains | fixed | Medium | |
| F-2025-1076 | Loss of Dust Tokens Due to Inconsistent Division-Multiplication Flow Without Refund | fixed | Medium | |
| F-2025-1076 | Missing Slippage Protection in Token Purchase Functions | fixed | Medium | |
| F-2025-1077 | stageIterator Not Advanced When Current Stage Is Exactly Exhausted | fixed | Low | |
| F-2025-1077 | Hardcoded Stable Token Price May Not Reflect Real Market Value | fixed | Low | |
| F-2025-1075 | Referral Rewards Are Skipped When Partial Rewards Are Possible | fixed | Low | |
| F-2025-1073 | Risk of Ownership Control Loss in Owner-Dependent Contract | fixed | Observation | |
| F-2025-1078 | totalReferralDistributed Is Never Updated | fixed | Observation | |
| F-2025-1078 | 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 | |
|---|---|
| Repository | https://github.com/EB1-dev/eb1-hacken→ |
| Commit | 75ad515e4cff588d0486603b74b8069dfb5238c0 |
| Retest commit | 2d878553a1623ccdf8e05569c537d17ae63920ed |
| Whitepaper | N/A |
| Requirements | https://github.com/EB1-dev/eb1-hacken/tree/main/documentation→ |
| Technical Requirements | https://github.com/EB1-dev/eb1-hacken/tree/main/documentation→ |
Scope Details
- Repository
- https://github.com/EB1-dev/eb1-hacken→
- Commit
- 75ad515e4cff588d0486603b74b8069dfb5238c0
- Retest commit
- 2d878553a1623ccdf8e05569c537d17ae63920ed
- Whitepaper
- N/A
- Technical Requirements
- https://github.com/EB1-dev/eb1-hacken/tree/main/documentation→
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.