From c540739d7aef96b3b28928de7bf6765f329f3761 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:02:48 +0100 Subject: [PATCH 01/81] Update redstone-core.mdx --- docs/get-started/models/redstone-core.mdx | 343 +++++++++------------- 1 file changed, 133 insertions(+), 210 deletions(-) diff --git a/docs/get-started/models/redstone-core.mdx b/docs/get-started/models/redstone-core.mdx index a4e25136..2b2d6252 100644 --- a/docs/get-started/models/redstone-core.mdx +++ b/docs/get-started/models/redstone-core.mdx @@ -3,233 +3,108 @@ sidebar_position: 1 sidebar_label: "⚙️ Core (on-demand feeds)" --- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - -# ⚙️ Core Model - -## Fetching prices on-demand - -This is our basic operating model when the data is automatically appended to user transaction. - -:::tip In Prod - -Core model is the most mature way to use RedStone, battle tested in production, protecting >$100M TVL of [DeFi Protocols](https://defillama.com/oracles/RedStone) (not all listed yet) across multiple mainnets. The price feeds have been injected to more than [~50K transactions](https://dune.com/hatskier/redstone). - -::: - -## Installation - -Install [@redstone-finance/evm-connector](https://www.npmjs.com/package/@redstone-finance/evm-connector) from NPM registry - -### Hardhat - - - - -```bash - yarn add @redstone-finance/evm-connector -``` - - - - -```bash -npm install @redstone-finance/evm-connector -``` - - - - - -### Foundry - -Foundry installs dependencies using git submodules. Thus additional steps are needed to [install dependencies](https://book.getfoundry.sh/projects/dependencies). - -In foundry project: - -1. Install `@redstone-finance/evm-connector` - it will install current code from main branch - -```bash -forge install redstone-finance/redstone-oracles-monorepo -``` - -2. Install `@OpenZeppelin` contracts (dependency of `@redstone-finance/evm-connector`) - it will install current code from main branch - -```bash -forge install OpenZeppelin/openzeppelin-contracts@v4.9.5 -``` - -3. Add libraries to `remappings.txt` - -```bash +# Setting Up The RedStone Core Model +Our documentation is designed for non-technical readers to be able implement RedStone's Core Model. ****This is our recommended model**** which provides data feeds to dApps only upon request reducing the costs of putting data onto the blockchain. + +## Prerequisites Before You Begin + +- **Basic Knowledge of Smart Contracts:** Understanding how to implement and interact with smart contracts on Ethereum. +- **Familiarity with Hardhat or Foundry:** Knowing how to use these development environments for building and testing dApps +- **OpenZeppelin Contracts:** Understanding and using OpenZeppelin's library. + +## ****Step-by-Step Guide**** + +## 1. Install Prerequisites + +Before you begin, you will need to install some tools that our project will use. + +#### For Hardhat +1. Open your terminal (this is where you type commands to your computer). +2. To add the RedStone EVM connector package, type one of these commands: + - If you're using Yarn (a package manager for JavaScript): + ```bash + yarn add @redstone-finance/evm-connector + ``` + - If you're using npm (another package manager for JavaScript): + ```bash + npm install @redstone-finance/evm-connector + ``` + +#### For Foundry +Foundry is another tool used for developing on the blockchain. It uses a different method to install packages. + +1. Open your terminal. +2. Navigate to your Foundry project directory by typing: + ```bash + cd path/to/your/foundry/project + ``` + +3. Install the RedStone EVM connector: + + ``` + forge install redstone-finance/redstone-oracles-monorepo + ``` + +4. Install the OpenZeppelin contracts, which the RedStone connector relies on: + + ``` + forge install OpenZeppelin/openzeppelin-contracts@v4.9.5 + ``` +5. Link these new libraries by adding their paths to a file called remappings.txt: + ```bash echo "@redstone-finance/evm-connector/dist/contracts/=lib/redstone-oracles-monorepo/packages/evm-connector/contracts/ @openzeppelin/contracts=lib/openzeppelin-contracts/contracts/" >> remappings.txt ``` +This command tells Foundry where to find the new tools installed. -## Usage - -:::tip TLDR; -You need to do 2 things: +## 2. Adjust Your Smart Contracts +Smart contracts are like the rules and logic that run on the blockchain. They need to updated to use data from RedStone. -1. [Adjust your smart contracts](#1-adjust-your-smart-contracts) to include the libraries responsible for data extraction and verification -2. [Adjust Javascript code of your dApp](#2-adjust-javascript-code-of-your-dapp) to inject the additional payload with data feeds (otherwise you will get smart contract errors). - - - -::: - -### 1. Adjust your smart contracts -:::caution Heads up -1. Our contracts require `solidity > 0.8.4`. If your code is written in an older version please use the [Manual Payload](#manual-payload). -2. If you work with 3rd party aggregators, make sure that they also support passing the additional payload. -3. Please don't use Remix to test RedStone oracles, as Remix does not support modifying transactions in the way that the evm-connector does -4. We strongly recommend having some upgradability mechanism for your contracts (it can be based on multisig or DAO). This way, you can quickly replace data providers in case of any issues. -::: - - -You need to apply a minimum change to the source code to enable smart contract to access data. Your contract needs to extend one of our [base contracts](https://github.com/redstone-finance/redstone-oracles-monorepo/tree/main/packages/evm-connector/contracts/data-services), depending on which data service are you going to use. - -
- List of base contracts with data services - - | Base Contract | Data service with the list of feeds | Status | - |----------------------------------------|------------------------------|-----------------| - | [MainDemoConsumerBase.sol](https://github.com/redstone-finance/redstone-oracles-monorepo/blob/main/packages/evm-connector/contracts/data-services/MainDemoConsumerBase.sol) | [redstone-main-demo](https://app.redstone.finance/#/app/data-services/redstone-main-demo) | Demo | - | [RapidDemoConsumerBase.sol](https://github.com/redstone-finance/redstone-oracles-monorepo/blob/main/packages/evm-connector/contracts/data-services/RapidDemoConsumerBase.sol) | [redstone-rapid-demo](https://app.redstone.finance/#/app/data-services/redstone-rapid-demo) | Demo | - | [StocksDemoConsumerBase.sol](https://github.com/redstone-finance/redstone-oracles-monorepo/blob/main/packages/evm-connector/contracts/data-services/StocksDemoConsumerBase.sol) | [redstone-stocks-demo](https://app.redstone.finance/#/app/data-services/redstone-stocks-demo) | Demo | - | [AvalancheDataServiceConsumerBase.sol](https://github.com/redstone-finance/redstone-oracles-monorepo/blob/main/packages/evm-connector/contracts/data-services/AvalancheDataServiceConsumerBase.sol) | [redstone-avalanche-prod](https://app.redstone.finance/#/app/data-services/redstone-avalanche-prod) | Production | - | [PrimaryProdDataServiceConsumerBase.sol](https://github.com/redstone-finance/redstone-oracles-monorepo/blob/main/packages/evm-connector/contracts/data-services/PrimaryProdDataServiceConsumerBase.sol) | [redstone-primary-prod](https://app.redstone.finance/#/app/data-services/redstone-primary-prod) | Production | - - - 💡 Note: Service with `Production` status have got multiple nodes deployed and are professionally monitored. -
+****Step-by-Step Guide**** +1. Import RedStone Base Contract: +Add this line at the top of your smart contract code. ```js import "@redstone-finance/evm-connector/contracts/data-services/MainDemoConsumerBase.sol"; +``` +2. Extend Your Contract: +Make your contract use the new features by extending from MainDemoConsumerBase. This is similar to saying your contract inherits abilities from another contract: +```js contract YourContractName is MainDemoConsumerBase { - ... + // Your contract code goes here } ``` -You should pass the data feed id converted to `bytes32`. - - - - -```js - uint256 ethPrice = getOracleNumericValueFromTxMsg(bytes32("ETH")); -``` - - - - -```js - bytes32[] memory dataFeedIds = new bytes32[](2); - dataFeedIds[0] = bytes32("ETH"); - dataFeedIds[1] = bytes32("BTC"); - uint256[] memory values = getOracleNumericValuesFromTxMsg(dataFeedIds); - uint256 ethPrice = values[0]; - uint256 btcPrice = values[1]; -``` - - - - - -For all the supported feeds we provide [UI with charts and historical data](https://app.redstone.finance) - -💡 Note: You can also override the following functions (do it at your own risk): - -- `isTimestampValid(uint256 receivedTimestamp) returns (bool)` - to enable custom logic of timestamp validation. You may specify a shorter delay to accept only the most recent price fees. However, on networks with longer block times you may extend this period to avoid rejecting too many transactions. - -- `aggregateValues(uint256[] memory values) returns (uint256)` - to enable custom logic of aggregating values from different providers (by default this function takes the median value). For example, you may request values from providers to be strictly equal while dealing with discrete numbers. - -- `getAuthorisedSignerIndex(address _signerAddress) returns (uint256)` - to whitelist additional signers or remove corrupted ones. - - -- `getUniqueSignersThreshold() returns (uint256)` - to modify number of required signers. The higher number means greater reliability but also higher gas costs. - -### 2. Adjust Javascript code of your dApp - -You should also update the code responsible for submitting transactions. If you're using [ethers.js](https://github.com/ethers-io/ethers.js/), we've prepared a dedicated library to make the transition seamless. - -#### Contract object wrapping - -First, you need to import the wrapper code to your project - - - +3. Use Data Feeds: +Inside your contract, you can now access data provided by RedStone. This code fetches the latest price of ETH and BTC: ```js - const { WrapperBuilder } = require("@redstone-finance/evm-connector"); -``` - - - - -```js - import { WrapperBuilder } from "@redstone-finance/evm-connector"; -``` - - - -Then you can wrap your ethers contract pointing to the selected [RedStone data service id.](https://app.redstone.finance/#/app/data-services) You can (optionally) specify a number of unique signers, data feed identifiers, and URLs for the redstone cache nodes. - -```js -const yourEthersContract = new ethers.Contract(address, abi, provider); - -const wrappedContract = WrapperBuilder.wrap(contract).usingDataService( - { - dataFeeds: ["ETH", "BTC"], - }, -); -``` +uint256 ethPrice = getOracleNumericValueFromTxMsg(bytes32("ETH")); -Now you can access any of the contract's methods in exactly the same way as interacting with the ethers-js code: +bytes32[] memory dataFeedIds = new bytes32[](2); +dataFeedIds[0] = bytes32("ETH"); +dataFeedIds[1] = bytes32("BTC"); -```js -wrappedContract.executeYourMethod(); +uint256[] memory values = getOracleNumericValuesFromTxMsg(dataFeedIds); +uint256 ethPrice = values[0]; +uint256 btcPrice = values[1]; ``` +For all the supported feeds we provide UI with charts and historical data. -#### Testing +4. Override the following functions (only if necessary - at your own risk): -##### Hardhat +```isTimestampValid(uint256 receivedTimestamp)``` returns (bool) - to enable custom logic of timestamp validation. You may specify a shorter delay to accept only the most recent price fees. However, on networks with longer block times you may extend this period to avoid rejecting too many transactions. -If you'd like to use the wrapper in a test context, we recommend using a mock wrapper so that you can easily override the oracle values to test different scenarios. To use the mock wrapper just use the `usingMockData(signedDataPackages)` function instead of the `usingDataService` function. +```aggregateValues(uint256[] memory values)``` returns (uint256) - to enable custom logic of aggregating values from different providers (by default this function takes the median value). For example, you may request values from providers to be strictly equal while dealing with discrete numbers. -```js -const { SimpleNumericMockWrapper } = require("@redstone-finance/evm-connector/dist/src/wrappers/SimpleMockNumericWrapper"); - -const wrappedContract = - WrapperBuilder.wrap(yourContract).usingSimpleNumericMock( - { - mockSignersCount: 10, - dataPoints: [ - {dataFeedId: "ETH", value: 1000} - ], - }, - ); - await wrappedContract.yourMethod(); +```getAuthorisedSignerIndex(address _signerAddress)``` returns (uint256) - to whitelist additional signers or remove corrupted ones. -``` +```getUniqueSignersThreshold()``` returns (uint256) - to modify number of required signers. The higher number means greater reliability but also higher gas costs. -You can see more examples of mocking data [here.](https://github.com/redstone-finance/redstone-oracles-monorepo/tree/main/packages/evm-connector/test/mock-wrapper) - -##### Foundry - -To use Redstone Oracles with Foundry in test context, we recommend using foundry `vm.ffi` function to generate mocked dataPackages. -We have prepared [repository](https://github.com/redstone-finance/minimal-foundry-repo) showing how we can integrate foundry with redstone. -- [consuming redstone payload in foundry contract](https://github.com/redstone-finance/minimal-foundry-repo/blob/main/test/Counter.t.sol) -- [generating mock redstone payload](https://github.com/redstone-finance/minimal-foundry-repo/blob/main/getRedstonePayload.js) - -## Manual payload -This approach is helpful if you need to pass the pricing data from one contract to another in your protocol. - -It's also a solution for a case, where your contracts are written in solidity in a version lower than `0.8.4` it could be problematic to extend from the `RedstoneConsumerBase` contract. -In that case we recomment to deploy a separate `Extractor` contract that will contain the verification logic: +5. Manual Payload (if needed): +This approach is helpful if you need to pass the pricing data from one contract to another in your protocol. It's also a solution for cases where your contracts are written in Solidity in a version lower than 0.8.4, making it problematic to extend from the RedstoneConsumerBase contract. In such cases, we recommend deploying a separate Extractor contract that will contain the verification logic: ```js pragma solidity 0.8.4; @@ -242,17 +117,11 @@ contract RedstoneExtractor is RedstoneConsumerNumericMock { } } ``` - -and proxy the payload from your originating contract - ```js function getPriceFromRedstoneOracle(bytes32 feedId, bytes calldata redstonePayload) public view returns(uint256) { return redstoneExtractor.extractPrice(feedId, redstonePayload); } ``` - -The manual payload could be obtained using the following code on the client side: - ```js const redstonePayload = await (new DataServiceWrapper({ dataServiceId: "redstone-main-demo", @@ -262,7 +131,61 @@ const redstonePayload = await (new DataServiceWrapper({ // Interact with the contract (getting oracle value securely) const price = await yourContract.getPriceFromRedstoneOracle(redstonePayload); ``` +Working demo examples of the @redstone-finance/evm-connector usage can be found in our [dedicated repository with examples](https://github.com/redstone-finance/redstone-evm-examples). + + + +## 3. Adjust JavaScript Code of Your dApp + +****Step-by-Step Guide**** + -## Working demo +1. Import the Wrapper Code: +Wrapper code helps your app interact with RedStone's data services seamlessly. Add this line to your JavaScript code: -You can see examples of the `@redstone-finance/evm-connector` usage in our [dedicated repo with examples](https://github.com/redstone-finance/redstone-evm-examples). +```js +const { WrapperBuilder } = require("@redstone-finance/evm-connector"); +// or using ES6 syntax +import { WrapperBuilder } from "@redstone-finance/evm-connector"; +``` + +2. Wrap Ethers contract +We need to wrap our contract so it can use RedStone's data: + +```js +const yourEthersContract = new ethers.Contract(address, abi, provider); + +const wrappedContract = WrapperBuilder.wrap(contract).usingDataService({ + dataFeeds: ["ETH", "BTC"], +}); +``` + +3. Use the Wrapped Contract: +Now, you can call methods on your wrapped contract just like before, but now it will include RedStone's data: +```js +wrappedContract.executeYourMethod(); +``` +## 4. Testing +For Hardhat +Mock Wrapper for Testing: +Use a mock wrapper to simulate different scenarios without using real data: +```js +const { SimpleNumericMockWrapper } = require("@redstone-finance/evm-connector/dist/src/wrappers/SimpleMockNumericWrapper"); + +const wrappedContract = WrapperBuilder.wrap(yourContract).usingSimpleNumericMock({ + mockSignersCount: 10, + dataPoints: [{ dataFeedId: "ETH", value: 1000 }], +}); + +await wrappedContract.yourMethod(); + +``` +For Foundry +Generate Mock Data: +Use Foundry's functions to create mock data packages for testing. Refer to the foundry integration repository for detailed examples. + +## Important Notes +- Solidity Version: Ensure your smart contract uses Solidity version 0.8.4 or higher. If using an older version, refer to the manual payload method. +- Testing Environment: Avoid using Remix for testing RedStone oracles as it doesn't support the required transaction modifications. +- Upgradability: Implement an upgradability mechanism (e.g., multisig or DAO) for your contracts to quickly replace data providers if needed. +- You can see examples of the `@redstone-finance/evm-connector` usage in our [dedicated repo with examples](https://github.com/redstone-finance/redstone-evm-examples). From 477c57f25f7880b16cf06e0122c9ce7a7f9b6f26 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:03:09 +0100 Subject: [PATCH 02/81] Rename redstone-core.mdx to redstone-core.md --- docs/get-started/models/{redstone-core.mdx => redstone-core.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/get-started/models/{redstone-core.mdx => redstone-core.md} (100%) diff --git a/docs/get-started/models/redstone-core.mdx b/docs/get-started/models/redstone-core.md similarity index 100% rename from docs/get-started/models/redstone-core.mdx rename to docs/get-started/models/redstone-core.md From 4f0818afd1355b559bcc154ae4162c5c94704618 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:08:19 +0100 Subject: [PATCH 03/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index 2b2d6252..cc295c5a 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -8,7 +8,7 @@ Our documentation is designed for non-technical readers to be able implement Red ## Prerequisites Before You Begin -- **Basic Knowledge of Smart Contracts:** Understanding how to implement and interact with smart contracts on Ethereum. +- **Basic Knowledge of Smart Contracts:** Understanding how to implement and interact with smart contracts. - **Familiarity with Hardhat or Foundry:** Knowing how to use these development environments for building and testing dApps - **OpenZeppelin Contracts:** Understanding and using OpenZeppelin's library. @@ -62,13 +62,13 @@ Smart contracts are like the rules and logic that run on the blockchain. They ne ****Step-by-Step Guide**** -1. Import RedStone Base Contract: +#### 1. Import RedStone Base Contract: Add this line at the top of your smart contract code. ```js import "@redstone-finance/evm-connector/contracts/data-services/MainDemoConsumerBase.sol"; ``` -2. Extend Your Contract: +#### 2. Extend Your Contract: Make your contract use the new features by extending from MainDemoConsumerBase. This is similar to saying your contract inherits abilities from another contract: ```js @@ -76,7 +76,7 @@ contract YourContractName is MainDemoConsumerBase { // Your contract code goes here } ``` -3. Use Data Feeds: +#### 3. Use Data Feeds: Inside your contract, you can now access data provided by RedStone. This code fetches the latest price of ETH and BTC: ```js @@ -92,7 +92,7 @@ uint256 btcPrice = values[1]; ``` For all the supported feeds we provide UI with charts and historical data. -4. Override the following functions (only if necessary - at your own risk): +#### 4. About overriding the following functions (only if necessary - at your own risk): ```isTimestampValid(uint256 receivedTimestamp)``` returns (bool) - to enable custom logic of timestamp validation. You may specify a shorter delay to accept only the most recent price fees. However, on networks with longer block times you may extend this period to avoid rejecting too many transactions. @@ -102,7 +102,7 @@ For all the supported feeds we provide UI with charts and historical data. ```getUniqueSignersThreshold()``` returns (uint256) - to modify number of required signers. The higher number means greater reliability but also higher gas costs. -5. Manual Payload (if needed): +#### 5. About A manual payload (if needed): This approach is helpful if you need to pass the pricing data from one contract to another in your protocol. It's also a solution for cases where your contracts are written in Solidity in a version lower than 0.8.4, making it problematic to extend from the RedstoneConsumerBase contract. In such cases, we recommend deploying a separate Extractor contract that will contain the verification logic: ```js @@ -140,7 +140,7 @@ Working demo examples of the @redstone-finance/evm-connector usage can be found ****Step-by-Step Guide**** -1. Import the Wrapper Code: +#### 1. Import the Wrapper Code: Wrapper code helps your app interact with RedStone's data services seamlessly. Add this line to your JavaScript code: ```js @@ -149,7 +149,7 @@ const { WrapperBuilder } = require("@redstone-finance/evm-connector"); import { WrapperBuilder } from "@redstone-finance/evm-connector"; ``` -2. Wrap Ethers contract +#### 2. Wrap Ethers contract We need to wrap our contract so it can use RedStone's data: ```js @@ -160,7 +160,7 @@ const wrappedContract = WrapperBuilder.wrap(contract).usingDataService({ }); ``` -3. Use the Wrapped Contract: +#### 3. Use the Wrapped Contract: Now, you can call methods on your wrapped contract just like before, but now it will include RedStone's data: ```js wrappedContract.executeYourMethod(); From cd1cbe286071b4cf8ee6a54fd30e070c6f4d886d Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:12:25 +0100 Subject: [PATCH 04/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index cc295c5a..1f668d31 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -33,24 +33,24 @@ Before you begin, you will need to install some tools that our project will use. #### For Foundry Foundry is another tool used for developing on the blockchain. It uses a different method to install packages. -1. Open your terminal. -2. Navigate to your Foundry project directory by typing: +1. Open your terminal +2. Navigate to your Foundry project directory by typing... ```bash cd path/to/your/foundry/project ``` -3. Install the RedStone EVM connector: +3. Install the RedStone EVM connector ``` forge install redstone-finance/redstone-oracles-monorepo ``` -4. Install the OpenZeppelin contracts, which the RedStone connector relies on: +4. Install the OpenZeppelin contracts, which the RedStone connector relies on. ``` forge install OpenZeppelin/openzeppelin-contracts@v4.9.5 ``` -5. Link these new libraries by adding their paths to a file called remappings.txt: +5. Link these new libraries by adding their paths to a file called remappings.txt. ```bash echo "@redstone-finance/evm-connector/dist/contracts/=lib/redstone-oracles-monorepo/packages/evm-connector/contracts/ @openzeppelin/contracts=lib/openzeppelin-contracts/contracts/" >> remappings.txt @@ -62,13 +62,13 @@ Smart contracts are like the rules and logic that run on the blockchain. They ne ****Step-by-Step Guide**** -#### 1. Import RedStone Base Contract: +#### 1. Import RedStone Base Contract Add this line at the top of your smart contract code. ```js import "@redstone-finance/evm-connector/contracts/data-services/MainDemoConsumerBase.sol"; ``` -#### 2. Extend Your Contract: +#### 2. Extend Your Contract Make your contract use the new features by extending from MainDemoConsumerBase. This is similar to saying your contract inherits abilities from another contract: ```js @@ -76,8 +76,8 @@ contract YourContractName is MainDemoConsumerBase { // Your contract code goes here } ``` -#### 3. Use Data Feeds: -Inside your contract, you can now access data provided by RedStone. This code fetches the latest price of ETH and BTC: +#### 3. Use Data Feeds +Inside your contract, you can now access data provided by RedStone. This code fetches the latest price of ETH and BTC. ```js uint256 ethPrice = getOracleNumericValueFromTxMsg(bytes32("ETH")); @@ -92,7 +92,7 @@ uint256 btcPrice = values[1]; ``` For all the supported feeds we provide UI with charts and historical data. -#### 4. About overriding the following functions (only if necessary - at your own risk): +#### 4. About overriding the following functions (only if necessary - at your own risk) ```isTimestampValid(uint256 receivedTimestamp)``` returns (bool) - to enable custom logic of timestamp validation. You may specify a shorter delay to accept only the most recent price fees. However, on networks with longer block times you may extend this period to avoid rejecting too many transactions. @@ -102,9 +102,9 @@ For all the supported feeds we provide UI with charts and historical data. ```getUniqueSignersThreshold()``` returns (uint256) - to modify number of required signers. The higher number means greater reliability but also higher gas costs. -#### 5. About A manual payload (if needed): +#### 5. About A manual payload (if needed) -This approach is helpful if you need to pass the pricing data from one contract to another in your protocol. It's also a solution for cases where your contracts are written in Solidity in a version lower than 0.8.4, making it problematic to extend from the RedstoneConsumerBase contract. In such cases, we recommend deploying a separate Extractor contract that will contain the verification logic: +This approach is helpful if you need to pass the pricing data from one contract to another in your protocol. It's also a solution for cases where your contracts are written in Solidity in a version lower than 0.8.4, making it problematic to extend from the RedstoneConsumerBase contract. In such cases, we recommend deploying a separate Extractor contract that will contain the verification logic. ```js pragma solidity 0.8.4; @@ -140,8 +140,8 @@ Working demo examples of the @redstone-finance/evm-connector usage can be found ****Step-by-Step Guide**** -#### 1. Import the Wrapper Code: -Wrapper code helps your app interact with RedStone's data services seamlessly. Add this line to your JavaScript code: +#### 1. Import the Wrapper Code +Wrapper code helps your app interact with RedStone's data services seamlessly. Add this line to your JavaScript code ```js const { WrapperBuilder } = require("@redstone-finance/evm-connector"); @@ -150,24 +150,24 @@ import { WrapperBuilder } from "@redstone-finance/evm-connector"; ``` #### 2. Wrap Ethers contract -We need to wrap our contract so it can use RedStone's data: +We need to wrap our contract so it can use RedStone's data ```js const yourEthersContract = new ethers.Contract(address, abi, provider); const wrappedContract = WrapperBuilder.wrap(contract).usingDataService({ - dataFeeds: ["ETH", "BTC"], + dataFeeds ["ETH", "BTC"], }); ``` -#### 3. Use the Wrapped Contract: -Now, you can call methods on your wrapped contract just like before, but now it will include RedStone's data: +#### 3. Use the Wrapped Contract +Now, you can call methods on your wrapped contract just like before, but now it will include RedStone's data ```js wrappedContract.executeYourMethod(); ``` ## 4. Testing For Hardhat -Mock Wrapper for Testing: +Mock Wrapper for Testing. Use a mock wrapper to simulate different scenarios without using real data: ```js const { SimpleNumericMockWrapper } = require("@redstone-finance/evm-connector/dist/src/wrappers/SimpleMockNumericWrapper"); From 12fa66f56871b40936e37545c6dd5d6a3e5fe5f6 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:13:39 +0100 Subject: [PATCH 05/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index 1f668d31..cb9e828d 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -12,7 +12,7 @@ Our documentation is designed for non-technical readers to be able implement Red - **Familiarity with Hardhat or Foundry:** Knowing how to use these development environments for building and testing dApps - **OpenZeppelin Contracts:** Understanding and using OpenZeppelin's library. -## ****Step-by-Step Guide**** +# ****Step-by-Step Guide**** ## 1. Install Prerequisites @@ -60,8 +60,6 @@ This command tells Foundry where to find the new tools installed. ## 2. Adjust Your Smart Contracts Smart contracts are like the rules and logic that run on the blockchain. They need to updated to use data from RedStone. -****Step-by-Step Guide**** - #### 1. Import RedStone Base Contract Add this line at the top of your smart contract code. @@ -137,9 +135,6 @@ Working demo examples of the @redstone-finance/evm-connector usage can be found ## 3. Adjust JavaScript Code of Your dApp -****Step-by-Step Guide**** - - #### 1. Import the Wrapper Code Wrapper code helps your app interact with RedStone's data services seamlessly. Add this line to your JavaScript code From 67d01bdfcf193ca7278fa1c5d0f0678a9d18f6fb Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:19:27 +0100 Subject: [PATCH 06/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index cb9e828d..4ac980b1 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -4,7 +4,7 @@ sidebar_label: "⚙️ Core (on-demand feeds)" --- # Setting Up The RedStone Core Model -Our documentation is designed for non-technical readers to be able implement RedStone's Core Model. ****This is our recommended model**** which provides data feeds to dApps only upon request reducing the costs of putting data onto the blockchain. +Our documentation is designed for non-technical readers to be able implement RedStone's Core Model. ****This is our recommended model**** which provides data feeds to dApps only upon request, reducing the costs of putting data onto the blockchain. ## Prerequisites Before You Begin From b7684073a5ebda1bb33f326cbc726334a87e98d3 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:20:17 +0100 Subject: [PATCH 07/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index 4ac980b1..2662c273 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -179,7 +179,7 @@ For Foundry Generate Mock Data: Use Foundry's functions to create mock data packages for testing. Refer to the foundry integration repository for detailed examples. -## Important Notes +# Important Notes - Solidity Version: Ensure your smart contract uses Solidity version 0.8.4 or higher. If using an older version, refer to the manual payload method. - Testing Environment: Avoid using Remix for testing RedStone oracles as it doesn't support the required transaction modifications. - Upgradability: Implement an upgradability mechanism (e.g., multisig or DAO) for your contracts to quickly replace data providers if needed. From 136f0b864e23e4d84451bd0848083e85ba7d1c6d Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:28:57 +0100 Subject: [PATCH 08/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index 2662c273..0b5ef865 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -77,9 +77,12 @@ contract YourContractName is MainDemoConsumerBase { #### 3. Use Data Feeds Inside your contract, you can now access data provided by RedStone. This code fetches the latest price of ETH and BTC. +For a single price: ```js uint256 ethPrice = getOracleNumericValueFromTxMsg(bytes32("ETH")); - +``` +For multiple prices: +```js bytes32[] memory dataFeedIds = new bytes32[](2); dataFeedIds[0] = bytes32("ETH"); dataFeedIds[1] = bytes32("BTC"); From 9af80a69440f3cc948318bd73bda0abd081358f6 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:35:06 +0100 Subject: [PATCH 09/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index 0b5ef865..18d87513 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -12,6 +12,13 @@ Our documentation is designed for non-technical readers to be able implement Red - **Familiarity with Hardhat or Foundry:** Knowing how to use these development environments for building and testing dApps - **OpenZeppelin Contracts:** Understanding and using OpenZeppelin's library. +## Important Notes +- **Solidity Version:** Ensure your smart contract uses Solidity version 0.8.4 or higher. If using an older version, refer to the manual payload method. +- **Testing Environment:** Avoid using Remix for testing RedStone oracles as it doesn't support the required transaction modifications. +- **Upgradability:** Implement an upgradability mechanism (e.g., multisig or DAO) for your contracts to quickly replace data providers if needed. +- **Examples:** You can see examples of the `@redstone-finance/evm-connector` usage in our [dedicated repo with examples](https://github.com/redstone-finance/redstone-evm-examples). + + # ****Step-by-Step Guide**** ## 1. Install Prerequisites @@ -181,9 +188,3 @@ await wrappedContract.yourMethod(); For Foundry Generate Mock Data: Use Foundry's functions to create mock data packages for testing. Refer to the foundry integration repository for detailed examples. - -# Important Notes -- Solidity Version: Ensure your smart contract uses Solidity version 0.8.4 or higher. If using an older version, refer to the manual payload method. -- Testing Environment: Avoid using Remix for testing RedStone oracles as it doesn't support the required transaction modifications. -- Upgradability: Implement an upgradability mechanism (e.g., multisig or DAO) for your contracts to quickly replace data providers if needed. -- You can see examples of the `@redstone-finance/evm-connector` usage in our [dedicated repo with examples](https://github.com/redstone-finance/redstone-evm-examples). From 6793a113a44762747fc62c463815faa63b98a05d Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:36:47 +0100 Subject: [PATCH 10/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index 18d87513..61b1d870 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -6,13 +6,13 @@ sidebar_label: "⚙️ Core (on-demand feeds)" # Setting Up The RedStone Core Model Our documentation is designed for non-technical readers to be able implement RedStone's Core Model. ****This is our recommended model**** which provides data feeds to dApps only upon request, reducing the costs of putting data onto the blockchain. -## Prerequisites Before You Begin +### Prerequisites Before You Begin: - **Basic Knowledge of Smart Contracts:** Understanding how to implement and interact with smart contracts. - **Familiarity with Hardhat or Foundry:** Knowing how to use these development environments for building and testing dApps - **OpenZeppelin Contracts:** Understanding and using OpenZeppelin's library. -## Important Notes +### Important Notes: - **Solidity Version:** Ensure your smart contract uses Solidity version 0.8.4 or higher. If using an older version, refer to the manual payload method. - **Testing Environment:** Avoid using Remix for testing RedStone oracles as it doesn't support the required transaction modifications. - **Upgradability:** Implement an upgradability mechanism (e.g., multisig or DAO) for your contracts to quickly replace data providers if needed. From ce58161f423be99ff9836cbfefb0ffe99c9398e9 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:44:29 +0100 Subject: [PATCH 11/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index 61b1d870..6db6fdc6 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -187,4 +187,4 @@ await wrappedContract.yourMethod(); ``` For Foundry Generate Mock Data: -Use Foundry's functions to create mock data packages for testing. Refer to the foundry integration repository for detailed examples. +Use Foundry's functions to create mock data packages for testing. Refer to the [foundry integration repository](https://github.com/redstone-finance/minimal-foundry-repo) for detailed examples. From 7bd379b7cccf2da257eba94ccaf873cda78f4eca Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:46:37 +0100 Subject: [PATCH 12/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index 6db6fdc6..4a44d6d2 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -188,3 +188,4 @@ await wrappedContract.yourMethod(); For Foundry Generate Mock Data: Use Foundry's functions to create mock data packages for testing. Refer to the [foundry integration repository](https://github.com/redstone-finance/minimal-foundry-repo) for detailed examples. + From 74e849cc12b65e33ad75e49039a4cbc88f60f923 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Thu, 1 Aug 2024 11:32:18 +0100 Subject: [PATCH 13/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index 4a44d6d2..0676b669 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -9,7 +9,7 @@ Our documentation is designed for non-technical readers to be able implement Red ### Prerequisites Before You Begin: - **Basic Knowledge of Smart Contracts:** Understanding how to implement and interact with smart contracts. -- **Familiarity with Hardhat or Foundry:** Knowing how to use these development environments for building and testing dApps +- **Familiarity with Hardhat or Foundry:** Knowing how to use these development environments for building and testing dApps. - **OpenZeppelin Contracts:** Understanding and using OpenZeppelin's library. ### Important Notes: @@ -74,7 +74,7 @@ Add this line at the top of your smart contract code. import "@redstone-finance/evm-connector/contracts/data-services/MainDemoConsumerBase.sol"; ``` #### 2. Extend Your Contract -Make your contract use the new features by extending from MainDemoConsumerBase. This is similar to saying your contract inherits abilities from another contract: +Make your contract use the new features by extending from MainDemoConsumerBase. This is similar to saying your contract inherits abilities from another contract. ```js contract YourContractName is MainDemoConsumerBase { @@ -110,7 +110,7 @@ For all the supported feeds we provide UI with charts and historical data. ```getUniqueSignersThreshold()``` returns (uint256) - to modify number of required signers. The higher number means greater reliability but also higher gas costs. -#### 5. About A manual payload (if needed) +#### 5. About a manual payload (if needed) This approach is helpful if you need to pass the pricing data from one contract to another in your protocol. It's also a solution for cases where your contracts are written in Solidity in a version lower than 0.8.4, making it problematic to extend from the RedstoneConsumerBase contract. In such cases, we recommend deploying a separate Extractor contract that will contain the verification logic. ```js From 01e2bc88ec4eb4fda65fcb352fbe797da11de811 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:13:28 +0100 Subject: [PATCH 14/81] Update redstone-classic.md --- docs/get-started/models/redstone-classic.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/get-started/models/redstone-classic.md b/docs/get-started/models/redstone-classic.md index 36e45d28..c9f1f55a 100644 --- a/docs/get-started/models/redstone-classic.md +++ b/docs/get-started/models/redstone-classic.md @@ -4,23 +4,24 @@ sidebar_label: "🏛 Classic (push model)" --- # 🏛 Classic Model -## Pushing feeds on chain +The RedStone Classic Model is designed for dApps that would like access to data feeds that is compatable with the traditional design of oracles. To access cost-minimized and reduced latency data feeds check out the [RedStone Core Model](https://docs.redstone.finance/docs/get-started/models/redstone-core). -Although the pure on-demand fetching model ([RedStone Core](./redstone-core.mdx)) is more efficient and scalable we acknowledge that some protocols may prefer to stick to a traditional design when data is pushed on-chain. This setup could be reasonable if: +#### How Should use the Classic Model? - There is an existing well-audited codebase and the team prefers not to make even tiny amendments - The protocol is deployed on a private network or a chain where the gas costs are minimal - The prices don't need to be updated too frequently -:::info -RedStone Classic has a significant advantage over traditional push Oracles. Our modular design gives you a decisive voice on when and how the price is updated (with other Oracles you have to accept dictated parameters). -::: ## How RedStone Classic works This approach is built on top of the [RedStone Core](./redstone-core.mdx) model maintaining the security of on-chain validation of data providers and timestamps. The model consists of two main parts. The first one is the off-chain [relayer](#relayer) responsible for pushing data on-chain in a customized way using [environment variables](#environment-variables). The second part is the on-chain [contracts](#contracts) which enable storing prices and getting them through a familiar interface (e.g. the [Chainlink Aggregator](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.7/interfaces/AggregatorV3Interface.sol) ). RedStone Classic can be used on all EVM-compatible L1s & L2s + Starknet + Fuel Network. +:::info +RedStone Classic has a significant advantage over traditional push Oracles. Our modular design gives you a decisive voice on when and how the price is updated (with other Oracles you have to accept dictated parameters). +::: + ![RedStone Classic diagram](/img/redstone-classic.png) From f2e318d70d9be6a42f92c63ffac8ae06f2482f94 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:23:30 +0100 Subject: [PATCH 15/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index 0676b669..de4cb363 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -4,8 +4,7 @@ sidebar_label: "⚙️ Core (on-demand feeds)" --- # Setting Up The RedStone Core Model -Our documentation is designed for non-technical readers to be able implement RedStone's Core Model. ****This is our recommended model**** which provides data feeds to dApps only upon request, reducing the costs of putting data onto the blockchain. - +Our documentation is designed for non-technical readers to be able implement RedStone's Core Model. ****This is our recommended model**** which provides data feeds to dApps only upon request, reducing the costs of putting data onto the blockchain. To learn more about how RedStone brings data on-chain, check out the [Data Formatting and Processing](https://docs.redstone.finance/docs/get-started/data-formatting-processing) section. ### Prerequisites Before You Begin: - **Basic Knowledge of Smart Contracts:** Understanding how to implement and interact with smart contracts. From a7b8d8d34a1b6c1af593880e10c6a28cdaaa7f99 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:26:33 +0100 Subject: [PATCH 16/81] Update redstone-classic.md --- docs/get-started/models/redstone-classic.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/get-started/models/redstone-classic.md b/docs/get-started/models/redstone-classic.md index c9f1f55a..4b6a2f49 100644 --- a/docs/get-started/models/redstone-classic.md +++ b/docs/get-started/models/redstone-classic.md @@ -12,15 +12,15 @@ The RedStone Classic Model is designed for dApps that would like access to data - The protocol is deployed on a private network or a chain where the gas costs are minimal - The prices don't need to be updated too frequently +:::info +RedStone Classic has a significant advantage over traditional push Oracles. Our modular design gives you a decisive voice on when and how the price is updated (with other Oracles you have to accept dictated parameters). +::: ## How RedStone Classic works This approach is built on top of the [RedStone Core](./redstone-core.mdx) model maintaining the security of on-chain validation of data providers and timestamps. The model consists of two main parts. The first one is the off-chain [relayer](#relayer) responsible for pushing data on-chain in a customized way using [environment variables](#environment-variables). The second part is the on-chain [contracts](#contracts) which enable storing prices and getting them through a familiar interface (e.g. the [Chainlink Aggregator](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.7/interfaces/AggregatorV3Interface.sol) ). RedStone Classic can be used on all EVM-compatible L1s & L2s + Starknet + Fuel Network. -:::info -RedStone Classic has a significant advantage over traditional push Oracles. Our modular design gives you a decisive voice on when and how the price is updated (with other Oracles you have to accept dictated parameters). -::: ![RedStone Classic diagram](/img/redstone-classic.png) From edd7294a37152069ff7c2b3836b5c7832f234669 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:23:26 +0100 Subject: [PATCH 17/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index de4cb363..554480d3 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -4,7 +4,7 @@ sidebar_label: "⚙️ Core (on-demand feeds)" --- # Setting Up The RedStone Core Model -Our documentation is designed for non-technical readers to be able implement RedStone's Core Model. ****This is our recommended model**** which provides data feeds to dApps only upon request, reducing the costs of putting data onto the blockchain. To learn more about how RedStone brings data on-chain, check out the [Data Formatting and Processing](https://docs.redstone.finance/docs/get-started/data-formatting-processing) section. +****This is our recommended model**** which provides data feeds to dApps only upon request, reducing the costs of putting data onto the blockchain. To learn more about how RedStone brings data on-chain, check out the [Data Formatting and Processing](https://docs.redstone.finance/docs/get-started/data-formatting-processing) section. ### Prerequisites Before You Begin: - **Basic Knowledge of Smart Contracts:** Understanding how to implement and interact with smart contracts. @@ -13,7 +13,7 @@ Our documentation is designed for non-technical readers to be able implement Red ### Important Notes: - **Solidity Version:** Ensure your smart contract uses Solidity version 0.8.4 or higher. If using an older version, refer to the manual payload method. -- **Testing Environment:** Avoid using Remix for testing RedStone oracles as it doesn't support the required transaction modifications. +- **Testing Environment:** Remix is not supported for testing RedStone Oracles. - **Upgradability:** Implement an upgradability mechanism (e.g., multisig or DAO) for your contracts to quickly replace data providers if needed. - **Examples:** You can see examples of the `@redstone-finance/evm-connector` usage in our [dedicated repo with examples](https://github.com/redstone-finance/redstone-evm-examples). @@ -22,25 +22,21 @@ Our documentation is designed for non-technical readers to be able implement Red ## 1. Install Prerequisites -Before you begin, you will need to install some tools that our project will use. - #### For Hardhat -1. Open your terminal (this is where you type commands to your computer). -2. To add the RedStone EVM connector package, type one of these commands: - - If you're using Yarn (a package manager for JavaScript): +1. To add the RedStone EVM connector package, type one of these commands: + - If you're using Yarn: ```bash yarn add @redstone-finance/evm-connector ``` - - If you're using npm (another package manager for JavaScript): + - If you're using npm: ```bash npm install @redstone-finance/evm-connector ``` #### For Foundry -Foundry is another tool used for developing on the blockchain. It uses a different method to install packages. 1. Open your terminal -2. Navigate to your Foundry project directory by typing... +2. Navigate to your Foundry project directory ```bash cd path/to/your/foundry/project ``` @@ -61,10 +57,8 @@ Foundry is another tool used for developing on the blockchain. It uses a differe echo "@redstone-finance/evm-connector/dist/contracts/=lib/redstone-oracles-monorepo/packages/evm-connector/contracts/ @openzeppelin/contracts=lib/openzeppelin-contracts/contracts/" >> remappings.txt ``` -This command tells Foundry where to find the new tools installed. ## 2. Adjust Your Smart Contracts -Smart contracts are like the rules and logic that run on the blockchain. They need to updated to use data from RedStone. #### 1. Import RedStone Base Contract Add this line at the top of your smart contract code. @@ -73,7 +67,7 @@ Add this line at the top of your smart contract code. import "@redstone-finance/evm-connector/contracts/data-services/MainDemoConsumerBase.sol"; ``` #### 2. Extend Your Contract -Make your contract use the new features by extending from MainDemoConsumerBase. This is similar to saying your contract inherits abilities from another contract. +Make your contract use the new features by extending from MainDemoConsumerBase. ```js contract YourContractName is MainDemoConsumerBase { @@ -145,7 +139,6 @@ Working demo examples of the @redstone-finance/evm-connector usage can be found ## 3. Adjust JavaScript Code of Your dApp #### 1. Import the Wrapper Code -Wrapper code helps your app interact with RedStone's data services seamlessly. Add this line to your JavaScript code ```js const { WrapperBuilder } = require("@redstone-finance/evm-connector"); @@ -154,7 +147,6 @@ import { WrapperBuilder } from "@redstone-finance/evm-connector"; ``` #### 2. Wrap Ethers contract -We need to wrap our contract so it can use RedStone's data ```js const yourEthersContract = new ethers.Contract(address, abi, provider); @@ -165,7 +157,7 @@ const wrappedContract = WrapperBuilder.wrap(contract).usingDataService({ ``` #### 3. Use the Wrapped Contract -Now, you can call methods on your wrapped contract just like before, but now it will include RedStone's data + ```js wrappedContract.executeYourMethod(); ``` From d963943ec05985dce2e803852775d66a575082b0 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:37:55 +0100 Subject: [PATCH 18/81] Create Security-Measures.md --- Security-Measures.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Security-Measures.md diff --git a/Security-Measures.md b/Security-Measures.md new file mode 100644 index 00000000..f851608c --- /dev/null +++ b/Security-Measures.md @@ -0,0 +1,26 @@ +## How RedStone Ensures Secure and Accurate Data Feeds + +RedStone has secured billions of dollars to date without being hacked or reporting a compromised price feed. This strong track record is a testament to the robust security and accuracy measures in place. + +### Cryptographic Signatures and Auditing + +To ensure the integrity of incoming data feeds, RedStone nodes cryptographically sign incoming data from over 180 data providers. All data is signed using the elliptical curve signature, secp-256, commonly used in Ethereum Virtual Machine (EVM) environments. This process attributes the data to its source, providing proof of origin and ensuring the data is tamper-proof. The signed data is pushed to the blockchain, where it can be verified by RedStone and any party wishing to evaluate its integrity. The availability of on-chain data serves as a historical record, ensuring a permanent and verifiable audit trail. + +RedStone's commitment to security is further demonstrated through regular auditing of their smart contracts by reputable firms, including Audit One, PeckShield, and ABDK. These smart contracts are also open-source, allowing public scrutiny at any time. + +### Reliability + +RedStone continuously monitors its price feeds for abnormalities, checking liquid staking price feeds for slippage every 10 seconds. Node operators use RedStone’s software to detect any suspicious activity, ensuring data accuracy. RedStone relies on Arweave, a decentralized data storage network, to store some of its processed data, allowing individuals to verify the accuracy of data used by decentralized applications (dApps). To enhance data reliability, RedStone sources its data from a diverse range of centralized exchanges (CEXs), decentralized exchanges (DEXs), and data aggregators. If one source is compromised, it can be immediately removed, allowing dApps to customize their data feeds. + +For use cases prone to front-running, RedStone implements a system where users initiate transactions by recording their intent to interact with a protocol on-chain, without including the price at the time of execution. This approach mitigates the risk of arbitrage attempts through front-running. RedStone also implements rigorous internal processes to protect against potential attacks, ensuring ongoing system security. + +### Redundancy + +RedStone incorporates liquidity weighting to automatically detect low liquidity and high slippage in data sources. Multiple layers of redundant monitoring are employed across the system. For example, RedStone uses multiple relayers for data pushing and broadcasting, ensuring that anyone can push price data on-chain. Geographically distributed gateways on multiple infrastructure providers further enhance data broadcasting. RedStone also leverages Pub/Sub networks like StreamR for decentralized data distribution through a network of nodes, supporting continuous data feeds. + +RedStone’s decentralized gossiping nodes allow anyone to spin up a node and participate in the data network, enhancing decentralization and resilience. The data delivery system includes master relayers supported by shadow relayers that automatically activate if primary relayers fail. Gelato automation further enhances system reliability. The relayer code is open-source, allowing anyone to push data on-chain without permission. + +### Conclusion + +RedStone avoids single points of failure by minimizing dependence on third parties and sourcing data directly from liquidity pools and providers like Kaiko. The modular architecture ensures that if one service fails, others automatically take over. Together, these features make RedStone Oracles secure and reliable. + From 1ffc84cf4930c2a68bb739a62847d5cd7ee51715 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:41:58 +0100 Subject: [PATCH 19/81] Update and rename Security-Measures.md to Security-And-Accuracy-Measures.md --- ...y-Measures.md => Security-And-Accuracy-Measures.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) rename Security-Measures.md => Security-And-Accuracy-Measures.md (78%) diff --git a/Security-Measures.md b/Security-And-Accuracy-Measures.md similarity index 78% rename from Security-Measures.md rename to Security-And-Accuracy-Measures.md index f851608c..c670e8f0 100644 --- a/Security-Measures.md +++ b/Security-And-Accuracy-Measures.md @@ -1,5 +1,4 @@ -## How RedStone Ensures Secure and Accurate Data Feeds - +# How RedStone Ensures Secure and Accurate Data Feeds RedStone has secured billions of dollars to date without being hacked or reporting a compromised price feed. This strong track record is a testament to the robust security and accuracy measures in place. ### Cryptographic Signatures and Auditing @@ -20,7 +19,11 @@ RedStone incorporates liquidity weighting to automatically detect low liquidity RedStone’s decentralized gossiping nodes allow anyone to spin up a node and participate in the data network, enhancing decentralization and resilience. The data delivery system includes master relayers supported by shadow relayers that automatically activate if primary relayers fail. Gelato automation further enhances system reliability. The relayer code is open-source, allowing anyone to push data on-chain without permission. -### Conclusion - RedStone avoids single points of failure by minimizing dependence on third parties and sourcing data directly from liquidity pools and providers like Kaiko. The modular architecture ensures that if one service fails, others automatically take over. Together, these features make RedStone Oracles secure and reliable. +### Accuracy of Data Feeds + +RedStone ensures accurate price feeds through several mechanisms. Liquidity weighting accounts for the size of liquidity pools, preventing smaller pools from significantly impacting overall price accuracy. Outlier detection monitors for price deviations, safeguarding against inaccuracies. By sourcing data directly from liquidity pools of a diverse range of DEXs and CEXs, RedStone minimizes the risk of a single point of failure and speeds up data retrieval. + +RedStone also calculates the median value from its data sources, reducing the risk of misreporting. Implementing RedStone’s smart contracts allows dApp developers to choose their data sources and immediately stop receiving data from a specific source, ensuring continuous accuracy. These mechanisms have ensured that RedStone has never reported an incorrect price feed that harmed protocol users, demonstrating a strong commitment to client needs. + From aedf18173ea3ce7b15c031bfc36878bc021965d2 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:44:21 +0100 Subject: [PATCH 20/81] Update Security-And-Accuracy-Measures.md --- Security-And-Accuracy-Measures.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Security-And-Accuracy-Measures.md b/Security-And-Accuracy-Measures.md index c670e8f0..81744377 100644 --- a/Security-And-Accuracy-Measures.md +++ b/Security-And-Accuracy-Measures.md @@ -1,6 +1,8 @@ -# How RedStone Ensures Secure and Accurate Data Feeds +# Security and Accuracy of Data Feeds Explained RedStone has secured billions of dollars to date without being hacked or reporting a compromised price feed. This strong track record is a testament to the robust security and accuracy measures in place. +## Security + ### Cryptographic Signatures and Auditing To ensure the integrity of incoming data feeds, RedStone nodes cryptographically sign incoming data from over 180 data providers. All data is signed using the elliptical curve signature, secp-256, commonly used in Ethereum Virtual Machine (EVM) environments. This process attributes the data to its source, providing proof of origin and ensuring the data is tamper-proof. The signed data is pushed to the blockchain, where it can be verified by RedStone and any party wishing to evaluate its integrity. The availability of on-chain data serves as a historical record, ensuring a permanent and verifiable audit trail. @@ -21,7 +23,7 @@ RedStone’s decentralized gossiping nodes allow anyone to spin up a node and pa RedStone avoids single points of failure by minimizing dependence on third parties and sourcing data directly from liquidity pools and providers like Kaiko. The modular architecture ensures that if one service fails, others automatically take over. Together, these features make RedStone Oracles secure and reliable. -### Accuracy of Data Feeds +## Accuracy RedStone ensures accurate price feeds through several mechanisms. Liquidity weighting accounts for the size of liquidity pools, preventing smaller pools from significantly impacting overall price accuracy. Outlier detection monitors for price deviations, safeguarding against inaccuracies. By sourcing data directly from liquidity pools of a diverse range of DEXs and CEXs, RedStone minimizes the risk of a single point of failure and speeds up data retrieval. From 659cf0ad916d2ef8558b28a84e0d8d8602428082 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Wed, 14 Aug 2024 13:22:01 +0100 Subject: [PATCH 21/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index 554480d3..a2ece436 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -7,7 +7,7 @@ sidebar_label: "⚙️ Core (on-demand feeds)" ****This is our recommended model**** which provides data feeds to dApps only upon request, reducing the costs of putting data onto the blockchain. To learn more about how RedStone brings data on-chain, check out the [Data Formatting and Processing](https://docs.redstone.finance/docs/get-started/data-formatting-processing) section. ### Prerequisites Before You Begin: -- **Basic Knowledge of Smart Contracts:** Understanding how to implement and interact with smart contracts. +- **Knowledge of Smart Contracts:** Understanding how to implement and interact with smart contracts. - **Familiarity with Hardhat or Foundry:** Knowing how to use these development environments for building and testing dApps. - **OpenZeppelin Contracts:** Understanding and using OpenZeppelin's library. From 92bdbc71477457a23395affc56386d7a6761a8c5 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 09:13:17 +0100 Subject: [PATCH 22/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index a2ece436..9203002e 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -3,7 +3,7 @@ sidebar_position: 1 sidebar_label: "⚙️ Core (on-demand feeds)" --- -# Setting Up The RedStone Core Model +# The RedStone Core Model ****This is our recommended model**** which provides data feeds to dApps only upon request, reducing the costs of putting data onto the blockchain. To learn more about how RedStone brings data on-chain, check out the [Data Formatting and Processing](https://docs.redstone.finance/docs/get-started/data-formatting-processing) section. ### Prerequisites Before You Begin: From df3030dfadc0694541d3c8be48077a427057f7e8 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:09:41 +0100 Subject: [PATCH 23/81] Update redstone-x.md --- docs/get-started/models/redstone-x.md | 118 ++++++++++++++------------ 1 file changed, 66 insertions(+), 52 deletions(-) diff --git a/docs/get-started/models/redstone-x.md b/docs/get-started/models/redstone-x.md index 738c3df4..389578cd 100644 --- a/docs/get-started/models/redstone-x.md +++ b/docs/get-started/models/redstone-x.md @@ -3,95 +3,109 @@ sidebar_position: 3 sidebar_label: "⏱ X (no front-running)" --- -# ⏱ RedStone X -## An eXtreme protection against front-running +# RedStone X Model -The model implements a `Deferred execution pattern` where transactions are processed in two steps: +The RedStone X model is designed to meet the needs of advanced protocols, such as perpetuals, options, and derivatives. By providing price feeds at the very next block after users initiate transactions, this model eliminates front-running risks. -1. A user initiates the transaction by recording on-chain an intention to interact with the protocol (ie. open a perpetual position) without knowing the exact context (ie. price) in which the transaction will be executed. This mitigates any attempts to arbitrage the protocols by front-running price delivery from Oracles. +## Key Requirements +- **Adjust Contracts for 2-Phase Execution:** Modify your smart contracts to execute price-sensitive transactions in two phases: request and execution. +- **Deploy a Keeper Service:** Set up a keeper service that automatically fetches the price data and triggers the transaction execution. -2. The price is pushed on-chain only in the second step, which usually happens at the very next block. Anyone (including the user himself) could push the price, as its integrity is validated on-chain based on the protocol constraints. Such a price will be used to finally settle the transaction. +## How It Works +The model implements a `Deferred Execution Pattern`, where transactions are processed in two distinct steps: -This model was popularised by perpetual protocols such as [GMX](https://gmx.io/#/) and it enables a new wave of super-efficient DeFi projects that are rapidly growing despite the bear market. +1. **Transaction Initiation:** + A user initiates a transaction by recording an on-chain intention to interact with the protocol (e.g., opening a perpetual position) without knowing the exact context (such as price) at the time of execution. This mitigates front-running attempts by preventing price manipulation before the transaction is settled. -:::important Requirements -TLDR; You need to do 2 things: +2. **Price Delivery and Transaction Execution:** + The price is pushed on-chain in the next step, typically in the very next block. Anyone, including the user, can push the price, as its integrity is validated on-chain according to the protocol's constraints. This price is then used to finalize the transaction. -1. Adjust your contracts to execute price-sensitive transactions in 2-phases (request -> execution). +## Step-by-Step Guide to Update Smart Contracts -2. Deploy a keeper service that automatically fetches the price and triggers the execution. -::: - -![RedStone X diagram](/img/redstone-x.png) +### Phase 1: Transaction Request -## Updating smart contract code +When a user wants to execute a price-sensitive transaction, we need to collect some collateral, record request parameters, and ask keepers to provide price data. -### Phase 1 - request +#### Example: Swapping ETH to USDC -When a user wants to execute a price-sensitive transaction we need to collect some collateral, record request parameters, and ask keepers to provide price data. +For illustrative purposes, consider a simple protocol that allows swapping a native currency (like ETH) for a stablecoin (like USDC). The code for recording the transaction might look like this: -To clarify the steps, let's look at them in the context of a more concrete example. There is a simple protocol that allows swaping a native currency (like ETH) to a stable coin (like USDC). The sample code to record the transaction may look as follows: -``` +```solidity function changeEthToUsdc() external payable { - bytes32 requestHash = calculateHashForSwapRequest( - msg.value, - msg.sender, - block.number - ); - requestedSwaps[requestHash] = true; - - emit NewOracleDataRequest(msg.value, msg.sender, block.number); - } + bytes32 requestHash = calculateHashForSwapRequest( + msg.value, + msg.sender, + block.number + ); + requestedSwaps[requestHash] = true; + + emit NewOracleDataRequest(msg.value, msg.sender, block.number); +} ``` +#### Explanation: -In the function above we: - -1) Collect the collateral from the user keeping the eth that is attached to the transaction. This protects us from spamming the protocol with empty requests. +1. **Collateral Collection:** + - The contract collects the ETH attached to the transaction as collateral. + - This prevents us from spamming the protocol with empty requests. -2) Notarize all the necessary parameters of the user's request that will be necessary to validate the execution step. In the context of our example, let's seal the values of: -- amount of funds to swap `msg.value` -- address of the caller `msg.sender` -- time when the transaction is submitted (it will be necessary to deliver a matching price) `block.number` (Keeping the timestamp as block number or hash is better because the on-chain timestamping may not be fully synchronized with the global clock posing a risk of malicious arbitrage). +2. **Notarizing Request Parameters:** + The contract notarizes all the necessary parameters of the user's request that will be necessary to validate the execution step. We do not need to store all the data on-chain; it is sufficient to record a hash of the values mentioned above. Keeping the timestamp as a block number or hash is better because on-chain timestamping may not be fully synchronized with the global clock, posing a risk of malicious arbitrage. -We do not need to store all the data on-chain. It's sufficient to record a hash of the values mentioned above. + In this example, the following parameters are sealed: + - Amount of ETH to swap (`msg.value`) + - Address of the caller (`msg.sender`) + - Block number when the transaction is submitted (`block.number`) -3) Notify the keepers' network about the new request to receive price data by emiting the `NewOracleDataRequest` event. +3. **Keeper Network Notification:** + - The contract emits the `NewOracleDataRequest` event to notify the keepers' network of the new request. + - This signals the need for price data to complete the transaction in the next phase. -### Phase 2 - execution +### Phase 2: Transaction Execution -In this phase, the request from a user is executed with data received from the keeper network. -Let us analyse the necessary steps in the context of our example with swapping eth -> usdc. +In this phase, the request from a user is executed with data received from the keeper network. Let us analyse the necessary steps in the context of our example with swapping ETH to USDC +. +#### Example: Executing ETH to USDC Swap -``` +```solidity function executeWithOracleData( uint256 ethToSwap, address requestedBy, uint256 requestedAtBlock - ) external payable { - - // Check if the request actually exists - bytes32 requestHash = - calculateHashForSwapRequest(avaxToSwap, requestedBy, requestedAtBlock); - require(requestedSwaps[requestHash], - "Can not find swap request with the given params"); +) external payable { + + // Verify that the request exists + bytes32 requestHash = calculateHashForSwapRequest( + ethToSwap, requestedBy, requestedAtBlock + ); + require(requestedSwaps[requestHash], + "Cannot find swap request with the given parameters"); delete requestedSwaps[requestHash]; - // We need to validate the timestamp (block.number) + // Validate the timestamp (block number) uint256 dataPackagesBlockNumber = extractTimestampsAndAssertAllAreEqual(); - require(dataPackagesBlockNumber == requestedAtBlock, "Block number mismatch in payload and request"); + require(dataPackagesBlockNumber == requestedAtBlock, + "Block number mismatch between payload and request"); // Transfer USDC to the user uint256 usdcAmount = getExpectedUsdAmount(ethToSwap); usdc.transfer(requestedBy, usdcAmount); } + ``` +#### Explanation: -1) We need to validate if the parameters provided by keepers match the ones notarized by the user. +1. **Parameter Validation:** + - We need to validate if the parameters provided by the keepers match the ones notarized by the user. -2) Then we check if the timestamp (block number) for which the price is sourced matches the time when the request was recorded. +2. **Timestamp Verification:** + - Then we check if the timestamp (block number) for which the price is sourced matches the time when the request was recorded. -3) If all of the above checks are fine, we can send the appropriate value of usdc back to the user who originated the request +3. **Final Settlement:** + - If all of the above checks are fine, we can send the appropriate value of USDC back to the user who originated the request. + :::info Full code for the example The full code for the example above is available in [our workshop explaining 3 different models](https://github.com/redstone-finance/avalanche-workshop). ::: + + From 77498f4bdc9664e2ff512d5bff7a444b1b1493b2 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:18:16 +0100 Subject: [PATCH 24/81] Update Introduction.md --- docs/Introduction.md | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/docs/Introduction.md b/docs/Introduction.md index 5d916bce..5c2caf2d 100644 --- a/docs/Introduction.md +++ b/docs/Introduction.md @@ -2,33 +2,31 @@ sidebar_position: 1 sidebar_label: "♦️ What is RedStone Oracles?" --- +# Introduction ## Overview +There is a growing need for decentralized applications (dApps) to access data feeds that are frequently updated, reliable, and secure. RedStone Oracles is a leading oracle provider directly fulfilling this need. Trusted by 100+ dApps and securing billions of dollars of value, RedStone provides customizable and cost-efficient data streams for builders, empowering the next generation of dApps. -There is a growing need for decentralized applications (dApps) to access data feeds that are frequently updated, reliable, and secure. RedStone Oracles is a leading oracle provider directly fulfilling this need. Trusted by 100+ dApps and securing billions of dollars of value, RedStone provides customizable and cost-efficient data streams for builders empowering the next generation of dApps. RedStone also provides data feeds to blockchains and layer 2 scaling solutions across the entire blockchain ecosystem that are both EVM and non-EVM compatible. The current model of oracle systems suffers from key inefficiencies, all of which RedStone Oracles was specifically designed to solve from the bottom up. This makes RedStone a unique oracle service. +RedStone also provides data feeds to blockchains and layer 2 scaling solutions across the entire blockchain ecosystem that are both EVM and non-EVM compatible. The current model of oracle systems suffers from key inefficiencies, all of which RedStone Oracles was specifically designed to solve from the bottom up. This makes RedStone a unique oracle service. ## The Problems RedStone Solves ♦️ -### Problem # 1: The standard approach of providing data to applications is inefficient and expensive. -- The standard method of providing data is to ‘push’ the data onto the blockchain regardless of whether it is used by an application. This results in paying more for data and dedicating resources that could be used elsewhere. +### Problem #1: The standard approach of providing data to applications is inefficient and expensive. +The standard method of providing data is to ‘push’ the data onto the blockchain regardless of whether it is used by an application. This results in paying more for data and dedicating resources that could be used elsewhere. -#### Our Solution +**Our Solution** +RedStone allows data to be provided on-demand rather than on a fixed schedule, reducing the costs of putting data 'on-chain'. This is achieved by storing data off of the blockchain as cryptographically signed packages and allowing smart contracts of dApps to fetch data when necessary. -RedStone allows data to be provided on-demand rather than on a fixed schedule, reducing the costs of putting data 'on-chain'. This is achieved by storing data off of the blockchain as cryptography signed packages and allowing smart contracts of dApps to fetch data when necessary. - -_A note on data integrity_: To maintain data integrity RedStone also provides data feeds to Arweave, a decentralized network that provides data storage. Arweave's decentralized network makes it tamper-proof, therefore any data provided by RedStone to Arweave acts as a unbiased source of truth about the historical data provided by RedStone. - -Overall, RedStone's approach improves efficiency for dApps and significantly reduces the costs for dApps to access data feeds. +*Note on Data Integrity:* +To maintain data integrity, RedStone also provides data feeds to Arweave, a decentralized network that provides data storage. Arweave's decentralized network makes it tamper-proof; therefore, any data provided by RedStone to Arweave acts as an unbiased source of truth about the historical data provided by RedStone. +Overall, RedStone's approach improves efficiency for dApps and significantly reduces the costs for dApps to access data feeds. ### Problem #2: The typical monolithic architecture of oracles limits scalability. +A consequence of a monolithic architecture is that it makes it challenging for protocols to reduce latency and list new assets. -- A consequence of a monolithic architecture is that makes it challenging for protocols to reduce latency and list new assets. - -#### Our Solution - -RedStone was designed with a modular architecture making it easy to incorporate new assets and reduce latency, allowing dApps to scale more efficiently. This means constructing the oracle in such a way that its various components—such as data sources, validation mechanisms, and delivery methods—can be easily interchanged, updated, or augmented without disrupting the system’s overall functionality. - +**Our Solution** +RedStone was designed with a modular architecture, making it easy to incorporate new assets and reduce latency, allowing dApps to scale more efficiently. This means constructing the oracle in such a way that its various components—such as data sources, validation mechanisms, and delivery methods—can be easily interchanged, updated, or augmented without disrupting the system’s overall functionality. ## Key facts From c1a0cac9a019cd87487fe14cca8eed31e2e6481a Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:23:03 +0100 Subject: [PATCH 25/81] Update selecting-redstone-model.md --- docs/get-started/selecting-redstone-model.md | 23 ++++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/docs/get-started/selecting-redstone-model.md b/docs/get-started/selecting-redstone-model.md index 2735b449..adbbc942 100644 --- a/docs/get-started/selecting-redstone-model.md +++ b/docs/get-started/selecting-redstone-model.md @@ -3,26 +3,31 @@ sidebar_position: 1 sidebar_label: "👀 Selecting a RedStone Model" --- -# RedStone Offers Three Solutions +# RedStone Offers Three Models ## 1. [RedStone Core Model](./models/redstone-core) -In RedStone’s innovative Core Model, data is dynamically injected into user transactions achieving maximum gas efficiency. This approach is user-friendly as the whole process fits into a single transaction. The Core Model significantly reduces the costs for dApps to access data feeds. -#### Best suited for dApps that would like access to several price feeds with frequent and cost-effective updates. +In RedStone’s innovative **Core Model**, data is dynamically injected into user transactions, achieving maximum gas efficiency. This approach is user-friendly as the whole process fits into a single transaction. The Core Model significantly reduces the costs for dApps to access data feeds. +**Best suited for:** +dApps that need access to several price feeds with frequent and cost-effective updates. ## 2. [RedStone Classic Model](./models/redstone-classic) -RedStone’s Classic model is designed for applications looking for the traditional oracle model of data being put onto the blockchain with longer intervals providing full control of the data source and the conditions for updates. -#### Best suited for dApps that require a lower frequency of data updates, fewer price feeds, or would like to be interchangeable with other oracle providers. +RedStone’s **Classic Model** is designed for applications looking for the traditional oracle model of data being put onto the blockchain at longer intervals, providing full control of the data source and the conditions for updates. +**Best suited for:** +dApps that require a lower frequency of data updates, fewer price feeds, or want to be interchangeable with other oracle providers. -## 3. [RedStone X model](./models/redstone-x) +## 3. [RedStone X Model](./models/redstone-x) -The X model is designed to fulfill the needs of advanced protocols such as perpetuals, options, and derivatives. By providing price feeds at the very next block after users' interactions the X model eliminates any [front-running](https://hacken.io/discover/front-running/) risks. -#### Best suited for perpetuals, options and derivative protocols. +The **X Model** is designed to fulfill the needs of advanced protocols such as perpetuals, options, and derivatives. By providing price feeds at the very next block after users' interactions, the X Model eliminates any [front-running](https://hacken.io/discover/front-running/) risks. +**Best suited for:** +Perpetuals, options, and derivative protocols. # Why We Recommend Our Core Model -The easiest way to make data accessible for applications that use smart contracts is by storing data directly on a blockchain. This approach is effective for large update intervals and a small number of assets. However, an increasing number of decentralized financial (DeFi) applications and modern derivative protocols require lower latency. To solve this problem, RedStone proposes an innovative modular design where data is first put into a [data availability layer](https://www.alchemy.com/overviews/data-availability-layer) and then put on a blockchain only when necessary. This allows for broadcasting a large number of assets more frequently while also reducing the costs for decentralized applications (dApps). +The easiest way to make data accessible for applications that use smart contracts is by storing data directly on a blockchain. This approach is effective for large update intervals and a small number of assets. However, an increasing number of decentralized financial (DeFi) applications and modern derivative protocols require lower latency. + +To solve this problem, RedStone proposes an innovative modular design where data is first put into a data delivery layer and then put on a blockchain only when necessary. This allows for broadcasting a large number of assets more frequently while also reducing the costs for decentralized applications (dApps). From f6c74da2d14722e0c48501647c265e67010dd8fa Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:57:03 +0100 Subject: [PATCH 26/81] Update data-formatting-processing.md --- .../get-started/data-formatting-processing.md | 122 ++++++++---------- 1 file changed, 56 insertions(+), 66 deletions(-) diff --git a/docs/get-started/data-formatting-processing.md b/docs/get-started/data-formatting-processing.md index 07484074..f4ddf808 100644 --- a/docs/get-started/data-formatting-processing.md +++ b/docs/get-started/data-formatting-processing.md @@ -1,99 +1,89 @@ --- sidebar_position: 3 -sidebar_label: "💻 Data Formatting & Processing" +sidebar_label: "Data Formatting & Processing" --- -# How Data Flows to the Blockchain +# Data Flow to the Blockchain: Process and Architecture - - - - -# Overview -The price feeds provided to RedStone’s clients come from a diverse range of sources. This includes exchanges like Binance and Coinbase, decentralized exchanges (DEXs) like Uniswap and Sushiswap, and price aggregators like CoinMarketCap and CoinGecko. RedStone has over 150 sources integrated to date. The data is aggregated by independent nodes operated by data providers using various methodologies. Some methods include median, TWAP, and LWAP, which are all designed to capture the most accurate price by considering factors like the amount of liquidity available, and the average price during specific timeframes. +## Overview of Data Integration -Additionally, data-quality measures are implemented like detecting unexpected values (outlier detection), to ensure the data is correct. Afterward, the cleaned and processed data is then signed by node operators underwriting its quality. The feeds are broadcasted both on the Streamr, a decentralized data network, and directly to open-source gateways which could be easily spun-off when necessary. -The data could be pushed onto the blockchain either by a dedicated relayer operating under predefined conditions, like a specific change in price, by a bot (ie. performing liquidations), or even by end users interacting with the protocol. Inside the protocol, the data is unpacked and verified cryptographically confirming both the origin and timestamps. +RedStone’s price feeds are sourced from a wide array of platforms, including centralized exchanges like Binance and Coinbase, decentralized exchanges (DEXs) such as Uniswap and Sushiswap, and price aggregators like CoinMarketCap and CoinGecko. With over 150 integrated sources, RedStone ensures that data is aggregated by independent nodes using methodologies like median, Time-Weighted Average Price (TWAP), and Liquidity-Weighted Average Price (LWAP). These methods focus on capturing accurate prices by accounting for factors such as available liquidity and price averages over specific timeframes. -# Data Formatting & Processing +To maintain data quality, RedStone employs outlier detection mechanisms to filter unexpected values. The processed data is then signed by node operators to guarantee its integrity. These data feeds are distributed through the Streamr decentralized network and open-source gateways, which can be easily deployed if needed. -### Context +Data can be pushed to the blockchain by a dedicated relayer operating under predefined conditions (e.g., specific price changes), a bot (e.g., performing liquidations), or even by end users interacting with the protocol. Once inside the protocol, the data is unpacked and cryptographically verified, ensuring the authenticity and accuracy of both its origin and timestamp. -Transferring data to a blockchain requires packing an extra payload to a user’s transaction and processing the message on the blockchain. Said differently, the data that is put on the blockchain, such as a cryptocurrency’s price, is inserted into part of the data that makes up a user’s transaction. This is accomplishable because blockchains move from state-to-state and contain call data. RedStone is able insert its data into the call data of a user's transaction, thereby putting the data onto the blockchain. +## Data Encoding and Processing -### How Data is Encoded Before Being Put on the Blockchain +### Context: Understanding Data Transfer to the Blockchain +When transferring data to a blockchain, an additional payload is added to the user’s transaction, which is then processed on-chain. This means that data, such as a cryptocurrency’s price, is embedded within the transaction data. Because blockchains transition from one state to another and contain call data, RedStone can insert its data into the call data of a user’s transaction, effectively recording the data on the blockchain. -_Note: All of the steps are executed automatically by the ContractWrapper and is transparent to the end-user_ +### How Data is Encoded Before Blockchain Submission +_Note: All steps are automatically handled by the ContractWrapper, making the process transparent to the end user._ -1. Relevant data must be fetched from the data distribution layer, powered by the Streamr network or the RedStone gateways. - -2. Data is packed into a message based on the structure of the ‘Transaction Payload’ diagram below… - +1. **Data Retrieval**: Relevant data is fetched from the data distribution layer, powered by the Streamr network or RedStone gateways. +2. **Data Packaging**: The data is structured according to the ‘Transaction Payload’ diagram. + -3. The package is appended to the original transaction message, signed, and submitted to the network. -
- -### How Data Is Unpacked, Verified and Then Aggregated On-Chain -Firstly, the appended data packages are extracted from the call data. Then, security steps are taken including verifying if the signature was created by a trusted provider and validating the timestamp, confirming the information is correct. Afterward, for each requested data feed RedStone calculates the number of received unique signers, extracts the value for each unique signer, and calculates the aggregated value. The middle value of all the values (median), is the default value that is provided. This logic is executed in the on-chain environment and its execution has been optimized using a low-level assembly code to reduce gas consumption to the absolute minimum. To increase the security of the RedStone Oracle system, we've created the on-chain aggregation mechanism. This mechanism adds an additional requirement of ensuring a minimum number of distinct data feeds are relied on. The values from different providers are then aggregated before returning to a consumer contract. By default, RedStone uses the median value calculation for aggregation. This way, even if a small subset of providers are corrupt (e.g. 2 of 10), it does not significantly affect the aggregated value. - - -
- -# Technical Considerations When Implementing RedStone's Data Feeds - -### On-Chain Aggregation Parameters in RedStone’s Consumer Base Contract: - - -`getUniqueSignersThreshold` function - - -Purpose: Determines the threshold number of unique signers required to validate a piece of data. RedStone relies on multiple independent signers to ensure its accuracy and integrity. +3. **Data Submission**: The package is appended to the original transaction message, signed, and submitted to the network. +### On-Chain Data Processing: Unpacking, Verification, and Aggregation -`getAuthorisedSignerIndex` function +1. **Unpacking**: The appended data packages are extracted from the call data. +2. **Verification**: Security checks are performed, including signature verification from trusted providers and timestamp validation to confirm data accuracy. +3. **Aggregation**: + - RedStone calculates the number of received unique signers for each requested data feed. + - The median value of all the values provided by unique signers is calculated and used as the default value. + - This process is optimized using low-level assembly code to minimize gas consumption. +4. **Security Mechanisms**: + - RedStone’s on-chain aggregation mechanism ensures that a minimum number of distinct data feeds are required. + - Values from different providers are aggregated before being returned to the consumer contract. + - The default aggregation method is median value calculation, ensuring that even if a small subset of providers is compromised, it does not significantly affect the final value. +## Technical Guidelines for Implementing RedStone Data Feeds -Purpose: Returns the index of an authorized signer from a list of signers. It is used to verify if a given signer is authorized to sign data. +### Key On-Chain Aggregation Parameters +- **`getUniqueSignersThreshold` Function** + Purpose: Determines the minimum number of unique signers required to validate a piece of data. This ensures data accuracy and integrity by relying on multiple independent signers. + +- **`getAuthorisedSignerIndex` Function** + Purpose: Returns the index of an authorized signer from a list of signers, verifying whether a given signer is authorized to sign data. + +- **`aggregateValues` Function (for numeric values)** + Purpose: Aggregates numeric values from multiple data points, typically calculating an average or median to mitigate the impact of any single erroneous data point. + +- **`aggregateByteValues` Function (for byte arrays)** + Purpose: Aggregates values specifically for byte arrays. -`aggregateValues` function (for numeric values) +### Supported Data Types +RedStone supports two types of data in a contract: -Purpose: Aggregates numeric values from multiple data points. It could calculate an average like the median. Aggregating values from multiple sources helps in reducing the impact of any single erroneous data point. +1. Numeric 256-bit values (default) +2. Byte arrays with dynamic size +### Security Best Practices -`aggregateByteValues` function (for bytes arrays) +- **Threshold Modification**: Overriding `getUniqueSignersThreshold` can be risky. Only proceed if you are absolutely confident in your changes. +- **Timestamp Validation**: Pay close attention to the timestamp validation logic. In certain use cases (e.g., synthetic DEX), you may need to cache the latest values in your contract storage to prevent arbitrage attacks. +- **Upgradability**: Implement a secure upgradability mechanism for your contract, preferably using multi-sig or DAO governance. +- **Monitoring**: Continuously monitor the RedStone data services registry and promptly update signer authorization logic in your contracts in case of changes. We will also notify you if you are a paying client. +### Implementation Recommendations -Purpose: Aggregates values specifically for byte arrays. +- **Data Feed Requests**: Design your smart contracts to minimize the number of data feeds requested in a single transaction. +- **Signer Threshold**: We recommend requiring approximately three unique signers to balance security with gas efficiency. -### Types of Values Supported - -We support 2 types of data to be received in a contract: - -1. Numeric 256-bit values (used by default) -2. Bytes arrays with dynamic size - - -### Security Considerations -- Overriding `getUniqueSignersThreshold` may be a significant risk. We only recommend overriding it if you are 100% confident. - -- Pay attention to the timestamp validation logic. For some use-cases (e.g. synthetic DEX), you would need to cache the latest values in your contract storage to avoid arbitrage attacks. - -- Enable a secure upgradability mechanism for your contract (ideally based on multi-sig or DAO). - -- Monitor the RedStone data services registry and quickly modify signer authorization logic in your contracts in case of changes (we will also notify you if you are a paying client). - -### Recommendations -- Write smart contracts in a way where you do not need to request many data feeds in the same transaction. -- Approximately 3 required unique signers is our recommended balance to be secure and minimize gas costs. - - -# Benchmarks +## Performance Benchmarks You can check the benchmarks script and reports [here.](https://github.com/redstone-finance/redstone-oracles-monorepo/tree/main/packages/evm-connector/benchmarks) + + + + From 324270fe9a35e70f1d515ca8c0e222935d348c49 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:57:44 +0100 Subject: [PATCH 27/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index 9203002e..c2c77de4 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -1,6 +1,6 @@ --- sidebar_position: 1 -sidebar_label: "⚙️ Core (on-demand feeds)" +sidebar_label: "Core Model" --- # The RedStone Core Model From decc23192ec0b91f210b41709a4702ab5a9ca514 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:01:30 +0100 Subject: [PATCH 28/81] Update redstone-classic.md --- docs/get-started/models/redstone-classic.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/redstone-classic.md b/docs/get-started/models/redstone-classic.md index 4b6a2f49..fb682b31 100644 --- a/docs/get-started/models/redstone-classic.md +++ b/docs/get-started/models/redstone-classic.md @@ -1,6 +1,6 @@ --- sidebar_position: 2 -sidebar_label: "🏛 Classic (push model)" +sidebar_label: "Classic Model" --- # 🏛 Classic Model From 4fa18577eec332da6bae8d898036655e03d99ce9 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:02:07 +0100 Subject: [PATCH 29/81] Update redstone-classic.md --- docs/get-started/models/redstone-classic.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/redstone-classic.md b/docs/get-started/models/redstone-classic.md index fb682b31..987565b3 100644 --- a/docs/get-started/models/redstone-classic.md +++ b/docs/get-started/models/redstone-classic.md @@ -3,7 +3,7 @@ sidebar_position: 2 sidebar_label: "Classic Model" --- -# 🏛 Classic Model +# Classic Model The RedStone Classic Model is designed for dApps that would like access to data feeds that is compatable with the traditional design of oracles. To access cost-minimized and reduced latency data feeds check out the [RedStone Core Model](https://docs.redstone.finance/docs/get-started/models/redstone-core). From 0796545cda8d43326b3ec1c05f524ce7274c4791 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:02:24 +0100 Subject: [PATCH 30/81] Update redstone-core.md --- docs/get-started/models/redstone-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.md index c2c77de4..b072ba51 100644 --- a/docs/get-started/models/redstone-core.md +++ b/docs/get-started/models/redstone-core.md @@ -3,7 +3,7 @@ sidebar_position: 1 sidebar_label: "Core Model" --- -# The RedStone Core Model +# Core Model ****This is our recommended model**** which provides data feeds to dApps only upon request, reducing the costs of putting data onto the blockchain. To learn more about how RedStone brings data on-chain, check out the [Data Formatting and Processing](https://docs.redstone.finance/docs/get-started/data-formatting-processing) section. ### Prerequisites Before You Begin: From 734e351cc9329b896249d174cca0fddd293a0c18 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:02:55 +0100 Subject: [PATCH 31/81] Update redstone-x.md --- docs/get-started/models/redstone-x.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/get-started/models/redstone-x.md b/docs/get-started/models/redstone-x.md index 389578cd..5dbcf434 100644 --- a/docs/get-started/models/redstone-x.md +++ b/docs/get-started/models/redstone-x.md @@ -1,9 +1,9 @@ --- sidebar_position: 3 -sidebar_label: "⏱ X (no front-running)" +sidebar_label: "X Model" --- -# RedStone X Model +# X Model The RedStone X model is designed to meet the needs of advanced protocols, such as perpetuals, options, and derivatives. By providing price feeds at the very next block after users initiate transactions, this model eliminates front-running risks. From c98c4e1aafcf99e3517f054200803eaad330587f Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:04:02 +0100 Subject: [PATCH 32/81] Update redstone-erc7412.md --- docs/get-started/models/redstone-erc7412.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/redstone-erc7412.md b/docs/get-started/models/redstone-erc7412.md index eeb53280..28f6fd8c 100644 --- a/docs/get-started/models/redstone-erc7412.md +++ b/docs/get-started/models/redstone-erc7412.md @@ -1,6 +1,6 @@ --- sidebar_position: 4 -sidebar_label: "🌀 ERC7412 (classic + core)" +sidebar_label: "ERC7412 Model" --- # RedStone ERC7412 From 8ebdca7061193e3a27058f2ef5bb0ae62f789625 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:04:18 +0100 Subject: [PATCH 33/81] Update redstone-erc7412.md --- docs/get-started/models/redstone-erc7412.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/redstone-erc7412.md b/docs/get-started/models/redstone-erc7412.md index 28f6fd8c..d5ca20da 100644 --- a/docs/get-started/models/redstone-erc7412.md +++ b/docs/get-started/models/redstone-erc7412.md @@ -3,7 +3,7 @@ sidebar_position: 4 sidebar_label: "ERC7412 Model" --- -# RedStone ERC7412 +# ERC7412 Model ## Classic and Core models combined From d913edd1dabe9d82336bb00f4819b03fda660ebc Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:05:19 +0100 Subject: [PATCH 34/81] Update _category_.json --- docs/get-started/models/_category_.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/_category_.json b/docs/get-started/models/_category_.json index 693b59da..d16322d9 100644 --- a/docs/get-started/models/_category_.json +++ b/docs/get-started/models/_category_.json @@ -1,5 +1,5 @@ { - "label": "🗂️ Models", + "label": "Models", "position": 2, "link": { "type": "generated-index", From d8faeee4fa1d8658ee8157b95807de453ba33fb1 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:07:08 +0100 Subject: [PATCH 35/81] Update Introduction.md --- docs/Introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Introduction.md b/docs/Introduction.md index 5c2caf2d..28eb91b0 100644 --- a/docs/Introduction.md +++ b/docs/Introduction.md @@ -1,6 +1,6 @@ --- sidebar_position: 1 -sidebar_label: "♦️ What is RedStone Oracles?" +sidebar_label: "Introduction ♦️ " --- # Introduction From 8a0d2caa4a21e29920ec0120999228939b99a916 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:10:43 +0100 Subject: [PATCH 36/81] Update _category_.json --- docs/data-providers/_category_.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/data-providers/_category_.json b/docs/data-providers/_category_.json index 14e569cd..4001306a 100644 --- a/docs/data-providers/_category_.json +++ b/docs/data-providers/_category_.json @@ -1,5 +1,5 @@ { - "label": "⛴️ Data Providers", + "label": Data Providers", "position": 3, "link": { "type": "generated-index", From 438295c186f62606cc4b86dbc1365eff0fa66211 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:12:03 +0100 Subject: [PATCH 37/81] Update selecting-redstone-model.md --- docs/get-started/selecting-redstone-model.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/selecting-redstone-model.md b/docs/get-started/selecting-redstone-model.md index adbbc942..f768ddde 100644 --- a/docs/get-started/selecting-redstone-model.md +++ b/docs/get-started/selecting-redstone-model.md @@ -1,6 +1,6 @@ --- sidebar_position: 1 -sidebar_label: "👀 Selecting a RedStone Model" +sidebar_label: " Models" --- # RedStone Offers Three Models From 746d70a8f6a671cd2bb10f804c0ba39a23d86172 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:16:19 +0100 Subject: [PATCH 38/81] Update Introduction.md --- docs/Introduction.md | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/docs/Introduction.md b/docs/Introduction.md index 28eb91b0..7c461b5e 100644 --- a/docs/Introduction.md +++ b/docs/Introduction.md @@ -9,34 +9,14 @@ There is a growing need for decentralized applications (dApps) to access data fe RedStone also provides data feeds to blockchains and layer 2 scaling solutions across the entire blockchain ecosystem that are both EVM and non-EVM compatible. The current model of oracle systems suffers from key inefficiencies, all of which RedStone Oracles was specifically designed to solve from the bottom up. This makes RedStone a unique oracle service. -## The Problems RedStone Solves ♦️ - -### Problem #1: The standard approach of providing data to applications is inefficient and expensive. -The standard method of providing data is to ‘push’ the data onto the blockchain regardless of whether it is used by an application. This results in paying more for data and dedicating resources that could be used elsewhere. - -**Our Solution** -RedStone allows data to be provided on-demand rather than on a fixed schedule, reducing the costs of putting data 'on-chain'. This is achieved by storing data off of the blockchain as cryptographically signed packages and allowing smart contracts of dApps to fetch data when necessary. - -*Note on Data Integrity:* -To maintain data integrity, RedStone also provides data feeds to Arweave, a decentralized network that provides data storage. Arweave's decentralized network makes it tamper-proof; therefore, any data provided by RedStone to Arweave acts as an unbiased source of truth about the historical data provided by RedStone. - -Overall, RedStone's approach improves efficiency for dApps and significantly reduces the costs for dApps to access data feeds. - -### Problem #2: The typical monolithic architecture of oracles limits scalability. -A consequence of a monolithic architecture is that it makes it challenging for protocols to reduce latency and list new assets. - -**Our Solution** -RedStone was designed with a modular architecture, making it easy to incorporate new assets and reduce latency, allowing dApps to scale more efficiently. This means constructing the oracle in such a way that its various components—such as data sources, validation mechanisms, and delivery methods—can be easily interchanged, updated, or augmented without disrupting the system’s overall functionality. - - ## Key facts - RedStone secures [billions of dollars](https://defillama.com/oracles/RedStone?borrowed=true&doublecounted=true) of value in Web 3.0 - Data Integrity is fundamental to Redstone and is ensured from start to finish (from source to smart contract) - There are [3 different ways](./get-started/selecting-redstone-model) to integrate our service tailored to your needs - We provide feeds for more than [1000 assets](https://app.redstone.finance/#/app/tokens) integrating [~180 data sources](https://app.redstone.finance/#/app/sources) -- We are present on [20+ chains](https://showroom.redstone.finance/) -- Our code was audited by multiple security experts including [ABDK](https://abdk.consulting/) [Peckshield](https://peckshield.com/), and a co-founder of [L2Beat](https://pl.linkedin.com/company/l2beat#:~:text=Join%20Piotr%20Szlachciak%20Cofounder%20%26%20CEO,insights%20shaping%20the%20%23DeFi%20landscape!). +- We are present on [50+ chains](https://showroom.redstone.finance/) +- Our code was audited by multiple security experts including [ABDK](https://abdk.consulting/) [Peckshield](https://peckshield.com/), [Quantstamp](https://quantstamp.com/), and a co-founder of [L2Beat](https://pl.linkedin.com/company/l2beat#:~:text=Join%20Piotr%20Szlachciak%20Cofounder%20%26%20CEO,insights%20shaping%20the%20%23DeFi%20landscape!). - RedStone supports leading projects like [Morpho](https://morpho.org/), [Venus](https://venus.io/), and [Pendle Finance](https://www.pendle.finance/). From 15dc3b3e948a40f06f020d967b441ed4c886c750 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:17:48 +0100 Subject: [PATCH 39/81] Create RedStone-Solutions.md --- docs/RedStone-Solutions.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/RedStone-Solutions.md diff --git a/docs/RedStone-Solutions.md b/docs/RedStone-Solutions.md new file mode 100644 index 00000000..f288d251 --- /dev/null +++ b/docs/RedStone-Solutions.md @@ -0,0 +1,19 @@ + +# The Problems RedStone Solves ♦️ + +### Problem #1: The standard approach of providing data to applications is inefficient and expensive. +The standard method of providing data is to ‘push’ the data onto the blockchain regardless of whether it is used by an application. This results in paying more for data and dedicating resources that could be used elsewhere. + +**Our Solution** +RedStone allows data to be provided on-demand rather than on a fixed schedule, reducing the costs of putting data 'on-chain'. This is achieved by storing data off of the blockchain as cryptographically signed packages and allowing smart contracts of dApps to fetch data when necessary. + +*Note on Data Integrity:* +To maintain data integrity, RedStone also provides data feeds to Arweave, a decentralized network that provides data storage. Arweave's decentralized network makes it tamper-proof; therefore, any data provided by RedStone to Arweave acts as an unbiased source of truth about the historical data provided by RedStone. + +Overall, RedStone's approach improves efficiency for dApps and significantly reduces the costs for dApps to access data feeds. + +### Problem #2: The typical monolithic architecture of oracles limits scalability. +A consequence of a monolithic architecture is that it makes it challenging for protocols to reduce latency and list new assets. + +**Our Solution** +RedStone was designed with a modular architecture, making it easy to incorporate new assets and reduce latency, allowing dApps to scale more efficiently. This means constructing the oracle in such a way that its various components—such as data sources, validation mechanisms, and delivery methods—can be easily interchanged, updated, or augmented without disrupting the system’s overall functionality. From 4026daae197d75a9d83c498a423edfb579fd82a8 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:19:31 +0100 Subject: [PATCH 40/81] Update RedStone-Solutions.md --- docs/RedStone-Solutions.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/RedStone-Solutions.md b/docs/RedStone-Solutions.md index f288d251..250cf9f6 100644 --- a/docs/RedStone-Solutions.md +++ b/docs/RedStone-Solutions.md @@ -1,4 +1,12 @@ + +--- +sidebar_position: 2 +sidebar_label: "Why Redstone?" +--- + +The current model of oracle systems suffers from key inefficiencies, all of which RedStone Oracles was specifically designed to solve from the bottom + # The Problems RedStone Solves ♦️ ### Problem #1: The standard approach of providing data to applications is inefficient and expensive. From a541aab3f6952db861c1ceb82c975da3c91d133d Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:23:27 +0100 Subject: [PATCH 41/81] Update RedStone-Solutions.md --- docs/RedStone-Solutions.md | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/docs/RedStone-Solutions.md b/docs/RedStone-Solutions.md index 250cf9f6..6217bf08 100644 --- a/docs/RedStone-Solutions.md +++ b/docs/RedStone-Solutions.md @@ -1,27 +1,35 @@ - - --- sidebar_position: 2 -sidebar_label: "Why Redstone?" +sidebar_label: "Why RedStone?" --- -The current model of oracle systems suffers from key inefficiencies, all of which RedStone Oracles was specifically designed to solve from the bottom +# Why RedStone? + +The current model of oracle systems suffers from significant inefficiencies, which RedStone Oracles was specifically designed to solve from the ground up. # The Problems RedStone Solves ♦️ -### Problem #1: The standard approach of providing data to applications is inefficient and expensive. -The standard method of providing data is to ‘push’ the data onto the blockchain regardless of whether it is used by an application. This results in paying more for data and dedicating resources that could be used elsewhere. +### Problem #1: Inefficient and Expensive Data Provision + +**The Issue:** +The standard approach of providing data to applications involves ‘pushing’ the data onto the blockchain regardless of whether it is used by an application. This results in unnecessary costs and resource allocation. + +**Our Solution:** +RedStone offers an on-demand data provision model instead of a fixed schedule. This approach reduces the costs associated with putting data 'on-chain'. By storing data off-chain as cryptographically signed packages, RedStone allows smart contracts of dApps to fetch data only when necessary. + +**Data Integrity:** +To ensure data integrity, RedStone also provides data feeds to Arweave, a decentralized network known for its tamper-proof storage. Data provided by RedStone to Arweave acts as an unbiased, immutable source of truth about historical data. -**Our Solution** -RedStone allows data to be provided on-demand rather than on a fixed schedule, reducing the costs of putting data 'on-chain'. This is achieved by storing data off of the blockchain as cryptographically signed packages and allowing smart contracts of dApps to fetch data when necessary. +**Outcome:** +RedStone’s innovative approach significantly enhances efficiency for dApps and reduces the costs associated with accessing data feeds. -*Note on Data Integrity:* -To maintain data integrity, RedStone also provides data feeds to Arweave, a decentralized network that provides data storage. Arweave's decentralized network makes it tamper-proof; therefore, any data provided by RedStone to Arweave acts as an unbiased source of truth about the historical data provided by RedStone. +### Problem #2: Limited Scalability Due to Monolithic Architecture -Overall, RedStone's approach improves efficiency for dApps and significantly reduces the costs for dApps to access data feeds. +**The Issue:** +Monolithic architectures in traditional oracles make it difficult for protocols to reduce latency and add new assets quickly. -### Problem #2: The typical monolithic architecture of oracles limits scalability. -A consequence of a monolithic architecture is that it makes it challenging for protocols to reduce latency and list new assets. +**Our Solution:** +RedStone is built with a modular architecture, making it easy to incorporate new assets and reduce latency. This modular design ensures that components like data sources, validation mechanisms, and delivery methods can be interchanged, updated, or augmented without disrupting overall functionality. -**Our Solution** -RedStone was designed with a modular architecture, making it easy to incorporate new assets and reduce latency, allowing dApps to scale more efficiently. This means constructing the oracle in such a way that its various components—such as data sources, validation mechanisms, and delivery methods—can be easily interchanged, updated, or augmented without disrupting the system’s overall functionality. +**Outcome:** +This modularity enables dApps to scale more efficiently, adapting to changing needs and integrating new features seamlessly. From 19dcfa307ba17a8d3badd768db1cca8a39623114 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:24:58 +0100 Subject: [PATCH 42/81] Update Introduction.md --- docs/Introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Introduction.md b/docs/Introduction.md index 7c461b5e..531f4660 100644 --- a/docs/Introduction.md +++ b/docs/Introduction.md @@ -16,7 +16,7 @@ RedStone also provides data feeds to blockchains and layer 2 scaling solutions a - There are [3 different ways](./get-started/selecting-redstone-model) to integrate our service tailored to your needs - We provide feeds for more than [1000 assets](https://app.redstone.finance/#/app/tokens) integrating [~180 data sources](https://app.redstone.finance/#/app/sources) - We are present on [50+ chains](https://showroom.redstone.finance/) -- Our code was audited by multiple security experts including [ABDK](https://abdk.consulting/) [Peckshield](https://peckshield.com/), [Quantstamp](https://quantstamp.com/), and a co-founder of [L2Beat](https://pl.linkedin.com/company/l2beat#:~:text=Join%20Piotr%20Szlachciak%20Cofounder%20%26%20CEO,insights%20shaping%20the%20%23DeFi%20landscape!). +- Our code was audited by multiple security experts including [ABDK](https://abdk.consulting/), [Peckshield](https://peckshield.com/), [Quantstamp](https://quantstamp.com/), and a co-founder of [L2Beat](https://pl.linkedin.com/company/l2beat#:~:text=Join%20Piotr%20Szlachciak%20Cofounder%20%26%20CEO,insights%20shaping%20the%20%23DeFi%20landscape!). - RedStone supports leading projects like [Morpho](https://morpho.org/), [Venus](https://venus.io/), and [Pendle Finance](https://www.pendle.finance/). From d8ad435ae5302afa4cce32211d166bd262c096f4 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:36:36 +0100 Subject: [PATCH 43/81] Update Introduction.md --- docs/Introduction.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/Introduction.md b/docs/Introduction.md index 531f4660..f71f4369 100644 --- a/docs/Introduction.md +++ b/docs/Introduction.md @@ -18,11 +18,3 @@ RedStone also provides data feeds to blockchains and layer 2 scaling solutions a - We are present on [50+ chains](https://showroom.redstone.finance/) - Our code was audited by multiple security experts including [ABDK](https://abdk.consulting/), [Peckshield](https://peckshield.com/), [Quantstamp](https://quantstamp.com/), and a co-founder of [L2Beat](https://pl.linkedin.com/company/l2beat#:~:text=Join%20Piotr%20Szlachciak%20Cofounder%20%26%20CEO,insights%20shaping%20the%20%23DeFi%20landscape!). - RedStone supports leading projects like [Morpho](https://morpho.org/), [Venus](https://venus.io/), and [Pendle Finance](https://www.pendle.finance/). - - - - - RedStone Architecure - - - From dfa22da59efa29a34ac54253953dbc91bb244f0d Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:37:04 +0100 Subject: [PATCH 44/81] Update Introduction.md --- docs/Introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Introduction.md b/docs/Introduction.md index f71f4369..abde8730 100644 --- a/docs/Introduction.md +++ b/docs/Introduction.md @@ -9,7 +9,7 @@ There is a growing need for decentralized applications (dApps) to access data fe RedStone also provides data feeds to blockchains and layer 2 scaling solutions across the entire blockchain ecosystem that are both EVM and non-EVM compatible. The current model of oracle systems suffers from key inefficiencies, all of which RedStone Oracles was specifically designed to solve from the bottom up. This makes RedStone a unique oracle service. -## Key facts +## Facts - RedStone secures [billions of dollars](https://defillama.com/oracles/RedStone?borrowed=true&doublecounted=true) of value in Web 3.0 - Data Integrity is fundamental to Redstone and is ensured from start to finish (from source to smart contract) From e29851708304047a3b5c61098dd0cbcbf4481cc9 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 12:45:48 +0100 Subject: [PATCH 45/81] Update redstone-classic.md --- docs/get-started/models/redstone-classic.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/get-started/models/redstone-classic.md b/docs/get-started/models/redstone-classic.md index 987565b3..caa25780 100644 --- a/docs/get-started/models/redstone-classic.md +++ b/docs/get-started/models/redstone-classic.md @@ -23,8 +23,6 @@ This approach is built on top of the [RedStone Core](./redstone-core.mdx) model The model consists of two main parts. The first one is the off-chain [relayer](#relayer) responsible for pushing data on-chain in a customized way using [environment variables](#environment-variables). The second part is the on-chain [contracts](#contracts) which enable storing prices and getting them through a familiar interface (e.g. the [Chainlink Aggregator](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.7/interfaces/AggregatorV3Interface.sol) ). RedStone Classic can be used on all EVM-compatible L1s & L2s + Starknet + Fuel Network. -![RedStone Classic diagram](/img/redstone-classic.png) - ### Relayer The relayer is a service that works in a customizable way based on [environment variables](#environment-variables). It periodically checks a defined set of conditions, pushing the prices when they are satisfied. It is possible to pass multiple conditions to the `UPDATE_CONDITIONS`, then the relayer will work in the manner that if any conditions are met prices would be updated. Currently, two conditions are implemented: From 41fd6015254716c8a8a1694b240aa3c63c51f88a Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 13:13:55 +0100 Subject: [PATCH 46/81] Update redstone-classic.md --- docs/get-started/models/redstone-classic.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/redstone-classic.md b/docs/get-started/models/redstone-classic.md index caa25780..28c5c9dd 100644 --- a/docs/get-started/models/redstone-classic.md +++ b/docs/get-started/models/redstone-classic.md @@ -18,7 +18,7 @@ RedStone Classic has a significant advantage over traditional push Oracles. Our ## How RedStone Classic works -This approach is built on top of the [RedStone Core](./redstone-core.mdx) model maintaining the security of on-chain validation of data providers and timestamps. +This approach is built on top of the [RedStone Core](./redstone-core.md) model maintaining the security of on-chain validation of data providers and timestamps. The model consists of two main parts. The first one is the off-chain [relayer](#relayer) responsible for pushing data on-chain in a customized way using [environment variables](#environment-variables). The second part is the on-chain [contracts](#contracts) which enable storing prices and getting them through a familiar interface (e.g. the [Chainlink Aggregator](https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.7/interfaces/AggregatorV3Interface.sol) ). RedStone Classic can be used on all EVM-compatible L1s & L2s + Starknet + Fuel Network. From f99dc9f8da278194d78e915ae34cd3fa0de9dfcd Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 13:20:16 +0100 Subject: [PATCH 47/81] Rename redstone-core.md to redstone-core.mdx --- docs/get-started/models/{redstone-core.md => redstone-core.mdx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/get-started/models/{redstone-core.md => redstone-core.mdx} (100%) diff --git a/docs/get-started/models/redstone-core.md b/docs/get-started/models/redstone-core.mdx similarity index 100% rename from docs/get-started/models/redstone-core.md rename to docs/get-started/models/redstone-core.mdx From 42b77e16d07c54a0493b0a29ab5dbc6e56d3fc7c Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 13:41:09 +0100 Subject: [PATCH 48/81] Update redstone-erc7412.md --- docs/get-started/models/redstone-erc7412.md | 41 ++++++++++----------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/docs/get-started/models/redstone-erc7412.md b/docs/get-started/models/redstone-erc7412.md index d5ca20da..33b31756 100644 --- a/docs/get-started/models/redstone-erc7412.md +++ b/docs/get-started/models/redstone-erc7412.md @@ -1,29 +1,26 @@ --- sidebar_position: 4 -sidebar_label: "ERC7412 Model" +sidebar_label: "ERC-7412 Model" --- -# ERC7412 Model +# ERC-7412 Model -## Classic and Core models combined +The ERC-7412 model combines RedStone's Classic and Core Models relying on an newly proposed Ethereum standard. This model was introduced in light of the [ERC-7412](https://eips.ethereum.org/EIPS/eip-7412) standard. It is encouraged to familiarize yourself with it before implementating this model. -This model was introduced in form of [ERC7412](https://eips.ethereum.org/EIPS/eip-7412) - we encourage you to read it before implementation! The model was popularized by perpetual protocol [Synthetix](https://synthetix.io/). - -:::important Requirements -TLDR; You need to do 2 things: +:::Important Requirements 1. Deploy price feed -2. Modify you client code to use [erc7412](https://www.npmjs.com/package/@redstone-finance/erc7412) +2. Modify you client code to use [ERC7412](https://www.npmjs.com/package/@redstone-finance/erc7412) ::: -## Guide +## Step-By-Step Guide -### Deploy price feed contract +### 1. Deploy Price Feed Contract -1. Install dependency `npm install @redstone-finance/erc7412` -2. You have to extend contract `RedstonePrimaryProdWithoutRoundsERC7412` imported from `@redstone-finance/erc7412/contracts/RedstoneERC7412.sol` - 1. Implement `getTTL` method. It should return duration in second after which price in contract becomes stale. Stale means that price feed contract will revert on reads until price will be updated. Price updates will happen this is described in "Modify DAPP" section. - 2. Choose `dataFeedId` for which you want to deploy feed. Here is full list of [supported assets](https://app.redstone.finance/#/app/data-services/redstone-primary-prod) -3. Deploy contract +1. Install dependency `npm install @redstone-finance/erc7412`. +2. You have to extend contract `RedstonePrimaryProdWithoutRoundsERC7412` imported from `@redstone-finance/erc7412/contracts/RedstoneERC7412.sol`. +3. Implement `getTTL` method. It should return duration in second after which price in contract becomes stale. Stale means that price feed contract will revert on reads until price will be updated. Price updates will happen this is described in "Modify DAPP" section. +4. Choose `dataFeedId` for which you want to deploy feed. Here is full list of [supported assets](https://app.redstone.finance/#/app/data-services/redstone-primary-prod). +3. Deploy contract. **Example contract for BTC dataFeedId** ```sol @@ -39,15 +36,16 @@ contract BTCFeed is RedstonePrimaryProdWithoutRoundsERC7412 { } } ``` -### Modify DAPP -Your dapp has to be aware of erc7412. To allow users update prices when price in feed is stale. +### 2. Modify Your dApp -*Note: if it happens that user will have to update price they will need to pay extra money for gas transaction.* +- Your dApp has to be aware of ERC7412 to allow users to update prices when the price in feed is stale. +- Modification in your dApp requires extra function call `generate7412CompatibleCall` which should be executed just before user executing transaction. +- For now erc7412 lib depends on viem client. +- You have to prepare call to your contract, and in next step pass it to `generate7412CompatibleCall`. +- For a working example [click here](https://github.com/redstone-finance/erc7412-example). -Modification in your dapp requires extra function call `generate7412CompatibleCall` which should be executed just before user executing transaction. + *Note: if a user would like to update the price they will need to pay extra money for gas transaction.* -1. For now erc7412 lib depends on viem client. -2. You have to prepare call to your contract, and in next step pass it to `generate7412CompatibleCall` ```ts import { generate7412CompatibleCall } from "@redstone-finance/erc7412/generate7412CompatibleCall"; @@ -78,4 +76,3 @@ Modification in your dapp requires extra function call `generate7412CompatibleCa // data is already set in contract and it won't be necessary to update it until TTL passes console.log("BTC price:", await btcPriceFeed.read.latestAnswer()); ``` -Working example can be find [here](https://github.com/redstone-finance/erc7412-example) From 81f712673c8f3a9ab23fe75403b3dcf4304fe6da Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 16:24:52 +0100 Subject: [PATCH 49/81] Update redstone-erc7412.md --- docs/get-started/models/redstone-erc7412.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/get-started/models/redstone-erc7412.md b/docs/get-started/models/redstone-erc7412.md index 33b31756..105c477e 100644 --- a/docs/get-started/models/redstone-erc7412.md +++ b/docs/get-started/models/redstone-erc7412.md @@ -7,10 +7,10 @@ sidebar_label: "ERC-7412 Model" The ERC-7412 model combines RedStone's Classic and Core Models relying on an newly proposed Ethereum standard. This model was introduced in light of the [ERC-7412](https://eips.ethereum.org/EIPS/eip-7412) standard. It is encouraged to familiarize yourself with it before implementating this model. -:::Important Requirements +#### Important Requirements 1. Deploy price feed -2. Modify you client code to use [ERC7412](https://www.npmjs.com/package/@redstone-finance/erc7412) -::: +2. Modify you client code to use [ERC-7412](https://www.npmjs.com/package/@redstone-finance/erc7412) + ## Step-By-Step Guide From 31427604811010de9ed73ec0a5a7aa906acf9955 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 16:34:23 +0100 Subject: [PATCH 50/81] Update RedStone-Solutions.md --- docs/RedStone-Solutions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/RedStone-Solutions.md b/docs/RedStone-Solutions.md index 6217bf08..16130f04 100644 --- a/docs/RedStone-Solutions.md +++ b/docs/RedStone-Solutions.md @@ -1,6 +1,6 @@ --- sidebar_position: 2 -sidebar_label: "Why RedStone?" +sidebar_label: "Why RedStone" --- # Why RedStone? From ad5f418850a6001e8d91a179641e1f1f59a25398 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 16:35:39 +0100 Subject: [PATCH 51/81] Update Introduction.md --- docs/Introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Introduction.md b/docs/Introduction.md index abde8730..436f5f0b 100644 --- a/docs/Introduction.md +++ b/docs/Introduction.md @@ -1,6 +1,6 @@ --- sidebar_position: 1 -sidebar_label: "Introduction ♦️ " +sidebar_label: "Introduction" --- # Introduction From 0876c9a1664e6c7dcfe976f7ff8bf6a3e1e2c37f Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 16:36:17 +0100 Subject: [PATCH 52/81] Update RedStone-Solutions.md --- docs/RedStone-Solutions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/RedStone-Solutions.md b/docs/RedStone-Solutions.md index 16130f04..a2a4bab1 100644 --- a/docs/RedStone-Solutions.md +++ b/docs/RedStone-Solutions.md @@ -7,7 +7,7 @@ sidebar_label: "Why RedStone" The current model of oracle systems suffers from significant inefficiencies, which RedStone Oracles was specifically designed to solve from the ground up. -# The Problems RedStone Solves ♦️ +# The Problems RedStone ♦️ Solves ### Problem #1: Inefficient and Expensive Data Provision From e5cf79c8a8cd547383c4b38e637507d80166003d Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 16:36:48 +0100 Subject: [PATCH 53/81] Update RedStone-Solutions.md --- docs/RedStone-Solutions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/RedStone-Solutions.md b/docs/RedStone-Solutions.md index a2a4bab1..33612531 100644 --- a/docs/RedStone-Solutions.md +++ b/docs/RedStone-Solutions.md @@ -3,11 +3,11 @@ sidebar_position: 2 sidebar_label: "Why RedStone" --- -# Why RedStone? +# ♦️ Why RedStone? The current model of oracle systems suffers from significant inefficiencies, which RedStone Oracles was specifically designed to solve from the ground up. -# The Problems RedStone ♦️ Solves +# The Problems RedStone Solves ### Problem #1: Inefficient and Expensive Data Provision From c486b85040570690807f5e64b523b1312ffb529e Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:08:05 +0100 Subject: [PATCH 54/81] Update redstone-core.mdx --- docs/get-started/models/redstone-core.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/redstone-core.mdx b/docs/get-started/models/redstone-core.mdx index b072ba51..dced6668 100644 --- a/docs/get-started/models/redstone-core.mdx +++ b/docs/get-started/models/redstone-core.mdx @@ -4,7 +4,7 @@ sidebar_label: "Core Model" --- # Core Model -****This is our recommended model**** which provides data feeds to dApps only upon request, reducing the costs of putting data onto the blockchain. To learn more about how RedStone brings data on-chain, check out the [Data Formatting and Processing](https://docs.redstone.finance/docs/get-started/data-formatting-processing) section. +This is our recommended model which provides data feeds to dApps only upon request, reducing the costs of putting data onto the blockchain. To learn more about how RedStone brings data on-chain, check out the [Data Formatting and Processing](https://docs.redstone.finance/docs/get-started/data-formatting-processing) section. ### Prerequisites Before You Begin: - **Knowledge of Smart Contracts:** Understanding how to implement and interact with smart contracts. From efe622a918d7925834d12ee497e9eb16b1cb96e5 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:09:33 +0100 Subject: [PATCH 55/81] Update RedStone-Solutions.md --- docs/RedStone-Solutions.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/RedStone-Solutions.md b/docs/RedStone-Solutions.md index 33612531..53948e9d 100644 --- a/docs/RedStone-Solutions.md +++ b/docs/RedStone-Solutions.md @@ -17,9 +17,6 @@ The standard approach of providing data to applications involves ‘pushing’ t **Our Solution:** RedStone offers an on-demand data provision model instead of a fixed schedule. This approach reduces the costs associated with putting data 'on-chain'. By storing data off-chain as cryptographically signed packages, RedStone allows smart contracts of dApps to fetch data only when necessary. -**Data Integrity:** -To ensure data integrity, RedStone also provides data feeds to Arweave, a decentralized network known for its tamper-proof storage. Data provided by RedStone to Arweave acts as an unbiased, immutable source of truth about historical data. - **Outcome:** RedStone’s innovative approach significantly enhances efficiency for dApps and reduces the costs associated with accessing data feeds. From ab7c02afdf3c2fab0232d77dcafc3b61526b03bb Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:16:03 +0100 Subject: [PATCH 56/81] Rename Security-And-Accuracy-Measures.md to docs/get-started/Security --- Security-And-Accuracy-Measures.md => docs/get-started/Security | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Security-And-Accuracy-Measures.md => docs/get-started/Security (100%) diff --git a/Security-And-Accuracy-Measures.md b/docs/get-started/Security similarity index 100% rename from Security-And-Accuracy-Measures.md rename to docs/get-started/Security From 3db270b88a3c43dab86f08dd7da56e40fd5c5884 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:16:13 +0100 Subject: [PATCH 57/81] Rename Security to Security.md --- docs/get-started/{Security => Security.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/get-started/{Security => Security.md} (100%) diff --git a/docs/get-started/Security b/docs/get-started/Security.md similarity index 100% rename from docs/get-started/Security rename to docs/get-started/Security.md From 13128e08c1f2952f157d83505be5903f9849959b Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:16:55 +0100 Subject: [PATCH 58/81] Update Security.md --- docs/get-started/Security.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/get-started/Security.md b/docs/get-started/Security.md index 81744377..edc8b279 100644 --- a/docs/get-started/Security.md +++ b/docs/get-started/Security.md @@ -1,3 +1,8 @@ +--- +sidebar_position: 3 +sidebar_label: "Security and Accuracy" +--- + # Security and Accuracy of Data Feeds Explained RedStone has secured billions of dollars to date without being hacked or reporting a compromised price feed. This strong track record is a testament to the robust security and accuracy measures in place. From 32ee32a6661fd9a75c8a76010f25013f30783166 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:19:22 +0100 Subject: [PATCH 59/81] Update Security.md --- docs/get-started/Security.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/get-started/Security.md b/docs/get-started/Security.md index edc8b279..1ffc4591 100644 --- a/docs/get-started/Security.md +++ b/docs/get-started/Security.md @@ -1,9 +1,9 @@ --- -sidebar_position: 3 +sidebar_position: 1 sidebar_label: "Security and Accuracy" --- -# Security and Accuracy of Data Feeds Explained +## Security and Accuracy RedStone has secured billions of dollars to date without being hacked or reporting a compromised price feed. This strong track record is a testament to the robust security and accuracy measures in place. ## Security From 2d8b87d51c8fde83a1125f103e8413d80ff474c3 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:25:50 +0100 Subject: [PATCH 60/81] Update RedStone-Solutions.md --- docs/RedStone-Solutions.md | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/docs/RedStone-Solutions.md b/docs/RedStone-Solutions.md index 53948e9d..29fe6abe 100644 --- a/docs/RedStone-Solutions.md +++ b/docs/RedStone-Solutions.md @@ -3,30 +3,18 @@ sidebar_position: 2 sidebar_label: "Why RedStone" --- -# ♦️ Why RedStone? +## Why RedStone? The current model of oracle systems suffers from significant inefficiencies, which RedStone Oracles was specifically designed to solve from the ground up. -# The Problems RedStone Solves - ### Problem #1: Inefficient and Expensive Data Provision - -**The Issue:** The standard approach of providing data to applications involves ‘pushing’ the data onto the blockchain regardless of whether it is used by an application. This results in unnecessary costs and resource allocation. **Our Solution:** -RedStone offers an on-demand data provision model instead of a fixed schedule. This approach reduces the costs associated with putting data 'on-chain'. By storing data off-chain as cryptographically signed packages, RedStone allows smart contracts of dApps to fetch data only when necessary. - -**Outcome:** -RedStone’s innovative approach significantly enhances efficiency for dApps and reduces the costs associated with accessing data feeds. +RedStone offers an on-demand data provision model instead of a fixed schedule. This approach reduces the costs associated with putting data 'on-chain'. By storing data off-chain as cryptographically signed packages, RedStone allows smart contracts of dApps to fetch data only when necessary.RedStone’s innovative approach significantly enhances efficiency for dApps and reduces the costs to access data feeds. -### Problem #2: Limited Scalability Due to Monolithic Architecture - -**The Issue:** +### Problem #2: Limited Scalability Due to Monolithic Architecture Monolithic architectures in traditional oracles make it difficult for protocols to reduce latency and add new assets quickly. **Our Solution:** -RedStone is built with a modular architecture, making it easy to incorporate new assets and reduce latency. This modular design ensures that components like data sources, validation mechanisms, and delivery methods can be interchanged, updated, or augmented without disrupting overall functionality. - -**Outcome:** -This modularity enables dApps to scale more efficiently, adapting to changing needs and integrating new features seamlessly. +RedStone is built with a modular architecture, making it easy to incorporate new assets and reduce latency. This modular design ensures that components like data sources, validation mechanisms, and delivery methods can be interchanged, updated, or augmented without disrupting overall functionality. This modularity enables dApps to scale more efficiently, adapting to changing needs and integrating new features seamlessly. From 2115f5ddb8d104bcd20daaee990f92978ce2ecda Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:27:20 +0100 Subject: [PATCH 61/81] Update Security.md --- docs/get-started/Security.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/get-started/Security.md b/docs/get-started/Security.md index 1ffc4591..0b5c98f0 100644 --- a/docs/get-started/Security.md +++ b/docs/get-started/Security.md @@ -1,12 +1,12 @@ --- -sidebar_position: 1 +sidebar_position: 3 sidebar_label: "Security and Accuracy" --- ## Security and Accuracy RedStone has secured billions of dollars to date without being hacked or reporting a compromised price feed. This strong track record is a testament to the robust security and accuracy measures in place. -## Security +## Security ### Cryptographic Signatures and Auditing From f98ba9c6d07d57bacc9be70f1532419f30803253 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:28:31 +0100 Subject: [PATCH 62/81] Update _category_.json --- docs/get-started/_category_.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/_category_.json b/docs/get-started/_category_.json index eb1bf858..5a453138 100644 --- a/docs/get-started/_category_.json +++ b/docs/get-started/_category_.json @@ -1,5 +1,5 @@ { - "label": "🚀 Get Started", + "label": " Get Started", "position": 2, "link": { "type": "generated-index", From 4e5c79a0c22b61a46fca87cf49664cfda79e29e1 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:29:16 +0100 Subject: [PATCH 63/81] Update _category_.json --- docs/get-started/models/_category_.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/_category_.json b/docs/get-started/models/_category_.json index d16322d9..aa78b52c 100644 --- a/docs/get-started/models/_category_.json +++ b/docs/get-started/models/_category_.json @@ -1,5 +1,5 @@ { - "label": "Models", + "label": " Choose Model", "position": 2, "link": { "type": "generated-index", From bc57728854c23c673310a9e84c376269262ca5f5 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:29:48 +0100 Subject: [PATCH 64/81] Update _category_.json --- docs/get-started/models/_category_.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/_category_.json b/docs/get-started/models/_category_.json index aa78b52c..f5a31c90 100644 --- a/docs/get-started/models/_category_.json +++ b/docs/get-started/models/_category_.json @@ -1,5 +1,5 @@ { - "label": " Choose Model", + "label": " Our Models", "position": 2, "link": { "type": "generated-index", From 78ed4c137aa46e89cf76e0f2999c24890ff1a5b9 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:33:43 +0100 Subject: [PATCH 65/81] Update selecting-redstone-model.md --- docs/get-started/selecting-redstone-model.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/selecting-redstone-model.md b/docs/get-started/selecting-redstone-model.md index f768ddde..ff2d1576 100644 --- a/docs/get-started/selecting-redstone-model.md +++ b/docs/get-started/selecting-redstone-model.md @@ -1,6 +1,6 @@ --- sidebar_position: 1 -sidebar_label: " Models" +sidebar_label: "Select Your Model" --- # RedStone Offers Three Models From abb06b33c9a3286472d22905c6b60763b8659998 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:34:22 +0100 Subject: [PATCH 66/81] Update RedStone-Solutions.md From 3a650eb67f9ac9b1d9dfe70f93cdfa31aec3608d Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:37:02 +0100 Subject: [PATCH 67/81] Update _category_.json --- docs/data-providers/_category_.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/data-providers/_category_.json b/docs/data-providers/_category_.json index 4001306a..b8984b89 100644 --- a/docs/data-providers/_category_.json +++ b/docs/data-providers/_category_.json @@ -1,5 +1,5 @@ { - "label": Data Providers", + "label": Data Providers, "position": 3, "link": { "type": "generated-index", From a582ac54a9c4c22815c8af4e56660ca7de7d5042 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:41:29 +0100 Subject: [PATCH 68/81] Update chains-integration.md-hidden --- docs/get-started/chains-integration.md-hidden | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/chains-integration.md-hidden b/docs/get-started/chains-integration.md-hidden index 2c5238f6..d4114bef 100644 --- a/docs/get-started/chains-integration.md-hidden +++ b/docs/get-started/chains-integration.md-hidden @@ -1,6 +1,6 @@ --- sidebar_position: 8 -sidebar_label: "⛓ Chains integration" +sidebar_label: "Chains We Support" # We've hidden this page, cause we don't want ppl to write their own adapters # as they turn out to be buggy and we right now prefer charging for chains From e02610dad776a7d06e0d475a9432abd269af709f Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:42:05 +0100 Subject: [PATCH 69/81] Update price-feeds.md --- docs/get-started/price-feeds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/price-feeds.md b/docs/get-started/price-feeds.md index c30e7b00..681078c6 100644 --- a/docs/get-started/price-feeds.md +++ b/docs/get-started/price-feeds.md @@ -1,6 +1,6 @@ --- sidebar_position: 5 -sidebar_label: "💹 Price Feeds" +sidebar_label: "Price Feeds We Support" --- import Tabs from '@theme/Tabs'; From f2e500fb8abffc343c3d01fec18698802e4f74c6 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:42:51 +0100 Subject: [PATCH 70/81] Update nft-data-feeds.md --- docs/get-started/nft-data-feeds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/nft-data-feeds.md b/docs/get-started/nft-data-feeds.md index b7f82d66..c9c9cfaa 100644 --- a/docs/get-started/nft-data-feeds.md +++ b/docs/get-started/nft-data-feeds.md @@ -1,6 +1,6 @@ --- sidebar_position: 6 -sidebar_label: "🐵 NFT Data Feeds" +sidebar_label: "Supported NFT Data Feeds" --- # 🐵 NFT Data Feeds From 8badcf871d324e344f5979cbb6d8e03436caca0c Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:44:46 +0100 Subject: [PATCH 71/81] Update nft-data-feeds.md --- docs/get-started/nft-data-feeds.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/nft-data-feeds.md b/docs/get-started/nft-data-feeds.md index c9c9cfaa..002a6881 100644 --- a/docs/get-started/nft-data-feeds.md +++ b/docs/get-started/nft-data-feeds.md @@ -3,7 +3,7 @@ sidebar_position: 6 sidebar_label: "Supported NFT Data Feeds" --- -# 🐵 NFT Data Feeds +# NFT Data Feeds RedStone delivers floor price data for 20 popular NFT collections from OpenSea. [Check the NFT tab in the redstone web app](https://app.redstone.finance/#/app/tokens?selected-tab=2) to see the historical data and corresponding data feed ids. From 303f0dd1b3a84004deb4e42be927be1eee7d9761 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:45:50 +0100 Subject: [PATCH 72/81] Update tokens.md --- docs/get-started/tokens.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/get-started/tokens.md b/docs/get-started/tokens.md index a059d837..599f4fd5 100644 --- a/docs/get-started/tokens.md +++ b/docs/get-started/tokens.md @@ -1,6 +1,6 @@ --- -sidebar_position: 9 -sidebar_label: "🪙 Tokenomics" +sidebar_position: 5 +sidebar_label: "Tokenomics" --- # 🪙 Tokenomics From c2789151792d46c19c47149894e49ec1f29f8350 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:46:30 +0100 Subject: [PATCH 73/81] Update randomness.md --- docs/get-started/randomness.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs/get-started/randomness.md b/docs/get-started/randomness.md index 18ff3764..8b137891 100644 --- a/docs/get-started/randomness.md +++ b/docs/get-started/randomness.md @@ -1,8 +1 @@ ---- -sidebar_position: 7 -sidebar_label: "🎲 Randomness" ---- -# 🎲 Randomness - -Verifiable cross-chain randomness is under development. Please reach out to us if you want to be notified about the progress. From ed1a880c892542bae7922ed4e55146f878f1210d Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:46:44 +0100 Subject: [PATCH 74/81] Delete docs/get-started/randomness.md --- docs/get-started/randomness.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 docs/get-started/randomness.md diff --git a/docs/get-started/randomness.md b/docs/get-started/randomness.md deleted file mode 100644 index 8b137891..00000000 --- a/docs/get-started/randomness.md +++ /dev/null @@ -1 +0,0 @@ - From 64696e47ca7107c9b173cd744dd773329de2373a Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:51:55 +0100 Subject: [PATCH 75/81] Update _category_.json --- docs/get-started/models/_category_.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/models/_category_.json b/docs/get-started/models/_category_.json index f5a31c90..961ffba2 100644 --- a/docs/get-started/models/_category_.json +++ b/docs/get-started/models/_category_.json @@ -3,7 +3,7 @@ "position": 2, "link": { "type": "generated-index", - "description": "Depending on your needs RedStone could be integrated in 3 different ways" + "description": "RedStone offer four unique models that can be integrated into your dApp." }, "collapsed": true } From 2117cb0465e943e01ea91716421aa88bf2f6b581 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:56:28 +0100 Subject: [PATCH 76/81] Update Security.md --- docs/get-started/Security.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-started/Security.md b/docs/get-started/Security.md index 0b5c98f0..fb96c8e6 100644 --- a/docs/get-started/Security.md +++ b/docs/get-started/Security.md @@ -1,6 +1,6 @@ --- sidebar_position: 3 -sidebar_label: "Security and Accuracy" +sidebar_label: "Security & Accuracy" --- ## Security and Accuracy From 7a37937652b23ad499304bc4bd09afa2e0eaf78e Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 18:08:30 +0100 Subject: [PATCH 77/81] Rename docs/get-started/data-formatting-processing.md to docs/Data-Formatting-Processing --- .../data-formatting-processing.md => Data-Formatting-Processing} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{get-started/data-formatting-processing.md => Data-Formatting-Processing} (100%) diff --git a/docs/get-started/data-formatting-processing.md b/docs/Data-Formatting-Processing similarity index 100% rename from docs/get-started/data-formatting-processing.md rename to docs/Data-Formatting-Processing From 4555b70243222cc61f2181fd77e0c97cb208b5f7 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 18:09:00 +0100 Subject: [PATCH 78/81] Rename Data-Formatting-Processing to Data-Formatting-And-Processing --- ...{Data-Formatting-Processing => Data-Formatting-And-Processing} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{Data-Formatting-Processing => Data-Formatting-And-Processing} (100%) diff --git a/docs/Data-Formatting-Processing b/docs/Data-Formatting-And-Processing similarity index 100% rename from docs/Data-Formatting-Processing rename to docs/Data-Formatting-And-Processing From 0cc9522abded3a5a4f63731b5473d85d45e214b5 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 18:09:07 +0100 Subject: [PATCH 79/81] Update Data-Formatting-And-Processing --- docs/Data-Formatting-And-Processing | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Data-Formatting-And-Processing b/docs/Data-Formatting-And-Processing index f4ddf808..90b77fef 100644 --- a/docs/Data-Formatting-And-Processing +++ b/docs/Data-Formatting-And-Processing @@ -1,5 +1,5 @@ --- -sidebar_position: 3 +sidebar_position: 4 sidebar_label: "Data Formatting & Processing" --- From 7af8efd62523cfd31f273228b5ef2de9a951c568 Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 18:09:55 +0100 Subject: [PATCH 80/81] Update and rename docs/get-started/Security.md to docs/Security-And-Accuracy --- docs/{get-started/Security.md => Security-And-Accuracy} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename docs/{get-started/Security.md => Security-And-Accuracy} (99%) diff --git a/docs/get-started/Security.md b/docs/Security-And-Accuracy similarity index 99% rename from docs/get-started/Security.md rename to docs/Security-And-Accuracy index fb96c8e6..8fb26fa8 100644 --- a/docs/get-started/Security.md +++ b/docs/Security-And-Accuracy @@ -1,5 +1,5 @@ --- -sidebar_position: 3 +sidebar_position: 5 sidebar_label: "Security & Accuracy" --- From a788296a548a4855adf13c6b3f1a691269f05fde Mon Sep 17 00:00:00 2001 From: Ari <129996389+AriKimelman@users.noreply.github.com> Date: Fri, 16 Aug 2024 18:12:43 +0100 Subject: [PATCH 81/81] Update Security-And-Accuracy --- docs/Security-And-Accuracy | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/Security-And-Accuracy b/docs/Security-And-Accuracy index 8fb26fa8..cc7ccedb 100644 --- a/docs/Security-And-Accuracy +++ b/docs/Security-And-Accuracy @@ -1,5 +1,4 @@ --- -sidebar_position: 5 sidebar_label: "Security & Accuracy" ---