Registry
Explore community-led codemods to migrate, optimize, and transform your codebase.
Ready to contribute?
Build your own codemod and share it with the community.
Explore community-led codemods to migrate, optimize, and transform your codebase.
Build your own codemod and share it with the community.
EtherMod — automatically migrate wagmi v1 to v2. Handles hook renames, config changes, and import cleanup.
Build your own codemod and share it with the community.
1 import { WagmiConfig, createClient, useContractRead, useWaitForTransaction, usePrepareContractWrite } from "wagmi";
2 import { publicProvider } from "wagmi/providers/public";
3
4 const { chains, publicClient } = configureChains([mainnet], [publicProvider()]);
5 const client = createClient({ chains, publicClient });
6
7 export function App() {
8 const { data } = useContractRead({ address: "0x", abi, functionName: "get" });
9 const { write } = usePrepareContractWrite({ address: "0x", abi, functionName: "set" });
10 const { isSuccess } = useWaitForTransaction({ hash: txHash });
11
12 return <WagmiConfig config={client}><div /></WagmiConfig>;
13 }
14