From b2e9eaaf8b8354a4b5b887b48af5f996b41e8d02 Mon Sep 17 00:00:00 2001 From: liobrasil Date: Fri, 20 Feb 2026 18:57:44 -0400 Subject: [PATCH] fix(S1): use blocklist zero-address error --- solidity/src/FlowYieldVaultsRequests.sol | 5 ++++- solidity/test/FlowYieldVaultsRequests.t.sol | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/solidity/src/FlowYieldVaultsRequests.sol b/solidity/src/FlowYieldVaultsRequests.sol index 8cc0f08..3273714 100644 --- a/solidity/src/FlowYieldVaultsRequests.sol +++ b/solidity/src/FlowYieldVaultsRequests.sol @@ -199,6 +199,9 @@ contract FlowYieldVaultsRequests is ReentrancyGuard, Ownable2Step { /// @notice Cannot add zero address to allowlist error CannotAllowlistZeroAddress(); + /// @notice Cannot add zero address to blocklist + error CannotBlocklistZeroAddress(); + /// @notice Amount must be greater than zero error AmountMustBeGreaterThanZero(); @@ -589,7 +592,7 @@ contract FlowYieldVaultsRequests is ReentrancyGuard, Ownable2Step { for (uint256 i = 0; i < _addresses.length; ) { if (_addresses[i] == address(0)) - revert CannotAllowlistZeroAddress(); + revert CannotBlocklistZeroAddress(); blocklisted[_addresses[i]] = true; unchecked { ++i; diff --git a/solidity/test/FlowYieldVaultsRequests.t.sol b/solidity/test/FlowYieldVaultsRequests.t.sol index a200cb3..ebd1e80 100644 --- a/solidity/test/FlowYieldVaultsRequests.t.sol +++ b/solidity/test/FlowYieldVaultsRequests.t.sol @@ -573,6 +573,15 @@ contract FlowYieldVaultsRequestsTest is Test { c.createYieldVault{value: 1 ether}(NATIVE_FLOW, 1 ether, VAULT_ID, STRATEGY_ID); } + function test_BatchAddToBlocklist_RevertZeroAddress() public { + address[] memory addrs = new address[](1); + addrs[0] = address(0); + + vm.prank(c.owner()); + vm.expectRevert(FlowYieldVaultsRequests.CannotBlocklistZeroAddress.selector); + c.batchAddToBlocklist(addrs); + } + function test_BlocklistTakesPrecedence() public { address[] memory addrs = new address[](1); addrs[0] = user;