@@ -509,7 +509,7 @@ contract ExecuteTransaction is TimelockMultiAdminShimTest {
509509 assertEq (timelockTxnCall.eta, _eta);
510510 }
511511
512- function testFuzz_FlushesAccidentallySentETH (
512+ function testFuzz_OnlyForwardsIntendedETH_DoesNotFlushAccidentalETH (
513513 address _target ,
514514 uint256 _value ,
515515 string memory _signature ,
@@ -527,15 +527,15 @@ contract ExecuteTransaction is TimelockMultiAdminShimTest {
527527 vm.deal (admin, _value);
528528 vm.prank (admin);
529529
530- // Execute transaction - should flush ALL ETH (both the intended value and accidental ETH)
530+ // Execute transaction - should only forward the intended msg. value, not accidental ETH
531531 timelockMultiAdminShim.executeTransaction {value: _value}(_target, _value, _signature, _data, _eta);
532532
533- // Verify that ALL ETH was flushed (both the intended value and the accidental ETH )
534- assertEq (address (timelockMultiAdminShim).balance, 0 );
533+ // Verify that accidental ETH remains in the contract (safer behavior )
534+ assertEq (address (timelockMultiAdminShim).balance, _accidentalETH );
535535
536536 // Verify that the timelock received the original intended value as the parameter
537- // (the timelock actually receives all ETH via {value: address(this).balance },
538- // but the _value parameter is still the original intended value)
537+ // (the timelock receives ETH via {value: msg.value },
538+ // and the _value parameter is the original intended value)
539539 MockCompoundTimelock.TimelockTransactionCall memory timelockTxnCall = timelock.lastParam__executeTransaction__ ();
540540 assertEq (timelockTxnCall.value, _value);
541541 }
0 commit comments