- Node.js (wrote using v20)
- Docker
- Copy
dev.env
to.env
and fill in the empty values - Run
npm ci
to install dependencies
# Build the code, spin-up docker-compose, and start processing
npm run process
Notifications are triggered through processors
located at: src/processors
- View existing processors in src/processors
- Follow the patterns shown within to create a processor of your own.
- If you need more raw control of things you can copy from this example
If the ABI you require does not exist:
- Add ABI JSON to
abi/
- Run
npm run generate-abis
- The ABI will be created within
src/abi/
- The ABI will be created within
# Start processing at a specific block
BLOCK_FROM=12345678 npm run process
# Start processors matching a certain name
PROCESSOR=Burn npm run process
Filter OGN transfers coming from an address:
const filter = logFilter({
address: [OGN_ADDRESS],
topic0: [erc20.events.Transfer.topic],
topic1: ['0x58890A9cB27586E83Cb51d2d26bbE18a1a647245'],
})
Filter OGN transfers going to multiple addresses:
const filter = logFilter({
address: [OGN_ADDRESS],
topic0: [erc20.events.Transfer.topic],
topic2: [
'0x58890A9cB27586E83Cb51d2d26bbE18a1a647245',
'0x0DD34c397384DE8f21F463096A360a0419D476E1'
],
})
Filter OGN and OGV transfers and approvals going to multiple addresses:
const filter = logFilter({
address: [
OGN_ADDRESS,
OGV_ADDRESS
],
topic0: [
erc20.events.Approval.topic,
erc20.events.Transfer.topic,
],
topic2: [
'0x58890A9cB27586E83Cb51d2d26bbE18a1a647245',
'0x0DD34c397384DE8f21F463096A360a0419D476E1'
],
})