Skip to content

Commit 418e125

Browse files
committed
remove redundant nonReentrant implementation
Spearbit #14
1 parent 68b5053 commit 418e125

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/EulerSwap.sol

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,6 @@ contract EulerSwap is IEulerSwap, EVCUtil, UniswapHook {
4242
s.status = 2; // can only be used via delegatecall proxy
4343
}
4444

45-
modifier nonReentrant() {
46-
CtxLib.State storage s = CtxLib.getState();
47-
48-
require(s.status == 1, Locked());
49-
s.status = 2;
50-
_;
51-
s.status = 1;
52-
}
53-
5445
modifier nonReentrantView() {
5546
CtxLib.State storage s = CtxLib.getState();
5647
require(s.status != 2, Locked());

src/UniswapHook.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ contract UniswapHook is BaseHook {
6262
/// in activateHook().
6363
function validateHookAddress(BaseHook _this) internal pure override {}
6464

65-
modifier nonReentrantHook() {
65+
modifier nonReentrant() {
6666
CtxLib.State storage s = CtxLib.getState();
6767
require(s.status == 1, LockedHook());
6868
s.status = 2;
@@ -75,7 +75,7 @@ contract UniswapHook is BaseHook {
7575
function _beforeSwap(address sender, PoolKey calldata key, IPoolManager.SwapParams calldata params, bytes calldata)
7676
internal
7777
override
78-
nonReentrantHook
78+
nonReentrant
7979
returns (bytes4, BeforeSwapDelta, uint24)
8080
{
8181
SwapLib.SwapContext memory ctx = SwapLib.init(address(evc), sender, msg.sender);

0 commit comments

Comments
 (0)