Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(universal-router-sdk): update universal router plus nits #231

Merged
merged 5 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sdks/universal-router-sdk/test/forge/utils/DeployRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import {IWETH9} from "@uniswap/v4-periphery/src/interfaces/external/IWETH9.sol";
contract DeployRouter is Test {
using PoolIdLibrary for PoolKey;

// These mainnet addresses are hardcoded to match the calldata generated by Hardhat
// This ensures the correct addresses send and receive values as expected
address public constant V2_FACTORY = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;
address public constant V3_FACTORY = 0x1F98431c8aD98523631AE4a59f267346ea31F984;
bytes32 public constant PAIR_INIT_CODE_HASH = 0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f;
Expand All @@ -36,6 +38,8 @@ contract DeployRouter is Test {
address internal constant MAINNET_PERMIT2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;
address internal constant MAINNET_ROUTER = 0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD;

// This is not the address of the position manager on mainnet
// It’s the address where Foundry deploys PositionManager during the test
// if this changes you need to update FORGE_V4_POSITION_MANAGER in addresses.ts
address internal constant FORGE_POSM_ADDRESS = 0x2e234DAe75C793f67A35089C9d99245E1C58470b;

Expand Down Expand Up @@ -85,6 +89,7 @@ contract DeployRouter is Test {
v4PositionManager = new PositionManager(
poolManager, IPermit2(MAINNET_PERMIT2), 100000, IPositionDescriptor(address(0)), IWETH9(WETH9)
);
vm.etch(FORGE_POSM_ADDRESS, address(v4PositionManager).code);
}

function initializeV4Pools() public {
Expand Down
Loading