-
why are we calling PriceFeed with braces although it is not a function
|
Beta Was this translation helpful? Give feedback.
Answered by
pacelliv
Jan 25, 2023
Replies: 1 comment
-
Hello @haris4121, that is possible because when you declare a variable as It means this variable: AggregatorV3Interface public PriceFeed; Under the hood is equivalent to: function getPriceFeed() public view returns (AggregatorV3Interface) {
return PriceFeed;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
haris4121
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @haris4121, that is possible because when you declare a variable as
public
, Solidity creates getter function for that variable.It means this variable:
Under the hood is equivalent to: