Skip to content

Commit 7b0b720

Browse files
committed
config: set wagmi.config.ts to generate contract management ts
1 parent f52210f commit 7b0b720

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

wagmi.config.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { factoryABI, routerABI } from '@/config/abis';
2+
import * as MAINNET from '@/config/';
3+
import * as TESTNET from '@/config/contractsTestnet';
4+
import { defineConfig, loadEnv } from '@wagmi/cli';
5+
import { actions, react } from '@wagmi/cli/plugins';
6+
7+
//@ts-expect-error
8+
export default defineConfig(() => {
9+
let contracts = [];
10+
const env = loadEnv({
11+
envDir: process.cwd(),
12+
mode: process.env.NODE_ENV,
13+
});
14+
15+
contracts = [
16+
{
17+
abi: TESTNET.FACTORY_ABI,
18+
address: TESTNET.FACTORY_ADDRESS,
19+
name: 'PairFactory',
20+
},
21+
{
22+
abi: TESTNET.ROUTER_ABI,
23+
address: TESTNET.ROUTER_ADDRESS,
24+
name: 'Router',
25+
},
26+
{
27+
abi: TESTNET.ERC20_ABI,
28+
name: 'Erc20',
29+
},
30+
{
31+
abi: TESTNET.PAIR_ABI,
32+
name: 'Pair',
33+
},
34+
];
35+
return {
36+
out: 'src/lib/swamp.ts',
37+
contracts: contracts,
38+
plugins: [actions(), react()],
39+
};
40+
});

0 commit comments

Comments
 (0)