Skip to content

Commit c579571

Browse files
committed
remove unnecessary depth and settleCall
1 parent eb3654a commit c579571

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

src/CowEvcOpenPositionWrapper.sol

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ contract CowEvcOpenPositionWrapper is CowWrapper, PreApprovedHashes {
4343

4444
string public constant name = "Euler EVC - Open Position";
4545

46-
/// @notice Tracks the number of times this wrapper has been called
47-
uint256 public transient depth;
48-
/// @notice Tracks the number of times `evcInternalSettle` has been called
49-
uint256 public transient settleCalls;
50-
5146
uint256 public immutable nonceNamespace;
5247

5348
error Unauthorized(address msgSender);
@@ -162,8 +157,6 @@ contract CowEvcOpenPositionWrapper is CowWrapper, PreApprovedHashes {
162157
/// @param settleData Data which will be used for the parameters in a call to `CowSettlement.settle`
163158
/// @param wrapperData Additional data containing OpenPositionParams
164159
function _wrap(bytes calldata settleData, bytes calldata wrapperData, bytes calldata remainingWrapperData) internal override {
165-
depth = depth + 1;
166-
167160
// Decode wrapper data into OpenPositionParams
168161
OpenPositionParams memory params;
169162
bytes memory signature;
@@ -272,11 +265,6 @@ contract CowEvcOpenPositionWrapper is CowWrapper, PreApprovedHashes {
272265
function evcInternalSettle(bytes calldata settleData, bytes calldata remainingWrapperData) external payable {
273266
require(msg.sender == address(EVC), Unauthorized(msg.sender));
274267

275-
// depth should be > 0 (actively wrapping a settle call) and no settle call should have been performed yet
276-
require(depth > 0 && settleCalls == 0, Unauthorized(address(0)));
277-
278-
settleCalls = settleCalls + 1;
279-
280268
// Use GPv2Wrapper's _internalSettle to call the settlement contract
281269
// wrapperData is empty since we've already processed it in _wrap
282270
_internalSettle(settleData, remainingWrapperData);

test/CowEvcOpenPositionWrapper.t.sol

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,6 @@ contract CowEvcOpenPositionWrapperTest is CowBaseTest {
224224
openPositionWrapper.wrappedSettle(settleData, wrapperData);
225225
}
226226

227-
/// @notice Test that depth tracking works correctly
228-
function test_OpenPositionWrapper_DepthTracking() external {
229-
vm.skip(bytes(FORK_RPC_URL).length == 0);
230-
231-
// Initial depth should be 0
232-
assertEq(openPositionWrapper.depth(), 0, "Initial depth should be 0");
233-
assertEq(openPositionWrapper.settleCalls(), 0, "Initial settleCalls should be 0");
234-
}
235-
236227
/// @notice Test parseWrapperData function
237228
function test_OpenPositionWrapper_ParseWrapperData() external view {
238229
CowEvcOpenPositionWrapper.OpenPositionParams memory params = CowEvcOpenPositionWrapper.OpenPositionParams({

0 commit comments

Comments
 (0)