Skip to content

Lesson 4: FundMe testPriceFeedVersionIsAccurate() failed after editing priceFeed #231

Answered by asobiesk
Aishwaria8786 asked this question in Q&A
Discussion options

You must be logged in to vote

Take a look at the FundMe constructor:

constructor(address s_priceFeed) {
        i_owner = msg.sender;
  }

You never really initialize your state variable s_priceFeed. What you should do is:

constructor(address _priceFeedAddress) {
        i_owner = msg.sender;
        s_priceFeed = AggregatorV3Interface(_priceFeedAddress);
    }

Now the price feed will be initialized and you should be able to retrieve its version.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Aishwaria8786
Comment options

Answer selected by Aishwaria8786
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants