Lesson 4: FundMe testPriceFeedVersionIsAccurate() failed after editing priceFeed #231
Answered
by
asobiesk
Aishwaria8786
asked this question in
Q&A
-
Here is FundMe.sol
Here is FundMeTest.t.sol
Here is DeployFundMe.s.sol
|
Beta Was this translation helpful? Give feedback.
Answered by
asobiesk
Jul 3, 2023
Replies: 1 comment 1 reply
-
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. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Aishwaria8786
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Take a look at the FundMe constructor:
You never really initialize your state variable s_priceFeed. What you should do is:
Now the price feed will be initialized and you should be able to retrieve its version.