The Hacken 2025 TRUST ReportKey findings on trust, security maturity, and the factors driving blockchain adoption.
Learn more

Audit name:

[SCA] Digital Oro | Sweepstakes | Sep2025

Date:

Nov 19, 2025

Table of Content

Introduction
Audit Summary
System Overview
Potential Risks
Findings
Appendix 1. Definitions
Appendix 2. Scope
Appendix 3. Additional Valuables
Disclaimer

Want a comprehensive audit report like this?

Introduction

We express our gratitude to the Digital Oro International team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

DOI - Digital Oro International. The best and easiest way to invest in real estate and make crypto income at the same time.

Document

NameSmart Contract Code Review and Security Analysis Report for Digital Oro International
Audited ByDavid Camps Novi, Stepan Chekhovskoi
Approved ByIvan Bondar
Websitehttps://doi.global
Changelog10/10/2025 - Preliminary Report
19/11/2025 - Final Report
PlatformEthereum
LanguageSolidity
TagsERC-721, Decentralized Finance, Staking.
Methodologyhttps://hackenio.cc/sc_methodology
  • Document

    Name
    Smart Contract Code Review and Security Analysis Report for Digital Oro International
    Audited By
    David Camps Novi, Stepan Chekhovskoi
    Approved By
    Ivan Bondar
    Changelog
    10/10/2025 - Preliminary Report
    19/11/2025 - Final Report
    Platform
    Ethereum
    Language
    Solidity
    Tags
    ERC-721, Decentralized Finance, Staking.

Review Scope

Repositoryhttps://github.com/digitaloro/sweepstakes
Initial Commit727fbe1794d56377d594e11b99aa247aafa3da5d
Final Commit17574745196752b1007f834d404486fc13200e7f

Audit Summary

16Total Findings
14Resolved
2Accepted
0Mitigated

The system users should acknowledge all the risks summed up in the risks section of the report

Documentation quality

  • NatSpec comments are provided.

  • Functional requirements are partially outdated.

  • Technical description is provided.

Code quality

  • The code architecture is clear.

  • Few inconsistencies between similar codepieces are found.

  • Some check duplications are identified.

  • Several template code patterns are presented.

  • The development environment is configured.

  • Check-Effects-Interactions best-practice is not followed.

Test coverage

Code coverage of the project is 78% (branch coverage).

  • Deployment and basic user interactions are covered with tests.

  • Some edge cases lack thorough testing.

  • Several functions and branches in the DOI_Token contract are not covered with tests.

System Overview

DOI - Digital Oro International is a set of smart contracts implementing the “DOI Token” and “DOI Gold” ERC-721 tokens. As well, the smart contracts include Staking, Raffle, and project Treasury functionalities.

  • DOI_AdminManager manages a set of addresses considered as admins. This contract is part of an access control system where only the owner can modify the list of admins.

  • DOI_AccessControl serves as an access control mechanism inherited by other contracts. The contract interacts with DOI_AdminManager to get the admins list.

  • DOI_Treasury manages all the protocol funds. The contract implements methods for internal contracts to takes funds whenever needed. The owner is authorized to withdraw any funds.

  • DOI_PayoutManager is a contract designed to manage and distribute scheduled payouts to the users.

  • DOI_Gold is an ERC-721 with stakeholder privileges in the protocol. It is required to hold Gold tokens in order to stake in Real Estate.

  • DOI_Token is an ERC-721 that can be used to participate in Raffle waves as well as buying Gold tokens.

  • DOI_RealEstate is a representation of a real off-chain real estate asset. Gold holders can stake USDC in these contracts in order to get some yield.

  • DOI_LockManager is a helper contract that manages token locks in the system, which may come from raffle prizes or real estate staking.

  • DOI_Referrals introduces the referral feature of DOI Token purchases. When a user buys new tokens, if they were referred, a reward will be generated.

  • DOI_Raffle contract implements a raffle system where users can participate using “DOI Token”. It features a wave-based structure where each wave allows a limited number of participants, and at the end of each wave, a winner for one time price or for a scheduled payout is selected.

  • DOI_RaffleVRF wraps communication with Chainlink VRF provider to provide DOI_Raffle with on-chain randomness.

Privileged roles

