Skip to content

Lesson 10: LendingPool.withdraw() function #30

Answered by PatrickAlphaC
ChakibHi asked this question in Q&A
Discussion options

You must be logged in to vote

Ok now I'm up to speed with these. Amazing questions all.

A few points of confusion.

There are 2 kinds of withdraw functions in this process

  • One is to withdraw your ETH out of the WETH contract. (converting your WETH ERC20 version of ETH back into it's regular non-tokenized version of ETH.
  • Withdrawing your deposited collateral from the Aave contract.

The original question here is asking "How do I withdraw all of my original deposited collateral?"

Which we can do by:

  1. First repaying all our debts
  2. Then withdrawing everything (using that nice -1 syntax)

_Note: This brings up a good point, in a bigger project it would be nice to refactor the code so that we had fewer duplicated functions, …

Replies: 4 comments 23 replies

Comment options

You must be logged in to vote
6 replies
@AlbertoSinigaglia
Comment options

@AlbertoSinigaglia
Comment options

@ChakibHi
Comment options

@AlbertoSinigaglia
Comment options

@ChakibHi
Comment options

Comment options

You must be logged in to vote
7 replies
@AlbertoSinigaglia
Comment options

@ChakibHi
Comment options

@AlbertoSinigaglia
Comment options

@AlbertoSinigaglia
Comment options

@PatrickAlphaC
Comment options

Comment options

You must be logged in to vote
9 replies
@cromewar
Comment options

@Nlferu
Comment options

@cromewar
Comment options

@Nlferu
Comment options

@Nlferu
Comment options

Answer selected by PatrickAlphaC
Comment options

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants