Skip to content

Commit

Permalink
Merge pull request #65 from Tenderize/nv/livepeer-remediation
Browse files Browse the repository at this point in the history
Livepeer: use intermediary eth balance value for approval of WETH
  • Loading branch information
kyriediculous committed Sep 28, 2023
2 parents d740feb + a043cb4 commit ed8d90e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/adapters/LivepeerAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ contract LivepeerAdapter is Adapter {
uint256 ethBalance = address(this).balance;
// convert fees to WETH
WETH.deposit{ value: ethBalance }();
ERC20(address(WETH)).safeApprove(address(UNISWAP_ROUTER), address(this).balance);
ERC20(address(WETH)).safeApprove(address(UNISWAP_ROUTER), ethBalance);
// Calculate Slippage Threshold
uint256 twapPrice = TWAP.getPriceX96FromSqrtPriceX96(TWAP.getSqrtTwapX96(UNI_POOL, TWAP_INTERVAL));
// Create initial params for swap
Expand Down

0 comments on commit ed8d90e

Please sign in to comment.