The system defines several privileged roles with distinct responsibilities and access levels:

  • Owner: The highest-privileged role, typically controlling the entire system. The owner can perform configuration operations such as assigning admin roles, updating Treasury accounting, or changing critical system addresses like the royalty recipient. The owner also inherits the permissions of admins, internal contracts, and approved contracts, allowing full control over all system functions.

  • Admin: Assigned by the owner, admins can perform administrative tasks required for the system’s operation. This includes verifying Gold tokens, starting raffle waves, or pausing contracts.

  • Internal Contracts: Defined by the owner, these are system contracts that require elevated privileges to execute core flows correctly, by enabling cross-calls between the system contracts. Examples include initializing payouts, processing referral commissions, or updating user lockings in the Treasury. Internal contracts can also perform the operational permissions that approved contracts can.

  • Approved Contracts: Assigned by the admin, approved contracts can interact with the Locking external functions, such as creating or withdrawing locks.

Potential Risks

The project is fully centralized, introducing single points of failure and control. This centralization can lead to vulnerabilities in decision-making and operational processes, making the system more susceptible to targeted attacks or manipulation.

The project iterates over large dynamic arrays, which leads to excessive gas costs, risking denial of service due to out-of-gas errors, directly impacting contract usability and reliability.

The system Staking and Raffle distribute funds from Treasury. Initially, the Treasury is filled with funds received from “DOI Token” sale. Treasury is supposed to be funded externally to cover the payouts.

The DOI_Treasury contract is the sole source of funds for raffle, real estate, and referral rewards, but it has no on-chain mechanism to autonomously generate or secure these funds. Its balance depends entirely on manual deposits by system administrators, introducing centralization and trust assumptions. If mismanaged or underfunded, users may be unable to claim their expected rewards.

The system’s access control relies on the onlyAuthorizedContract and onlyInternalContract modifiers, which depend on approvedContracts and internalContracts mappings managed by the admin or owner roles. Since these roles are centrally controlled, key functions—such as processing referral commissions, withdrawing locked funds or altering user balances in treasury—ultimately depend on trusted administrative management. This introduces a centralization risk, as misuse or misconfiguration of these roles could compromise the fairness or integrity of the system’s operations.

DOI_Gold ERC721 tokens serve as eligibility assets for participating in real estate staking and acting as verified stakeholders within the system. However, the verification process is performed off-chain by the system administrator, who must manually trigger the on-chain verifyFunction() afterward. This introduces a trust dependency on the admin’s off-chain actions, as users cannot independently verify or trigger their own verification, making the process centralized and dependent on proper administrative execution.

In the replaceToken() function, the admin has the ability to burn a user’s existing Gold token and mint a new one to a different address. This effectively allows the admin to revoke ownership of tokens without the holder’s consent. Such unrestricted administrative control introduces a centralization risk and undermines token ownership guarantees, as users must fully trust the admin not to misuse this capability.

The system accepts token amounts as human-readable values (without decimals) in several functions, relying on internal scaling logic to maintain consistency across the execution flow. As a result, fractional token amounts cannot be used. Moreover, if a system manually triggers functions outside the intended internal call sequence—bypassing the approved execution paths—accounting inconsistencies may occur, potentially leading to inaccurate balances or other unintended behaviors.

The PayoutManager contract calculates payouts by dividing the total payout amount by the number of unlock periods (payoutPerPeriod = totalPayout / totalPeriods). Due to integer truncation in Solidity, the cumulative sum of all periodic payouts (payoutPerPeriod * totalPeriods) may be slightly lower than the intended total payout. Consequently, users may receive marginally fewer tokens than expected. While the impact on users is minor given the small rounding discrepancy, administrators should monitor the Treasury’s balance to ensure accounting consistency. Any surplus tokens allocated to the Treasury to offset such discrepancies can be withdrawn by authorized roles, mitigating potential operational concerns.

Each RealEstate contract defines a maximum total amount of USDC that can be staked; however, no per-user staking limit is enforced. As a result, a single user could potentially stake the entire available capacity of a given RealEstate contract, preventing other participants from taking part in the staking opportunity and undermining fairness in access to the system’s rewards.

The protocol’s revenue, which funds RealEstate staking rewards, raffle prizes, and referral rewards, appears to be generated off-chain—presumably from activities such as selling or renting properties. There is no on-chain mechanism to verify or enforce these revenue inflows, meaning the system relies entirely on administrators or owners to accurately and fairly update the Treasury. This introduces a centralization and trust risk, as users cannot independently verify the source or correctness of funds backing the rewards, and mismanagement could result in insufficient payouts.

