If you need to use native ETH (MATIC / AVAX in case of side chain market) in the protocol, it must first be wrapped into WETH (or WMATIC / WAVAX). The WETH Gateway contract is a helper contract to easily wrap and unwrap ETH (or MATIC / AVAX) as necessary when interacting with the protocol, since only ERC20 is used within protocol interactions.
function depositETH(address lendingPool, address onBehalfOf, uint16 referralCode)
msg.valueamount of ETH into the protocol, minting the same amount of corresponding aWETH, and transferring them to the
referralCode, use the referral code:
function withdrawETH(address lendingPool, uint256 amount, address to)
amountof the WETH, unwraps it to ETH, and transfers the ETH to the
function repayETH(address lendingPool, uint256 amount, uint256 rateMode, address onBehalfOf)
amountof ETH which has a
function borrowETH(address lendingPool, uint256 amount, uint256 interestRateMode, uint16 referralCode)
amountof WETH with
interestRateMode, sending the
amountof unwrapped WETH to
Returns the WETH address used by the WETHGateway.