Lesson4:Fund Me(doubt) #1753
Answered
by
thebraveman17
yasharyan0904
asked this question in
Q&A
-
Why did we take minUSD as 5e18 initially because the getConversionRate is already giving the value in uint256 as the real value of eth in USD (as we are dividing by 1e18 already in the code)?? |
Beta Was this translation helpful? Give feedback.
Answered by
thebraveman17
May 26, 2024
Replies: 1 comment 1 reply
-
Let's take some values as an example. If you call the function getConversionRate passing 0.01 for |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
yasharyan0904
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Let's take some values as an example.
If you call the function getConversionRate passing 0.01 for
ethAmount
,ethPrice
will be 3810e18 (current price) andethAmountInUsd
will be(ethPrice * ethAmount) / 1000000000000000000
=3810e18 * 0.01e18 / 1e18
=38.1e18
and the minimum USD amount is 5e18.