mirror of openzeppelin-contracts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
openzeppelin-contracts/contracts/mocks/TimelockReentrant.sol

26 lines
622 B

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {Address} from "../utils/Address.sol";
contract TimelockReentrant {
address private _reenterTarget;
bytes private _reenterData;
bool _reentered;
function disableReentrancy() external {
_reentered = true;
}
function enableRentrancy(address target, bytes calldata data) external {
_reenterTarget = target;
_reenterData = data;
}
function reenter() external {
if (!_reentered) {
_reentered = true;
Address.functionCall(_reenterTarget, _reenterData);
}
}
}