Introduction
We express our gratitude to the RedStone team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
RedStone is a decentralized oracle protocol that aggregates on-chain and off-chain data (such as asset price feeds) and delivers it on-chain with cryptographic proofs to ensure data integrity and authenticity to provide reliable, low-latency data for smart contracts and decentralized applications.
The scope of the audit is update of solana connector from revision 713b2df04ec81cb3d4ba7e1336b17ba2631a2cd4
to revision 2046ac07e94003e1f2bde5f21ad138115595dec6
.
Document | |
---|---|
Name | Smart Contract Code Review and Security Analysis Report for RedStone |
Audited By | Bartosz Barwikowski |
Approved By | Bartosz Barwikowski |
Website | https://redstone.finance/→ |
Changelog | 27/05/2025 - Final Report |
Platform | Solana |
Language | Rust |
Tags | Oracle |
Methodology | https://hackenio.cc/sc_methodology→ |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for RedStone
- Audited By
- Bartosz Barwikowski
- Approved By
- Bartosz Barwikowski
- Website
- https://redstone.finance/→
- Changelog
- 27/05/2025 - Final Report
- Platform
- Solana
- Language
- Rust
- Tags
- Oracle
- Methodology
- https://hackenio.cc/sc_methodology→
Review Scope | |
---|---|
Repository | https://github.com/redstone-finance/redstone-oracles-monorepo→ |
Commit | 2046ac07e94003e1f2bde5f21ad138115595dec6 |
Review Scope
- Commit
- 2046ac07e94003e1f2bde5f21ad138115595dec6
Audit Summary
The system users should acknowledge all the risks summed up in the risks section of the report
System Overview
The provided patch introduces several modifications to the RedStone Solana Price Adapter. The key changes are:
Enhanced
**PriceData**
Account: The on-chainPriceData
structure instate.rs
was augmented with new fields:write_slot_number
(to record the slot of the update),decimals
(to store the price's decimal exponent, defaulting to 8), and a_reserved
byte array for future upgrades. Thewrite_price
instruction inwrite_price.rs
was updated to populate these fields.Modified Update Interval for Non-Trusted Updaters: The
min_interval_between_updates_ms
configuration inconfig.rs
was significantly increased from 40 seconds to 2 days. This primarily restricts the update frequency for non-trusted updaters, unless they provide a data package with a more recent timestamp than the existing on-chain data.Adjusted Time-Based Configurations & Trusted Updater: The
max_timestamp_ahead_ms
inconfig.rs
was reduced from 3 minutes to 1 minute, tightening the validation for future-dated data packages. Additionally, one of the public keys in theTRUSTED_UPDATERS
list was changed.Naming Convention Update: The program and package names in
lib.rs
andCargo.toml
were changed fromprice-adapter
toredstone-solana-price-adapter
for better clarity and consistency.RedStone SDK Dependency Update: The
redstone
Rust SDK dependency specified inCargo.toml
was updated from tag2.0.0
to2.0.1
.
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 | |
---|---|
Repository | https://github.com/redstone-finance/redstone-oracles-monorepo→ |
Commit | 2046ac07e94003e1f2bde5f21ad138115595dec6 |
Whitepaper | https://github.com/redstone-finance/redstone-oracles-monorepo→ |
Requirements | https://github.com/redstone-finance/redstone-oracles-monorepo/tree/7aaa97cbe188b80662023981f075e611f3e15b7d/packages/solana-connector/solana→ |
Technical Requirements | https://github.com/redstone-finance/redstone-oracles-monorepo/tree/7aaa97cbe188b80662023981f075e611f3e15b7d/packages/solana-connector/solana→ |
Scope Details
- Commit
- 2046ac07e94003e1f2bde5f21ad138115595dec6