Skip to content

Commit

Permalink
Merge pull request #202 from sablier-labs/refactor/remove-set-claimed
Browse files Browse the repository at this point in the history
refactor: remove "_setClaimed"
  • Loading branch information
andreivladbrg authored Oct 5, 2023
2 parents c970d08 + 034e06a commit 4b27ec0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
4 changes: 3 additions & 1 deletion src/SablierV2MerkleStreamerLL.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.19;

import { BitMaps } from "@openzeppelin/contracts/utils/structs/BitMaps.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { ISablierV2LockupLinear } from "@sablier/v2-core/src/interfaces/ISablierV2LockupLinear.sol";
Expand All @@ -16,6 +17,7 @@ contract SablierV2MerkleStreamerLL is
ISablierV2MerkleStreamerLL, // 2 inherited components
SablierV2MerkleStreamer // 4 inherited components
{
using BitMaps for BitMaps.BitMap;
using SafeERC20 for IERC20;

/*//////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -79,7 +81,7 @@ contract SablierV2MerkleStreamerLL is
_checkClaim(index, leaf, merkleProof);

// Effects: mark the index as claimed.
_setClaimed(index);
_claimedBitMap.set(index);

// Interactions: create the stream via {SablierV2LockupLinear}.
streamId = LOCKUP_LINEAR.createWithDurations(
Expand Down
12 changes: 1 addition & 11 deletions src/abstracts/SablierV2MerkleStreamer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ abstract contract SablierV2MerkleStreamer is
//////////////////////////////////////////////////////////////////////////*/

/// @dev Packed booleans that record the history of claims.
BitMaps.BitMap private _claimedBitMap;
BitMaps.BitMap internal _claimedBitMap;

/*//////////////////////////////////////////////////////////////////////////
CONSTRUCTOR
Expand Down Expand Up @@ -125,14 +125,4 @@ abstract contract SablierV2MerkleStreamer is
revert Errors.SablierV2MerkleStreamer_InvalidProof();
}
}

/*//////////////////////////////////////////////////////////////////////////
INTERNAL NON-CONSTANT FUNCTIONS
//////////////////////////////////////////////////////////////////////////*/

/// @notice Marks an index as claimed in the bitmap.
/// @param index The index of the recipient to mark as claimed.
function _setClaimed(uint256 index) internal {
_claimedBitMap.set(index);
}
}

0 comments on commit 4b27ec0

Please sign in to comment.