The Treasury contract holds users’ locked USDC tokens from RealEstate staking, as well as reward tokens, with the locked funds being the most critical. The contract exposes withdraw() and withdrawTo() functions, which grant the owner the ability to transfer out these funds. This introduces a centralization and trust risk, as the contract owner could potentially drain user deposits, compromising the safety of staked assets and overall system integrity.

Normally, users are required to hold at least one Gold token to maintain their active locks, and the _update() function in the Gold contract enforces this by reverting transfers that would leave a user without any Gold tokens. However, the replaceToken() function bypasses this safeguard, allowing a user to hold active locks without possessing any Gold tokens.

When the Gold token reaches its supply limit of 5,000 tokens, the DOI_Raffle contract allows an active raffle to be closed even if users have already participated. In this situation, a winner is still selected; however, the expected on-chain payout mechanisms (doiTreasury.processPayment() or payoutManager.initializePayout()) are not executed. Instead the winner will receives a reduced prize, managed off-chain. This discrepancy between expected and actual payout behavior may lead to user confusion or disputes. The conditions under which a raffle may close with modified prize distribution should be clearly disclosed within the raffle rules.

The system relies on multiple cross-contract interactions between DOI_Raffle, the DOI_LockManager contract, or the DOI_Treasury contract, among others. Certain functions involve external calls before all internal state changes are finalized, which deviate from the Checks-Effects-Interactions (CEI) pattern. While no direct exploit or reentrancy pathway was identified, inconsistent adherence to CEI can increase the risk of unexpected state dependencies, partial execution, or unforeseen side effects during cross-contract calls. Ensuring strict CEI compliance across all interacting components is recommended to maintain predictable and secure execution flows.

Findings

Code
Title
Status
Severity
F-2025-1331Payout Claim Duration can be Surpassed
fixed

Critical
F-2025-1342Payout Distribution Delays due to Invalid Last Claimed Timestamp Update
fixed

High
F-2025-1320User Funds Unexpectedly Transferred to Treasury due to Arbitrary Transfer From Parameter
fixed

High
F-2025-1331Excessive Token Mint due to Invalid Validation
fixed

Medium
F-2025-1331Total Supply ERC-721 Enumeration Incompliance
fixed

Medium
F-2025-1327Maximum Token Supply may Be Never Reached due to Invalid Validation
fixed

Medium
F-2025-1323Token URI ERC-721 Metadata Incompliance
fixed

Low
F-2025-1342Bypass of the Ownable2Step Transfer Mechanism
fixed

Low
F-2025-1339Raffle Participation Limits Admin Control of DOI Token Supply
fixed

Low
F-2025-1338Unused Parameter prizeContractAddress
accepted

Observation
1-10 of 16 findings

Identify vulnerabilities in your smart contracts.

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

Repositoryhttps://github.com/digitaloro/sweepstakes
Initial Commit727fbe1794d56377d594e11b99aa247aafa3da5d
Final Commit17574745196752b1007f834d404486fc13200e7f
WhitepaperN/A
RequirementsREADME.md
Technical Requirementsdocs/*.md
  • Scope Details

    Initial Commit
    727fbe1794d56377d594e11b99aa247aafa3da5d
    Final Commit
    17574745196752b1007f834d404486fc13200e7f
    Whitepaper
    N/A
    Requirements
    README.md
    Technical Requirements
    docs/*.md

Assets in Scope

contracts
DOI_AccessControl.sol - contracts › DOI_AccessControl.sol
DOI_AdminManager.sol - contracts › DOI_AdminManager.sol
DOI_CustomErrors.sol - contracts › DOI_CustomErrors.sol
DOI_Gold.sol - contracts › DOI_Gold.sol
DOI_LockManager.sol - contracts › DOI_LockManager.sol
DOI_PayoutManager.sol - contracts › DOI_PayoutManager.sol
DOI_Raffle.sol - contracts › DOI_Raffle.sol
DOI_RaffleVRF.sol - contracts › DOI_RaffleVRF.sol
DOI_RealEstate.sol - contracts › DOI_RealEstate.sol
DOI_Referrals.sol - contracts › DOI_Referrals.sol
DOI_Token.sol - contracts › DOI_Token.sol
DOI_Treasury.sol - contracts › DOI_Treasury.sol

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.

Disclaimer

Digital Oro International audit by Hacken