Skip to content

Commit

Permalink
Zapper: call deposit directly on WETH
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivo Georgiev committed Oct 21, 2021
1 parent b2a799e commit 2631925
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions contracts/wallet/Zapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ interface IyVaultV2 {
function deposit(uint, address) external returns (uint);
}

interface IWETH {
function deposit() external payable;
}

// Decisions: will start with aave over compound (easier API - has `onBehalfOf`, referrals), compound can be added later if needed
// uni v3 needs to be supported since it's proving that it's efficient and the router is different
contract WalletZapper {
Expand Down Expand Up @@ -141,8 +145,7 @@ contract WalletZapper {

// wrap WETH
function wrapETH() payable external {
// TODO: it may be slightly cheaper to call deposit() directly
payable(WETH).transfer(msg.value);
IWETH(WETH).deposit{ value: msg.value }();
}

// Uniswap V3
Expand Down

0 comments on commit 2631925

Please sign in to comment.