Replies: 1 comment
-
There's a function called decimals in the actual AggregatorV3 provided by chainlink. @PatrickAlphaC just put the value returned by those functions into a constant because it's required in the contructor for AggregatorV3. Same for initial answer. We're assuming that our mock contract will return $2000 = 1 ETH i.e. the price of 1 ETH is $2,000. Therefore, we just hardcoded both of those values. Since, Solidity doesn't have decimals we added 8 zeroes after 2,000 that's why the value of INITIAL_ANSWER = 200000000000. Hope this helps! :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In lesson 7, Patrick explained about decimal and initial answer which are the parameters of constructor in the MockV3Aggregator contract from chainlink. But i really couldn't understand what really is. Can someone exlain with more details? Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions