Replace the sample Uniswap V3 Factory ABI with any contract’s ABI in your Sim IDX app.
sim init
without any additional templates. The workflow mirrors the process you will follow in a real project: locate the ABI, register it with the CLI, extend your listener, and validate the new triggers against historical data.
abis/UniswapV3Factory.json
. Because you are replacing this ABI entirely, delete the file (or move it out of abis/
). Leaving it in place would cause the CLI to generate bindings for both Factory and USDC, which is not what you want for this walkthrough.
sim abi codegen
removes the now-missing Factory bindings from listeners/lib/sim-idx-generated/
.
abis/
and paste the JSON you copied earlier. The filename should match the contract you are tracking, e.g. abis/USDC.json
.
sim abi add
listeners/lib/sim-idx-generated/
.
listeners/lib/sim-idx-generated/
. The generated Solidity bindings expose multiple abstract contracts that fire whenever a specific USDC function is called or event is emitted onchain. You will extend one of these contracts in the next step.
listeners/src/USDCListener.sol
.
Next, create a new contract so that it inherits from the abstract contracts generated for your ABI. For example, to react to the Transfer
event of USDC the inheritance line might look like this:
Main.sol
file, you now need to import your new USDCListener
and update the Triggers
contract to use it.
In the Triggers
contract, replace the existing addTrigger
call so that it points to the USDC contract address on Ethereum and references the helper selector exposed by the listener:
addTrigger
calls with the appropriate chain name from the Chains
enum (for example, Chains.Base
) and contract address. You can find the list of supported chains at sim.dune.com/chains.
sim listeners evaluate
compiles your listener, fetches onchain transactions for the specified block range and prints a structured summary of events and errors.
events
and errors
is empty, the evaluation succeeded.
sim listeners evaluate
command and its options, visit the CLI reference page.sim build
places the generated Drizzle schema for your listener under apis/src/db/schema/Listener.ts
. The existing apis/src/index.ts
still imports poolCreated
(an event from the previous Uniswap V3 ABI included in the sample) which no longer exists.
Update apis/src/index.ts
so that it queries the new usdcTransfer
table generated from your USDCTransfer
event:
sim build
once again to verify the API is building correctly with the new Drizzle schema.