3 Questions #2284
-
reference can someone please answer these 3 questions. 1)While writing a test for the fund me contract why did @PatrickAlphaC use 2)While writing the same test script but specifically for AggregatorV3Interface public priceFeed;
constructor(address priceFeedAddress) {
owner = msg.sender;
priceFeed = AggregatorV3Interface(priceFeedAddress);
} 3)also when I'm writing |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
For questions, the category should be Q&A; therefore, it should be changed. Now, as to your questions:
|
Beta Was this translation helpful? Give feedback.
For questions, the category should be Q&A; therefore, it should be changed.
Now, as to your questions:
getContract("FundMe", deployer);
returns the instance of the contract FundMe with the signer/interfacedeployer
. Whereasdeployments.get("FundMe")
returns the latest instance of the contract FundMe.For public state variables, an automatic getter function is generated by the Solidity compiler.
fundMe.priceFeed();
basically works the same as a getter function, i.e.fundMe.getPriceFeed()
. There is no difference between them. Both of them return the variable priceFeed in FundMeIf it does not work even if you importing the packages properly in your hardhat.config.js, then it can be de…