@@ -172,6 +172,19 @@ contract ERC20StreamingEnforcerTest is CaveatEnforcerBaseTest {
172172 erc20StreamingEnforcer.beforeHook (terms_, bytes ("" ), singleDefaultMode, execData_, bytes32 (0 ), address (0 ), alice);
173173 }
174174
175+ /// @notice Reverts if the execution value is not zero.
176+ function test_invalidValue () public {
177+ uint256 initialAmount_ = 100 ether ;
178+ uint256 maxAmount_ = 100 ether ;
179+ uint256 amountPerSecond_ = 1 ether ;
180+ uint256 startTime_ = block .timestamp ;
181+ bytes memory terms_ = abi.encodePacked (address (basicERC20), initialAmount_, maxAmount_, amountPerSecond_, startTime_);
182+ bytes memory callData_ = _encodeERC20Transfer (bob, 100 );
183+ bytes memory execData_ = _encodeSingleExecution (address (basicERC20), 1 ether, callData_);
184+ vm.expectRevert ("ERC20StreamingEnforcer:invalid-value " );
185+ erc20StreamingEnforcer.beforeHook (terms_, "" , singleDefaultMode, execData_, bytes32 (0 ), address (0 ), alice);
186+ }
187+
175188 //////////////////// Valid cases //////////////////////
176189 /**
177190 * @notice Test getTermsInfo() on correct 148-byte terms
@@ -418,7 +431,7 @@ contract ERC20StreamingEnforcerTest is CaveatEnforcerBaseTest {
418431 /**
419432 * @notice Integration test: Successful native token streaming via delegation.
420433 * A delegation is created that uses the erc20StreamingEnforcer. Two native token transfers
421- * (user ops) are executed sequentially. The test verifies that the enforcer’ s state is updated
434+ * (user ops) are executed sequentially. The test verifies that the enforcer' s state is updated
422435 * correctly and that the available amount decreases as expected.
423436 */
424437 function test_nativeTokenStreamingIntegration_Success () public {
0 commit comments