Q2 2026 Security & Compliance Report67 incidents, $764M in losses, 88% from operational failures.
Get the report →

Audit name:

[SCA] Amara | Oracle | Mar2025

Date:

Apr 17, 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 Amara team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

Amara is the first perpetual DEX for sustainable assets, helping you invest in a greener future. The scope of this audit is focused on an oracle, composed of a set of contracts that provide several asset prices.

Document

NameSmart Contract Code Review and Security Analysis Report for Amara
Audited ByDavid Camps Novi, Seher Saylik
Approved ByIvan Bondar, Stepan Chekhovskoi
Websitehttps://amara.exchange→
Changelog02/04/2025 - Preliminary Report
17/04/2025 - Final Report
PlatformOdyssey
LanguageSolidity
TagsOracle, Upgradeable
Methodologyhttps://hackenio.cc/sc_methodology→
  • Document

    Name
    Smart Contract Code Review and Security Analysis Report for Amara
    Audited By
    David Camps Novi, Seher Saylik
    Approved By
    Ivan Bondar, Stepan Chekhovskoi
    Changelog
    02/04/2025 - Preliminary Report
    17/04/2025 - Final Report
    Platform
    Odyssey
    Language
    Solidity
    Tags
    Oracle, Upgradeable

Review Scope

Repositoryhttps://github.com/DioneProtocol/oracle→
Commit76cf526f7719f53cddeadbc1fe6d360749c2471a
Retest4f230338d493d14fa13c5f66093027aad2be3f7c

Audit Summary

14Total Findings
4Resolved
10Accepted
0Mitigated

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

Documentation quality

  • Functional requirements are incomplete.

  • Technical description is limited.

Code quality

  • The development environment is configured.

  • The code is not in final state since some features are immature (e.g. latestRoundData())

Test coverage

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

  • Deployment and basic user interactions are not covered with tests.

  • Negative cases coverage is missed.

  • Interactions by several users are not tested thoroughly.

System Overview

Amara is the first perpetual DEX for sustainable assets, helping you invest in a greener future. The scope of this audit is focused on an oracle, composed of a set of contracts that provide several asset prices.

This project is based on the following contracts:

  • Consumer - data feed consumer that can create requests and receive data.

  • ConsumerUpgradeable - upgradeable version of the Consumer contract.

  • DioneOracle - receives data requests, aggregates answers from several oracles and fulfills requests.

  • PriceFeedV2 - collection of consumer contracts for different assets based on USD.

Privileged roles

  • DioneOracle::owner - can register/deregister oracles.

  • DioneOracle::oracle - feeds data back into the system via fulfillDataRequest().

  • PriceFeedV2::owner - requests a price update to the data feed.

  • PriceFeedV2::oracle - returns price data by calling receiveData().

Potential Risks

The project's contracts are upgradable, allowing the administrator to update the contract logic at any time. While this provides flexibility in addressing issues and evolving the project, it also introduces risks if upgrade processes are not properly managed or secured, potentially allowing for unauthorized changes that could compromise the project's integrity and security.

The data feed V2 contracts use 8 decimals as the reference value for decimals returned in the oracles for all contracts. However, the data providers are out of the scope of this audit and the proper usage of decimals cannot be validated.

The system uses external data sources to feed DioneOracle via fulfillDataRequest, which are stored in the state variable oracleNodes. However, such data providers are out of the scope of this audit, resulting in the impossibility to validate the interactions with such external contracts, both in terms of security (e.g. the oracles contained flawed logic or vulnerabilities) and in terms of proper management of those interactions (e.g. unmatched decimals or lack of returned data checks).

A linear scan of the oracleList in deregisterOracle() function risks exceeding block gas limits as the list grows, causing the call to revert, blocking oracle updates, and resulting in a denial‑of‑service.

Both Consumer and Data Feed V2 contracts enforce a strictly increasing reqTimestamp check against a lastHeartbeat stored as a uint256, so if Oracle ever supplies a big value such as the maximum 256‑bit value, no future timestamp can exceed it and every receiveData() call will revert, permanently disabling data ingestion. Because there's no on‑chain reset or overflow protection, a single out‑of‑bounds timestamp effectively "bricks" the consumer. To prevent this, integrators can bound oracle timestamps to the local block.timestamp (or a defined offset).

Findings

F-2025-9606Lack of Zero Value Checks in Returned Oracle Price
Status
fixed
Severity

Medium
F-2025-9590Unmanaged Payment may Result in Loss of Funds
Status
accepted
Severity

Medium
F-2025-9588Immutability of requiredResponses may Result in Denial of Service
Status
fixed
Severity

Medium
F-2025-9587receiveData Does Not Verify Token Pair Match, Request ID and Fails to Update the Price Feed
Status
accepted
Severity

Medium
F-2025-9577Unrestricted Request Creation Leads to Unbounded Operational Costs and Data Manipulation
Status
accepted
Severity

Medium
F-2025-9845Missing Non‑Zero Answer Validation in receiveData
Status
accepted
Severity

Low
F-2025-9844Oracle Deregistration Can Violate Minimum Quorum
Status
accepted
Severity

Low
F-2025-9602Redundant or Incomplete latestRoundData Method
Status
fixed
Severity

Observation
F-2025-9589Redundant nonReentrant Modifiers Waste Gas
Status
accepted
Severity

Observation
F-2025-9585Missing Events for Critical Configuration Updates
Status
accepted
Severity

Observation
Code
―
Title
Status
Severity
F-2025-9606Lack of Zero Value Checks in Returned Oracle Price
fixed

