Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/ftso/5-migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This guide is for applications moving from FTSOv1 to FTSOv2. Briefly, FTSOv2 com
- **[Block-Latency Feeds](/ftso/feeds)**: These feeds are updated with each new block, approximately every 1.8 seconds. They can be accessed through [FtsoV2Interface](/ftso/solidity-reference/FtsoV2Interface) and are available directly on-chain.
- **[Anchor Feeds](/ftso/scaling/anchor-feeds)**: These feeds are provided through [Scaling](/ftso/scaling/overview) with a latency of 90 seconds. Feeds can be verified using [FtsoV2Interface](/ftso/solidity-reference/FtsoV2Interface) but are not immediately available on-chain.

A key difference between the two is the introduction of a payment mechanism for data access. This system helps prevent unnecessary data requests and ensures sustainable funding. For more details, refer to the [`IFeeCalculator`](/ftso/solidity-reference/IFeeCalculator) contract, which calculates fees for data access using the [`calculateFeeByIds`](/ftso/solidity-reference/IFeeCalculator#calculatefeebyids) and [`calculateFeeByIndices`](/ftso/solidity-reference/IFeeCalculator#calculatefeebyindices) methods.
A key difference between the two is the introduction of a payment mechanism for data access. This system helps prevent unnecessary data requests and ensures sustainable funding. For more details, refer to the [`IFeeCalculator`](/ftso/solidity-reference/IFeeCalculator) contract, which calculates fees for data access using the [`calculateFeeByIds`](/ftso/solidity-reference/IFeeCalculator#calculatefeebyids) method.

Additionally, a new Long Term Support (LTS) system has been launched to ensure continued access to essential data and metadata within the Flare ecosystem. A series of [LTS interfaces](#lts-interfaces) have been introduced, each aligned with a specific product in the Flare ecosystem. It is strongly recommended to use these LTS contracts for data access instead of querying individual contracts or interfaces, as they are designed for long-term stability, even as underlying protocols evolve or migrate.

Expand Down Expand Up @@ -93,7 +93,7 @@ The primary goal of the Long Term Support (LTS) interfaces is to offer a stable
:::warning

- **RandomNumberV2Interface:** In addition to providing random numbers, the new methods also return a `_isSecureRandom` flag. Learn more about this flag in the guide on [Secure Random Numbers](/network/guides/secure-random-numbers).
- **FtsoV2Interface:** Provides access to both block-latency and anchor feeds. You can retrieve feeds using the [`getFeedById`](/ftso/solidity-reference/FtsoV2Interface#getfeedbyid) or [`getFeedByIndex`](/ftso/solidity-reference/FtsoV2Interface#getfeedbyindex) methods. These methods are now payable, and while the current fee is set to `0`, it is advisable to use [`FeeCalculator`](/ftso/solidity-reference/IFeeCalculator) to calculate the fee and be prepared for potential future changes.
- **FtsoV2Interface:** Provides access to fetching block-latency feeds onchain, and verifying anchor feeds onchain. You can retrieve feeds using the [`getFeedById`](/ftso/solidity-reference/FtsoV2Interface#getfeedbyid) or [`getFeedsById`](/ftso/solidity-reference/FtsoV2Interface#getfeedsbyid) methods. These methods are now payable, and while the current fee is set to `0`, it is advisable to use [`FeeCalculator`](/ftso/solidity-reference/IFeeCalculator) to calculate the fee and be prepared for potential future changes.

:::

Expand Down
99 changes: 0 additions & 99 deletions docs/ftso/solidity-reference/FtsoV2Interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ description: Primary interface for interacting with FTSOv2.
import Remix from "@site/src/components/remix";
import CodeBlock from "@theme/CodeBlock";
import FTSOV2FeedById from "!!raw-loader!/examples/developer-hub-solidity/FTSOV2FeedById.sol";
import FTSOV2FeedByIndex from "!!raw-loader!/examples/developer-hub-solidity/FTSOV2FeedByIndex.sol";
import FTSOV2FeedByIdWei from "!!raw-loader!/examples/developer-hub-solidity/FTSOV2FeedByIdWei.sol";
import FTSOV2FeedsById from "!!raw-loader!/examples/developer-hub-solidity/FTSOV2FeedsById.sol";
import FTSOV2FeedsByIdWei from "!!raw-loader!/examples/developer-hub-solidity/FTSOV2FeedsByIdWei.sol";
import FTSOV2FeedsByIndexWei from "!!raw-loader!/examples/developer-hub-solidity/FTSOV2FeedsByIndexWei.sol";
import FTSOV2VerifyProof from "!!raw-loader!/examples/developer-hub-solidity/FTSOV2VerifyProof.sol";

Primary interface for interacting with FTSOv2. This is a long-term support (LTS) interface, designed to ensure continuity even as underlying contracts evolve or protocols migrate to new versions.
Expand Down Expand Up @@ -55,7 +53,6 @@ function getFeedById(
</details>

<Remix fileName="FTSOV2FeedById.sol">Open sample in Remix</Remix>
<br></br>

### getFeedByIdInWei

Expand Down Expand Up @@ -90,64 +87,6 @@ function getFeedByIdInWei(
</details>

<Remix fileName="FTSOV2FeedByIdWei.sol">Open sample in Remix</Remix>
<br></br>

### getFeedByIndex

Returns stored data of a feed.
A fee (calculated by the FeeCalculator contract) may need to be paid.

```solidity
function getFeedByIndex(
uint256 _index
) external payable returns (
uint256 _value,
int8 _decimals,
uint64 _timestamp
);
```

#### Parameters

- `_index`: The index of the feed, corresponding to feed id in the FastUpdatesConfiguration contract.

#### Returns

- `_value`: The value for the requested feed.
- `_decimals`: The decimal places for the requested feed.
- `_timestamp`: The timestamp of the last update.

<details>
<summary>Sample contract usage</summary>

<CodeBlock language="solidity" title="FTSOV2FeedByIndex.sol">
{FTSOV2FeedByIndex}
</CodeBlock>

</details>

<Remix fileName="FTSOV2FeedByIndex.sol">Open sample in Remix</Remix>
<br></br>

### getFeedIndex

Returns the index of a feed.

```solidity
function getFeedIndex(
bytes21 _feedId
) external view returns (
uint256 _index
);
```

#### Parameters

- `_feedId`: The feed id.

#### Returns

- `_index`: The index of the feed.

### getFeedsById

Expand Down Expand Up @@ -184,7 +123,6 @@ function getFeedsById(
</details>

<Remix fileName="FTSOV2FeedsById.sol">Open sample in Remix</Remix>
<br></br>

### getFeedsByIdInWei

Expand Down Expand Up @@ -219,42 +157,6 @@ function getFeedsByIdInWei(
</details>

<Remix fileName="FTSOV2FeedsByIdWei.sol">Open sample in Remix</Remix>
<br></br>

### getFeedsByIndexInWei

Returns value in wei of each feed and a timestamp.
For some feeds, a fee (calculated by the FeeCalculator contract) may need to be paid.

```solidity
function getFeedsByIndexInWei(
uint256[] _indices
) external payable returns (
uint256[] _values,
uint64 _timestamp
);
```

#### Parameters

- `_indices`: Indices of the feeds, corresponding to feed ids in the FastUpdatesConfiguration contract.

#### Returns

- `_values`: The list of values for the requested feeds in wei (i.e. with 18 decimal places).
- `_timestamp`: The timestamp of the last update.

<details>
<summary>Sample contract usage</summary>

<CodeBlock language="solidity" title="FTSOV2FeedsByIndexWei.sol">
{FTSOV2FeedsByIndexWei}
</CodeBlock>

</details>

<Remix fileName="FTSOV2FeedsByIndexWei.sol">Open sample in Remix</Remix>
<br></br>

### verifyFeedData

Expand Down Expand Up @@ -286,7 +188,6 @@ function verifyFeedData(
</details>

<Remix fileName="FTSOV2VerifyProof.sol">Open sample in Remix</Remix>
<br></br>

## Structures

Expand Down
16 changes: 0 additions & 16 deletions docs/ftso/solidity-reference/IFeeCalculator.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,3 @@ function calculateFeeByIds(
#### Parameters

- `_feedIds`: List of feed ids.

### calculateFeeByIndices

Calculates a fee that needs to be paid to fetch feeds' data.

```solidity
function calculateFeeByIndices(
uint256[] _indices
) external view returns (
uint256 _fee
);
```

#### Parameters

- `_indices`: Indices of the feeds, corresponding to feed ids in the FastUpdatesConfiguration contract.
108 changes: 0 additions & 108 deletions examples/developer-hub-solidity/FTSOV2FeedByIdIndex.sol

This file was deleted.

34 changes: 0 additions & 34 deletions examples/developer-hub-solidity/FTSOV2FeedByIndex.sol

This file was deleted.

65 changes: 0 additions & 65 deletions examples/developer-hub-solidity/FTSOV2FeedsByIndex.sol

This file was deleted.

Loading
Loading