Skip to content

Commit

Permalink
make checkV4InitializeCall like the others
Browse files Browse the repository at this point in the history
  • Loading branch information
dianakocsis committed Oct 16, 2024
1 parent e5ad3bd commit 696d96d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 1 addition & 5 deletions contracts/base/Dispatcher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,7 @@ abstract contract Dispatcher is Payments, V2SwapRouter, V3SwapRouter, V4SwapRout
_checkV3PositionManagerCall(inputs, msgSender());
(success, output) = address(V3_POSITION_MANAGER).call(inputs);
} else if (command == Commands.V4_INITIALIZE_POOL) {
bytes4 selector;
assembly {
selector := calldataload(inputs.offset)
}
_checkV4Initialize(selector);
_checkV4InitializeCall(inputs);
(success, output) = address(V4_POSITION_MANAGER).call(inputs);
} else if (command == Commands.V4_POSITION_CALL) {
// should only call modifyLiquidities() to mint
Expand Down
6 changes: 5 additions & 1 deletion contracts/modules/V3ToV4Migrator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ abstract contract V3ToV4Migrator is MigratorImmutables {
}
}

function _checkV4Initialize(bytes4 selector) internal pure {
function _checkV4InitializeCall(bytes calldata inputs) internal pure {
bytes4 selector;
assembly {
selector := calldataload(inputs.offset)
}
if (selector != PoolInitializer.initializePool.selector) {
revert InvalidAction(selector);
}
Expand Down

0 comments on commit 696d96d

Please sign in to comment.