Skip to content

Lesson 7: Questions about how the constructor works in this lesson #2693

Answered by othaime-en
pacelliv asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @pacelliv if you remember in the initial lesson where we created FundMe.sol we hardcoded the priceFeedAddress inside the contract like this, AggregatorV3Interface priceFeed = AggregatorV3Interface(0x8A753747A1Fa494EC906cE90E9f37563A8AF630e); especially inside the priceConverter.sol. With this setup, priceFeed becomes sort of a contract instance (since it is tied to the interface AggregatorV3Interface) where you can call all the functions related to the contract at the given address (0x8A753747A1Fa494EC906cE90E9f37563A8AF630e). However, hardcoding the address like this is not really efficient because if the address changes after we have deployed our contract, we'd have to deploy a new …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@pacelliv
Comment options

@othaime-en
Comment options

Answer selected by pacelliv
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants