Skip to content

Commit 5a949d7

Browse files
authored
fix:N1-Lack of Reentrancy Protection (#5)
* fix:N1-Lack of Reentrancy Protection * fix:N3-Missing Zero Value Validation for merkleTreeRoot * Revert "fix:N3-Missing Zero Value Validation for merkleTreeRoot" This reverts commit 40159cf.
1 parent 386ce72 commit 5a949d7

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/VestingEarndrop/VestingEarndrop.sol

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ import "@openzeppelin-v5/contracts/token/ERC20/utils/SafeERC20.sol";
2323
import "@openzeppelin-v5/contracts/utils/cryptography/ECDSA.sol";
2424
import "@openzeppelin-v5/contracts/utils/cryptography/EIP712.sol";
2525
import "@openzeppelin-v5/contracts/utils/cryptography/MerkleProof.sol";
26+
import "@openzeppelin-v5/contracts/utils/ReentrancyGuard.sol";
2627

27-
contract VestingEarndrop is Ownable2Step, EIP712 {
28+
contract VestingEarndrop is Ownable2Step, EIP712, ReentrancyGuard {
2829
using SafeERC20 for IERC20;
2930

3031
struct Stage {
@@ -323,7 +324,7 @@ contract VestingEarndrop is Ownable2Step, EIP712 {
323324
uint256 earndropId,
324325
ClaimParams calldata params,
325326
bytes calldata _signature
326-
) external payable earndropExists(earndropId) notRevoked(earndropId) isConfirmed(earndropId) {
327+
) external payable nonReentrant earndropExists(earndropId) notRevoked(earndropId) isConfirmed(earndropId) {
327328
Earndrop storage earndrop = earndrops[earndropId];
328329

329330
if (params.stageIndex >= earndrop.stages.length) {
@@ -379,7 +380,7 @@ contract VestingEarndrop is Ownable2Step, EIP712 {
379380
uint256 earndropId,
380381
ClaimParams[] calldata params,
381382
bytes calldata signature
382-
) external payable earndropExists(earndropId) notRevoked(earndropId) isConfirmed(earndropId) {
383+
) external payable nonReentrant earndropExists(earndropId) notRevoked(earndropId) isConfirmed(earndropId) {
383384
if (params.length == 0) {
384385
revert InvalidParameter("Empty params");
385386
}

0 commit comments

Comments
 (0)