Difference #2731
-
Lesson: Raffle/Lottery
I also looked at the ether documentation to know what So as far as I understood my 00-deploy-mocks.js const BASE_FEE = ethers.utils.parseEther("0.25"); // 0.25 is the premium. It costs 0.25 LINK per request
const GAS_PRICE_LINK = 1e9; |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey @OmarWaqar123 from the documentation, we see that |
Beta Was this translation helpful? Give feedback.
-
And as @othaime-en said above that the And this is just on the mock side, on a testnet and on a mainnet we only deposit LINK tokens on Chainlink dashboards. |
Beta Was this translation helpful? Give feedback.
Hey @OmarWaqar123 from the documentation, we see that
ethers.utils.parseEther()
provides the string representation of a BigNumber instance inwei
. This means we convert whatever ETH we pass in into the string representation in wei (18 decimals). This is just a fancy way of saying that it is a unit conversion functionality. So we simply multiply by 18 decimals places (1e18
). technically, it doesn't work on ETH explicitly, it works on anything that has the a unit representation same aswei
. So whatever unit you have if it is equal to1e18
,ethers.utils.parseEther()
can work just fine.Back to our scenario, if you look at LINK token documentation, you can see that its smallest unit called
JUELS