Understanding interface() syntax #182
-
Hello, I am going through the FundMe hardhat lesson. I am having difficulty wrapping my head around 2 aspects in the FundMe.sol contract.
and
Breaking down step by step as to how I understand it, constructor receives address Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I had to read a little bit about this, I could be wrong. @PatrickAlphaC should confirm! This syntax basically means that the "address" that holds the concrete implementation of how a price is computed resides on the blockchain. We cast that address into this interface so that it's easier for us programmers to invoke functions at that address, those functions become available to us through this interface, and the address is where the concrete implementation lives. Also, I think this interface information would be added to our contracts ABI and allow the EVM to invoke appropriate calls. It's an interfacing mechanism. These links might help |
Beta Was this translation helpful? Give feedback.
I had to read a little bit about this, I could be wrong. @PatrickAlphaC should confirm!
This syntax basically means that the "address" that holds the concrete implementation of how a price is computed resides on the blockchain. We cast that address into this interface so that it's easier for us programmers to invoke functions at that address, those functions become available to us through this interface, and the address is where the concrete implementation lives. Also, I think this interface information would be added to our contracts ABI and allow the EVM to invoke appropriate calls. It's an interfacing mechanism.
These links might help
https://ethereum.stackexchange.com/questions/114502…