Medium
F-2025-9590Unmanaged Payment may Result in Loss of Funds
accepted

Medium
F-2025-9588Immutability of requiredResponses may Result in Denial of Service
fixed

Medium
F-2025-9587receiveData Does Not Verify Token Pair Match, Request ID and Fails to Update the Price Feed
accepted

Medium
F-2025-9577Unrestricted Request Creation Leads to Unbounded Operational Costs and Data Manipulation
accepted

Medium
F-2025-9845Missing Non‑Zero Answer Validation in receiveData
accepted

Low
F-2025-9844Oracle Deregistration Can Violate Minimum Quorum
accepted

Low
F-2025-9602Redundant or Incomplete latestRoundData Method
fixed

Observation
F-2025-9589Redundant nonReentrant Modifiers Waste Gas
accepted

Observation
F-2025-9585Missing Events for Critical Configuration Updates
accepted

Observation
1-10 of 14 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/DioneProtocol/oracle→
Commit76cf526f7719f53cddeadbc1fe6d360749c2471a
Retest4f230338d493d14fa13c5f66093027aad2be3f7c
WhitepaperN/A
RequirementsN/A
Technical RequirementsN/A
  • Scope Details

    Commit
    76cf526f7719f53cddeadbc1fe6d360749c2471a
    Retest
    4f230338d493d14fa13c5f66093027aad2be3f7c
    Whitepaper
    N/A
    Requirements
    N/A
    Technical Requirements
    N/A

Assets in Scope

abstract
DioneOracleConsumerBase.sol - abstract › DioneOracleConsumerBase.sol
DioneOracleConsumerBaseUpgradeable.sol - abstract › DioneOracleConsumerBaseUpgradeable.sol
Consumer.sol - Consumer.sol
ConsumerUpgradeable.sol - ConsumerUpgradeable.sol
DioneOracle.sol - DioneOracle.sol
interfaces
IDioneOracle.sol - interfaces › IDioneOracle.sol
IDioneOracleConsumer.sol - interfaces › IDioneOracleConsumer.sol
price feed contracts v2
AustraliaUSDPriceFeedV2.sol - price feed contracts v2 › AustraliaUSDPriceFeedV2.sol
AviationIndustryOffsetUSDPriceFeedV2.sol - price feed contracts v2 › AviationIndustryOffsetUSDPriceFeedV2.sol
CaliforniaLowCarbonFuelUSDPriceFeedV2.sol - price feed contracts v2 › CaliforniaLowCarbonFuelUSDPriceFeedV2.sol
ChinaUSDPriceFeedV2.sol - price feed contracts v2 › ChinaUSDPriceFeedV2.sol
DioneUSDPriceFeedV2.sol - price feed contracts v2 › DioneUSDPriceFeedV2.sol
EuropeanUnionUSDPriceFeedV2.sol - price feed contracts v2 › EuropeanUnionUSDPriceFeedV2.sol
NatureBasedOffsetUSDPriceFeedV2.sol - price feed contracts v2 › NatureBasedOffsetUSDPriceFeedV2.sol
NewZealandUSDPriceFeedV2.sol - price feed contracts v2 › NewZealandUSDPriceFeedV2.sol
SouthKoreaUSDPriceFeedV2.sol - price feed contracts v2 › SouthKoreaUSDPriceFeedV2.sol
TechBasedOffsetUSDPriceFeedV2.sol - price feed contracts v2 › TechBasedOffsetUSDPriceFeedV2.sol
UKUSDPriceFeedV2.sol - price feed contracts v2 › UKUSDPriceFeedV2.sol
Proxies.sol - Proxies.sol

Appendix 3. Additional Valuables

Verification of System Invariants

During the audit of Amara, Hacken followed its methodology by performing fuzz-testing on the project's main functions. Foundry →, a tool used for fuzz-testing, was employed to check how the protocol behaves under various inputs. Due to the complex and dynamic interactions within the protocol, unexpected edge cases might arise. Therefore, it was important to use fuzz-testing to ensure that several system invariants hold true in all situations.

Fuzz-testing allows the input of many random data points into the system, helping to identify issues that regular testing might miss. A specific Foundry fuzzing suite was prepared for this task, and throughout the assessment, 5 cases were tested over 10,000 runs. This thorough testing ensured that the system works correctly even with unexpected or unusual inputs.

Invariant

Test Result

Run Count

PriceFeedV2::receiveData() Consumer's aggregated data correctly saved and trade pair check is donePassed10k
DioneOracle::fulfillDataRequest() An oracle node cannot respond twice to the same requestPassed10k
DioneOracle::fulfillDataRequest() An unregistered oracle cannot fulfill a requestPassed10k
DioneOracle::_aggregateResponses() The aggregated average price is never zeroFailed10k
PriceFeedV2::receiveData() Should not accept any zero priceFailed10k
  • Invariant

    PriceFeedV2::receiveData() Consumer's aggregated data correctly saved and trade pair check is done

    Test Result

    Passed

    Run Count

    10k

    Invariant

    DioneOracle::fulfillDataRequest() An oracle node cannot respond twice to the same request

    Test Result

    Passed

    Run Count

    10k

    Invariant

    DioneOracle::fulfillDataRequest() An unregistered oracle cannot fulfill a request

    Test Result

    Passed

    Run Count

    10k

    Invariant

    DioneOracle::_aggregateResponses() The aggregated average price is never zero

    Test Result

    Failed

    Run Count

    10k

    Invariant

    PriceFeedV2::receiveData() Should not accept any zero price

    Test Result

    Failed

    Run Count

    10k

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