WrappedTokenGatewayV3

  • depositETH(address onBehalfOf, uint16 referralCode) (payable) Wraps the sent ETH into WETH and deposits into the Aave pool.

    • onBehalfOf: User who will receive the aTokens.

    • referralCode: Code for referral programs (usually 0).

  • withdrawETH(address asset, uint256 amount, address to) Withdraws WETH from the pool, unwraps it, and sends ETH to to.

  • withdrawETHWithPermit(address asset, uint256 amount, address to, uint256 deadline, uint8 v, bytes32 r, bytes32 s) Like withdrawETH, but uses an ERC20 permit signature for gasless approval.

  • borrowETH(address, uint256 amount, uint256 interestRateMode, uint16 referralCode) Borrows ETH from the pool (internally via WETH).

    • interestRateMode: Stable or variable debt.

    • referralCode: Referral tracking.

  • repayETH(address, uint256 amount, uint256 rateMode, address onBehalfOf) (payable) Repays borrowed ETH (wrapped as WETH, then repaid to the pool).

    • onBehalfOf: Allows repaying someone else’s debt.


Admin / Emergency

  • emergencyEtherTransfer(address to, uint256 amount) Allows the owner to transfer stuck ETH from the contract.

  • emergencyTokenTransfer(address token, address to, uint256 amount) Allows the owner to transfer stuck ERC20 tokens.

  • getWETHAddress() → address Returns the WETH token address used internally.

  • owner() → address Returns the current contract owner.

  • transferOwnership(address newOwner) Transfers contract ownership.

  • renounceOwnership() Allows the current owner to give up control.


Events

  • OwnershipTransferred(previousOwner, newOwner) Emitted when contract ownership is transferred to a new admin.

Last updated

Was this helpful?