Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion solidity/src/FlowYieldVaultsRequests.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions solidity/test/FlowYieldVaultsRequests.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down