diff --git a/contracts/contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol b/contracts/contracts/strategies/NativeStaking/NativeStakingSSVStrategy.sol index 75a6f6cc4e..970251e776 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 from allowed contracts" ); } } diff --git a/contracts/contracts/strategies/NativeStaking/ValidatorRegistrator.sol b/contracts/contracts/strategies/NativeStaking/ValidatorRegistrator.sol index 625230091b..ee509eb8e0 100644 --- a/contracts/contracts/strategies/NativeStaking/ValidatorRegistrator.sol +++ b/contracts/contracts/strategies/NativeStaking/ValidatorRegistrator.sol @@ -134,7 +134,7 @@ abstract contract ValidatorRegistrator is Governable, Pausable { bytes11(0), address(this) ); - IDepositContract(BEACON_CHAIN_DEPOSIT_CONTRACT).deposit( + IDepositContract(BEACON_CHAIN_DEPOSIT_CONTRACT).deposit{ value: 32 ether }( validators[i].pubkey, withdrawal_credentials, validators[i].signature, diff --git a/contracts/package.json b/contracts/package.json index 5f728f7549..74100a2bb0 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -19,7 +19,7 @@ "prettier:check": "prettier -c \"*.js\" \"deploy/**/*.js\" \"scripts/**/*.js\" \"smoke/**/*.js\" \"scripts/**/*.js\" \"tasks/**/*.js\" \"test/**/*.js\" \"utils/**/*.js\"", "prettier:js": "prettier --write \"*.js\" \"deploy/**/*.js\" \"scripts/**/*.js\" \"smoke/**/*.js\" \"scripts/**/*.js\" \"tasks/**/*.js\" \"test/**/*.js\" \"utils/**/*.js\"", "prettier:sol": "prettier --write \"contracts/**/*.sol\"", - "test": "IS_TEST=true npx hardhat test", + "test": "rm -rf deployments/hardhat && IS_TEST=true npx hardhat test", "test:fork": "./fork-test.sh", "test:arb-fork": "FORK_NETWORK_NAME=arbitrumOne ./fork-test.sh", "test:fork:w_trace": "TRACE=true ./fork-test.sh",