Skip to content

Commit

Permalink
Legacy tests for V2
Browse files Browse the repository at this point in the history
  • Loading branch information
pinebit committed Jan 22, 2025
1 parent 6a93b81 commit 59d7bd2
Show file tree
Hide file tree
Showing 4 changed files with 589 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/owr/OptimisticWithdrawalRecipientV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,24 @@ contract OptimisticWithdrawalRecipientV2 is Clone, OwnableRoles {
/// @param recoveryAddressToken Recovered token (cannot be ETH)
/// @param recipient Address receiving recovered token
/// @param amount Amount of recovered token
event RecoverNonOWRecipientFunds(address recoveryAddressToken, address recipient, uint256 amount);
event RecoverNonOWRecipientFunds(address indexed recoveryAddressToken, address indexed recipient, uint256 amount);

/// Emitted after funds withdrawn using pull flow
/// @param account Account withdrawing funds for
/// @param amount Amount withdrawn
event Withdrawal(address account, uint256 amount);
event Withdrawal(address indexed account, uint256 amount);

/// Emitted when a Pectra consolidation request is done
/// @param requester Address of the requester
/// @param from Source validator public key
/// @param to Target validator public key
event ConsolidationRequested(address indexed requester, bytes from, bytes to);
event ConsolidationRequested(address indexed requester, bytes indexed from, bytes indexed to);

/// Emitted when a Pectra withdrawal request is done
/// @param requester Address of the requester
/// @param pubKey Validator public key
/// @param amount Withdrawal amount
event WithdrawalRequested(address indexed requester, bytes pubKey, uint256 amount);
event WithdrawalRequested(address indexed requester, bytes indexed pubKey, uint256 amount);

/// -----------------------------------------------------------------------
/// storage
Expand Down
11 changes: 11 additions & 0 deletions src/test/owr/OWRV2Reentrancy.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.19;

import "forge-std/Test.sol";
import {OptimisticWithdrawalRecipientV2} from "src/owr/OptimisticWithdrawalRecipientV2.sol";

contract OWRV2Reentrancy is Test {
receive() external payable {
if (address(this).balance <= 1 ether) OptimisticWithdrawalRecipientV2(msg.sender).distributeFunds();
}
}
Loading

0 comments on commit 59d7bd2

Please sign in to comment.