I can't feagure out why latestRoundata in priceFeed AggregatorV3Interface interface return price? #5188
Unanswered
RogerBetter
asked this question in
Q&A
Replies: 2 comments
-
is that the order matter, we can rename it at will? |
Beta Was this translation helpful? Give feedback.
0 replies
-
@RogerBetter If you read the documentation then you can find anything about the solution any company provide. In this case, answer is the price which you can rename as well but you need to leave space for other returned variables which you do not want to use by using a comma |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In github AggregatorV3Interface https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol
function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound );
returns no price.
But in the doc and course, we used the exmple code https://docs.chain.link/data-feeds/using-data-feeds/#examine-the-sample-contract to figure out it should return price instead. I'm confused, cuz if the interface does not always represent what is returned, I can't find exmaple code for everything,right?
`// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
contract PriceConsumerV3 {
AggregatorV3Interface internal priceFeed;
}
`
Beta Was this translation helpful? Give feedback.
All reactions