Skip to content

Lesson 7: Ethers JS ".provider" only on read calls, why so? #910

Answered by krakxn
0xCardiE asked this question in Q&A
Discussion options

You must be logged in to vote

First question: When we use .provider we are using the set of methods given to us by Ethers: for more info click here

Second question: For await fundMe.withdraw() we do not need to use Ethers. Why? Because you probably got an instance of the FundMe contract in fundMe via Ethers/deploying it, so, we can directly use the functions inside the FundMe contract (as fundMe has an instance of it) by the dot notation. So, simply, withdraw() here is from our main FundMe contract, whereas the getBalance() is derived from Ethers.

Hope this answers your doubts

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@0xCardiE
Comment options

Answer selected by 0xCardiE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants