From 87c525471a36affc58a8e9082957a3d1ac5ed923 Mon Sep 17 00:00:00 2001 From: Domen Grabec Date: Sat, 27 Apr 2024 00:28:29 +0200 Subject: [PATCH] allow for WETH to send ETH to the contract --- .../strategies/NativeStaking/NativeStakingSSVStrategy.sol | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contracts/contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol b/contracts/contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol index 75a6f6cc4e..f3a86e6b47 100644 --- a/contracts/contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol +++ b/contracts/contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol @@ -251,14 +251,15 @@ contract NativeStakingSSVStrategy is } /** - * @notice Only accept ETH from the FeeAccumulator + * @notice Only accept ETH from the FeeAccumulator and the WETH contract - required when + * unwrapping WETH just before staking it to the validator * @dev don't want to receive donations from anyone else as this will * mess with the accounting of the consensus rewards and validator full withdrawals */ receive() external payable { require( - msg.sender == FEE_ACCUMULATOR_ADDRESS, - "eth not sent from Fee Accumulator" + msg.sender == FEE_ACCUMULATOR_ADDRESS || msg.sender == WETH_TOKEN_ADDRESS, + "eth not sent from Fee Accumulator or WETH contract" ); } }