Generate
You can generate precompiled, optimized type safe functions and events for any deployed contract using the thirdweb CLI.
This will generate a new thirdweb
directory in your own project, containing the precompiled functions for the contract at the given address.
Example: Generating an extension for a USDC contract on Optimism
This will generate the following file thirdweb/10/0x0b2c639c533813f4aa9d7837caf62653d097ff85.ts
in your project, containing:
- Precompiled, type-safe event definitions
- Precompiled, type-safe function definitions
You can inspect the generated code, modify it, and use it in your project.