|
1 | 1 | import { task } from "hardhat/config";
|
2 | 2 | import { chainIdToConfig } from "../../chains";
|
3 | 3 | import { Address, encodeFunctionData } from "viem";
|
4 |
| -import { addTransaction, writeTransactionsToFile } from "../../chainDeploy/helpers/logging"; |
| 4 | +import { addTransaction } from "../../chainDeploy/helpers/logging"; |
5 | 5 |
|
6 | 6 | export default task("levered-positions:configure-pairs").setAction(
|
7 | 7 | async ({}, { viem, getChainId, deployments, getNamedAccounts }) => {
|
8 | 8 | const { deployer } = await getNamedAccounts();
|
9 | 9 | console.log("deployer: ", deployer);
|
10 | 10 | const publicClient = await viem.getPublicClient();
|
11 |
| - const walletClient = await viem.getWalletClient(deployer as Address); |
12 | 11 | const chainId = parseInt(await getChainId());
|
13 | 12 | const leveredPairsConfig = chainIdToConfig[chainId].leveragePairs;
|
14 | 13 |
|
@@ -66,15 +65,13 @@ export default task("levered-positions:configure-pairs").setAction(
|
66 | 65 | });
|
67 | 66 | } else {
|
68 | 67 | const tx = await factory.write._setPairWhitelisted([collateral, borrow, true]);
|
69 |
| - await publicClient.waitForTransactionReceipt({ hash: tx }); |
| 68 | + await publicClient.waitForTransactionReceipt({ hash: tx, confirmations: 2 }); |
70 | 69 | console.log(
|
71 |
| - `configured the markets pair:\n - BORROW (market: ${borrow}, underlying: ${borrowToken})\n - COLLATERAL: (market: ${collateral}, underlying: ${collateralToken}) as whitelisted for levered positions` |
| 70 | + `configured the markets pair:\n - BORROW (market: ${borrow}, underlying: ${borrowToken})\n - COLLATERAL: (market: ${collateral}, underlying: ${collateralToken}) as whitelisted for levered positions: ${tx}` |
72 | 71 | );
|
73 | 72 | }
|
74 | 73 | }
|
75 | 74 | }
|
76 | 75 | }
|
77 |
| - |
78 |
| - await writeTransactionsToFile(); |
79 | 76 | }
|
80 | 77 | );
|
0 commit comments