Skip to content

Commit de1b3ed

Browse files
authored
add IBundleAggregatorProxy (#2945)
1 parent 700b783 commit de1b3ed

File tree

2 files changed

+10
-34
lines changed

2 files changed

+10
-34
lines changed

public/samples/DataFeeds/MVR/MVRDataConsumer.sol

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity 0.8.24;
33

4-
// NOTE: The required interfaces will soon be available in the Chainlink package for you to import.
5-
6-
interface IBundleAggregatorProxy {
7-
/**
8-
* @notice Returns the latest bundle data
9-
* @return bundle The latest bundle as raw bytes
10-
*/
11-
function latestBundle() external view returns (bytes memory);
12-
13-
/**
14-
* @notice Returns the timestamp of the latest bundle
15-
* @return timestamp The timestamp of the latest bundle
16-
*/
17-
function latestBundleTimestamp() external view returns (uint256);
18-
19-
/**
20-
* @notice Returns the decimals for each field in the bundle
21-
* @return decimalsArray Array of decimals for each value in the bundle
22-
*/
23-
function bundleDecimals() external view returns (uint8[] memory);
24-
}
4+
import {IBundleAggregatorProxy} from "@chainlink/contracts/src/v0.8/data-feeds/interfaces/IBundleAggregatorProxy.sol";
255

266
/**
277
* @notice This struct defines the exact data structure of the MVR feed

src/content/data-feeds/mvr-feeds/guides/evm-solidity.mdx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,21 @@ struct Data {
6262

6363
Your consumer contract must replicate this structure in the **exact same order** and with the same data types to decode the feed data correctly.
6464

65-
### 2. Set Up the BundleAggregatorProxy
65+
### 2. Import the IBundleAggregatorProxy Interface
6666

67-
Your contract will need a reference to the [`IBundleAggregatorProxy`](/data-feeds/mvr-feeds/api-reference#ibundleaggregatorproxy) interface so it can:
67+
Your contract will need to interact with the MVR feed's proxy contract. The [`IBundleAggregatorProxy`](/data-feeds/mvr-feeds/api-reference#ibundleaggregatorproxy) interface provides the necessary functions:
6868

69-
- Retrieve the raw bytes via [`latestBundle()`](/data-feeds/mvr-feeds/api-reference#latestbundle).
70-
- Retrieve decimals via [`bundleDecimals()`](/data-feeds/mvr-feeds/api-reference#bundledecimals) if the feed includes numeric fields.
71-
- Check the timestamp of the last update via [`latestBundleTimestamp()`](/data-feeds/mvr-feeds/api-reference#latestbundletimestamp).
69+
- [`latestBundle()`](/data-feeds/mvr-feeds/api-reference#latestbundle): Retrieves the raw data bundle.
70+
- [`bundleDecimals()`](/data-feeds/mvr-feeds/api-reference#bundledecimals): Retrieves the decimal places for numeric fields.
71+
- [`latestBundleTimestamp()`](/data-feeds/mvr-feeds/api-reference#latestbundletimestamp): Retrieves the timestamp of the last update.
7272

73-
```solidity
74-
interface IBundleAggregatorProxy {
75-
function latestBundle() external view returns (bytes memory);
76-
function bundleDecimals() external view returns (uint8[] memory);
77-
function latestBundleTimestamp() external view returns (uint256);
73+
Import it directly from the `@chainlink/contracts` library:
7874

79-
// Additional inherited functions omitted for brevity
80-
}
75+
```solidity
76+
import {IBundleAggregatorProxy} from "@chainlink/contracts/src/v0.8/data-feeds/interfaces/IBundleAggregatorProxy.sol";
8177
```
8278

83-
You will set the correct proxy address in your consumer contract.
79+
You will then use this interface to create an instance of the proxy in your consumer contract.
8480

8581
### 3. Validate Data Staleness
8682

0 commit comments

Comments
 (0)