Skip to content

Commit bb3f522

Browse files
committed
feat: add factory address based decoding
1 parent 08928ee commit bb3f522

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

services/decoder/decoder.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,14 @@ export class GoldRushDecoder {
166166
for (const log of logs) {
167167
const {
168168
raw_log_topics: [topic0_hash],
169-
sender_address: contract_address,
169+
sender_address,
170+
sender_factory_address,
170171
} = log;
171172
const decoding_index =
172-
this.decoders[chain_name]?.[contract_address]?.[topic0_hash];
173+
this.decoders[chain_name]?.[sender_address]?.[topic0_hash] ??
174+
this.decoders[chain_name]?.[sender_factory_address]?.[
175+
topic0_hash
176+
];
173177
const fallback_index = this.fallbacks[topic0_hash];
174178
let logEvent: EventType | null = null;
175179
if (decoding_index !== undefined) {

services/decoder/protocols/uniswap-v2/uniswap-v2.configs.ts

-18
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
import { type Configs } from "../../decoder.types";
22

33
const configs: Configs = [
4-
{
5-
protocol_name: "uniswap-v2",
6-
address: "0xaf31fd9c3b0350424bf96e551d2d1264d8466205",
7-
is_factory: false,
8-
chain_name: "eth-mainnet",
9-
},
10-
{
11-
address: "0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc",
12-
is_factory: false,
13-
protocol_name: "uniswap-v2",
14-
chain_name: "eth-mainnet",
15-
},
16-
{
17-
address: "0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852",
18-
is_factory: false,
19-
protocol_name: "uniswap-v2",
20-
chain_name: "eth-mainnet",
21-
},
224
{
235
address: "0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f",
246
is_factory: true,

0 commit comments

Comments
 (0)