Skip to content

Commit bdaad5e

Browse files
authored
fix: compatibility with Foundry >= v1.2.3 (#231)
1 parent cdf7e28 commit bdaad5e

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/chains/zetachain/initRegistry.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as ZRC20 from "@zetachain/protocol-contracts/abi/ZRC20.sol/ZRC20.json";
22
import { ethers } from "ethers";
33

44
import { NetworkID } from "../../constants";
5+
import { deployOpts } from "../../deployOpts";
56
import { logger } from "../../logger";
67
import { setRegistryInitComplete } from "../../types/registryState";
78
import { sleep } from "../../utils";
@@ -338,7 +339,8 @@ const approveAllZRC20GasTokens = async ({
338339
try {
339340
const approveTx = await gasZRC20Contract.approve(
340341
coreRegistry.target,
341-
MAX_UINT256
342+
MAX_UINT256,
343+
deployOpts
342344
);
343345
await approveTx.wait();
344346
} catch (err: any) {

src/tokens/uniswapV3.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ export const prepareUniswapV3 = async (deployer: Signer, wzeta: any) => {
2828
const uniswapV3FactoryInstance = await uniswapV3Factory.deploy(deployOpts);
2929
await uniswapV3FactoryInstance.waitForDeployment();
3030

31+
// Ensure common fee tiers are enabled explicitly
32+
await (uniswapV3FactoryInstance as any).enableFeeAmount(500, 10, deployOpts);
33+
await (uniswapV3FactoryInstance as any).enableFeeAmount(3000, 60, deployOpts);
34+
await (uniswapV3FactoryInstance as any).enableFeeAmount(
35+
10000,
36+
200,
37+
deployOpts
38+
);
39+
3140
const swapRouter = new ethers.ContractFactory(
3241
SwapRouter.abi,
3342
SwapRouter.bytecode,
@@ -189,7 +198,7 @@ export const createUniswapV3Pool = async (
189198
token1: string,
190199
fee = 3000 // Default fee tier 0.3%
191200
) => {
192-
await uniswapV3FactoryInstance.createPool(token0, token1, fee);
201+
await uniswapV3FactoryInstance.createPool(token0, token1, fee, deployOpts);
193202
const poolAddress = await uniswapV3FactoryInstance.getPool(
194203
token0,
195204
token1,
@@ -204,7 +213,7 @@ export const createUniswapV3Pool = async (
204213
// Initialize the pool with a sqrt price of 1 (equal amounts of both tokens)
205214
// sqrtPriceX96 = sqrt(1) * 2^96
206215
const sqrtPriceX96 = ethers.toBigInt("79228162514264337593543950336");
207-
await pool.initialize(sqrtPriceX96);
216+
await pool.initialize(sqrtPriceX96, deployOpts);
208217

209218
return pool;
210219
};
@@ -250,7 +259,7 @@ export const addLiquidityV3 = async (
250259
token1,
251260
};
252261

253-
const tx = await nonfungiblePositionManager.mint(params);
262+
const tx = await nonfungiblePositionManager.mint(params, deployOpts);
254263
const receipt = await tx.wait();
255264

256265
const iface = nonfungiblePositionManager.interface;

0 commit comments

Comments
 (0)