Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9599faa
Add ArbitraryActionsExecuted event tracking for HyperEVM
NikolasHaimerl Nov 17, 2025
3cf97d9
Remove createMapWithDefault utility and replace with plain object lit…
NikolasHaimerl Nov 17, 2025
fba49d2
Add tracking for FallbackHyperEVMFlowCompleted events
NikolasHaimerl Nov 17, 2025
99495e2
merged with remote
NikolasHaimerl Nov 17, 2025
9839edc
refactor: extract SimpleTransferFlowCompleted event handling to share…
NikolasHaimerl Nov 18, 2025
180f3f9
Merge branch 'nikolas/remove-default-mapping' into nikolas/track-Simp…
NikolasHaimerl Nov 18, 2025
64f3f75
add addresses for hyperEVM
NikolasHaimerl Nov 18, 2025
1b134df
remove redundant chain address mapping
NikolasHaimerl Nov 18, 2025
e8a0c7d
Merge branch 'stage' into nikolas/remove-default-mapping
NikolasHaimerl Nov 18, 2025
7c9582c
Merge remote-tracking branch 'origin/hyperliquid-withdrawal-status' i…
NikolasHaimerl Nov 18, 2025
e28de67
Merge branch 'nikolas/remove-default-mapping' into nikolas/track-Simp…
NikolasHaimerl Nov 18, 2025
db2174d
move isTestnet fn
NikolasHaimerl Nov 18, 2025
23b6a10
Merge branch 'nikolas/remove-default-mapping' into nikolas/track-Simp…
NikolasHaimerl Nov 18, 2025
6a9e504
move endpoint address
NikolasHaimerl Nov 18, 2025
cec1bb8
Merge branch 'nikolas/remove-default-mapping' into nikolas/track-Fall…
NikolasHaimerl Nov 18, 2025
321e944
Merge branch 'nikolas/track-FallbackHyperEVMFlowCompleted' into nikol…
NikolasHaimerl Nov 18, 2025
4f5d056
HEAD
NikolasHaimerl Nov 18, 2025
5eeff2c
HEAD
NikolasHaimerl Nov 18, 2025
1e8c740
refactor: extract generic event processing utilities and add Fallback…
NikolasHaimerl Nov 18, 2025
215520b
Merge branch 'nikolas/track-SimpleTransferCompleted-OFT' into nikolas…
NikolasHaimerl Nov 18, 2025
2b62a02
Refactor block hash collection and extract primary key columns in ind…
NikolasHaimerl Nov 19, 2025
d7b3ac5
Add ArbitraryActionsExecuted event tracking to OFT indexer
NikolasHaimerl Nov 19, 2025
baf49b4
Merge branch 'nikolas/remove-default-mapping' into nikolas/track-Fall…
NikolasHaimerl Nov 19, 2025
8ba3d4e
Refactor CCTP indexer to use unified sponsored periphery address for …
NikolasHaimerl Nov 19, 2025
70ccb56
Merge branch 'nikolas/remove-default-mapping' into nikolas/track-Fall…
NikolasHaimerl Nov 19, 2025
7488068
Merge branch 'nikolas/track-FallbackHyperEVMFlowCompleted' into nikol…
NikolasHaimerl Nov 19, 2025
819e786
Merge branch 'nikolas/track-SimpleTransferCompleted-OFT' into nikolas…
NikolasHaimerl Nov 19, 2025
2f1cfbb
Merge branch 'nikolas/track-FallbackHyperEVMFlowCompleted-Oft' into n…
NikolasHaimerl Nov 19, 2025
bed7ee0
update delete function
NikolasHaimerl Nov 19, 2025
2125cf0
update delete function
NikolasHaimerl Nov 19, 2025
836008d
update delete function
NikolasHaimerl Nov 19, 2025
91b6bf6
update delete function
NikolasHaimerl Nov 19, 2025
5deacb4
update delete function
NikolasHaimerl Nov 19, 2025
7de90a7
Merge branch 'nikolas/track-SimpleTransferCompleted-OFT' into nikolas…
NikolasHaimerl Nov 19, 2025
7972caa
update delete function
NikolasHaimerl Nov 19, 2025
e8c4d07
Merge branch 'nikolas/track-FallbackHyperEVMFlowCompleted-Oft' into n…
NikolasHaimerl Nov 19, 2025
bb10b62
update delete function
NikolasHaimerl Nov 19, 2025
8549de3
Add SponsoredAccountActivation event tracking to OFT and CCTP indexers
NikolasHaimerl Nov 19, 2025
4fafc58
Update migration timestamp for SponsoredAccountActivation
NikolasHaimerl Nov 19, 2025
44bc298
Merge branch 'stage' into nikolas/track-ArbitraryActionsExecuted-OFT
NikolasHaimerl Nov 24, 2025
0dcbda8
Merge branch 'nikolas/track-ArbitraryActionsExecuted-OFT' into nikola…
NikolasHaimerl Nov 24, 2025
a4d3971
remove unused function
NikolasHaimerl Nov 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
Index,
Unique,
CreateDateColumn,
DeleteDateColumn,
} from "typeorm";

@Entity({ schema: "evm" })
@Unique("UK_sponsoredAccountActivation_chain_block_tx_log", [
"chainId",
"blockNumber",
"transactionHash",
"logIndex",
])
@Index("IX_SponsoredAccountActivation_chainId", ["chainId"])
@Index("IX_SponsoredAccountActivation_quoteNonce", ["quoteNonce"])
@Index("IX_SponsoredAccountActivation_blockNumber", ["blockNumber"])
@Index("IX_SponsoredAccountActivation_blockTimestamp", ["blockTimestamp"])
@Index("IX_SponsoredAccountActivation_deletedAt", ["deletedAt"])
@Index("IX_SponsoredAccountActivation_finalised", ["finalised"])
@Index("IX_SponsoredAccountActivation_finalRecipient", ["finalRecipient"])
export class SponsoredAccountActivation {
@PrimaryGeneratedColumn()
id: number;

@Column({ type: "bigint" })
chainId: string;

@Column({ nullable: true })
quoteNonce: string;

@Column()
finalRecipient: string;

@Column()
fundingToken: string;

@Column({ type: "numeric" })
evmAmountSponsored: string;

@Column()
blockNumber: number;

@Column()
transactionHash: string;

@Column()
transactionIndex: number;

@Column()
logIndex: number;

@Column()
finalised: boolean;

@Column()
blockTimestamp: Date;

@CreateDateColumn()
createdAt: Date;

@DeleteDateColumn({ nullable: true })
deletedAt?: Date;
}
1 change: 1 addition & 0 deletions packages/indexer-database/src/entities/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ export * from "./evm/SponsoredOFTSend";
export * from "./evm/SimpleTransferFlowCompleted";
export * from "./evm/ArbitraryActionsExecuted";
export * from "./evm/FallbackHyperEVMFlowCompleted";
export * from "./evm/SponsoredAccountActivation";
1 change: 1 addition & 0 deletions packages/indexer-database/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const createDataSource = (config: DatabaseConfig): DataSource => {
entities.SimpleTransferFlowCompleted,
entities.ArbitraryActionsExecuted,
entities.FallbackHyperEVMFlowCompleted,
entities.SponsoredAccountActivation,
],
migrationsTableName: "_migrations",
migrations: ["migrations/*.ts"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { MigrationInterface, QueryRunner } from "typeorm";

export class SponsoredAccountActivation1763557964556
implements MigrationInterface
{
name = "SponsoredAccountActivation1763557964556";

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE "evm"."sponsored_account_activation" (
"id" SERIAL NOT NULL,
"chainId" bigint NOT NULL,
"quoteNonce" character varying,
"finalRecipient" character varying NOT NULL,
"fundingToken" character varying NOT NULL,
"evmAmountSponsored" numeric NOT NULL,
"blockNumber" integer NOT NULL,
"transactionHash" character varying NOT NULL,
"transactionIndex" integer NOT NULL,
"logIndex" integer NOT NULL,
"finalised" boolean NOT NULL DEFAULT false,
"blockTimestamp" TIMESTAMP NOT NULL,
"createdAt" TIMESTAMP NOT NULL DEFAULT now(),
"deletedAt" TIMESTAMP,
CONSTRAINT "UK_sponsoredAccountActivation_chain_block_tx_log" UNIQUE ("chainId", "blockNumber", "transactionHash", "logIndex"),
CONSTRAINT "PK_sponsoredAccountActivation_id" PRIMARY KEY ("id")
)`,
);
await queryRunner.query(
`CREATE INDEX "IX_SponsoredAccountActivation_chainId" ON "evm"."sponsored_account_activation" ("chainId") `,
);
await queryRunner.query(
`CREATE INDEX "IX_SponsoredAccountActivation_quoteNonce" ON "evm"."sponsored_account_activation" ("quoteNonce") `,
);
await queryRunner.query(
`CREATE INDEX "IX_SponsoredAccountActivation_finalRecipient" ON "evm"."sponsored_account_activation" ("finalRecipient") `,
);
await queryRunner.query(
`CREATE INDEX "IX_SponsoredAccountActivation_blockNumber" ON "evm"."sponsored_account_activation" ("blockNumber") `,
);
await queryRunner.query(
`CREATE INDEX "IX_SponsoredAccountActivation_finalised" ON "evm"."sponsored_account_activation" ("finalised") `,
);
await queryRunner.query(
`CREATE INDEX "IX_SponsoredAccountActivation_blockTimestamp" ON "evm"."sponsored_account_activation" ("blockTimestamp") `,
);
await queryRunner.query(
`CREATE INDEX "IX_SponsoredAccountActivation_deletedAt" ON "evm"."sponsored_account_activation" ("deletedAt") `,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`DROP INDEX "evm"."IX_SponsoredAccountActivation_deletedAt"`,
);
await queryRunner.query(
`DROP INDEX "evm"."IX_SponsoredAccountActivation_blockTimestamp"`,
);
await queryRunner.query(
`DROP INDEX "evm"."IX_SponsoredAccountActivation_finalised"`,
);
await queryRunner.query(
`DROP INDEX "evm"."IX_SponsoredAccountActivation_blockNumber"`,
);
await queryRunner.query(
`DROP INDEX "evm"."IX_SponsoredAccountActivation_finalRecipient"`,
);
await queryRunner.query(
`DROP INDEX "evm"."IX_SponsoredAccountActivation_quoteNonce"`,
);
await queryRunner.query(
`DROP INDEX "evm"."IX_SponsoredAccountActivation_chainId"`,
);
await queryRunner.query(`DROP TABLE "evm"."sponsored_account_activation"`);
}
}
13 changes: 13 additions & 0 deletions packages/indexer/src/data-indexing/model/hyperEvmExecutor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
import { BigNumber, providers } from "ethers";

export const SPONSORED_ACCOUNT_ACTIVATION_ABI = [
"event SponsoredAccountActivation(bytes32 indexed quoteNonce, address indexed finalRecipient, address indexed fundingToken, uint256 evmAmountSponsored)",
];

export interface SponsoredAccountActivationLog extends providers.Log {
args: {
quoteNonce: string;
finalRecipient: string;
fundingToken: string;
evmAmountSponsored: BigNumber;
};
}

export interface SimpleTransferFlowCompletedLog extends providers.Log {
args: {
quoteNonce: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
SimpleTransferFlowCompletedLog,
ArbitraryActionsExecutedLog,
FallbackHyperEVMFlowCompletedLog,
SponsoredAccountActivationLog,
SPONSORED_ACCOUNT_ACTIVATION_ABI,
} from "../model";
import { IndexerDataHandler } from "./IndexerDataHandler";
import { EventDecoder } from "../../web3/EventDecoder";
Expand Down Expand Up @@ -42,6 +44,7 @@ import { entities, SaveQueryResult } from "@repo/indexer-database";
import {
formatFallbackHyperEVMFlowCompletedEvent,
formatSimpleTransferFlowCompletedEvent,
formatSponsoredAccountActivationEvent,
} from "./hyperEvmExecutor";
import {
formatAndSaveEvents,
Expand All @@ -63,6 +66,7 @@ export type FetchEventsResult = {
simpleTransferFlowCompletedEvents: SimpleTransferFlowCompletedLog[];
arbitraryActionsExecutedEvents: ArbitraryActionsExecutedLog[];
fallbackHyperEVMFlowCompletedEvents: FallbackHyperEVMFlowCompletedLog[];
sponsoredAccountActivationEvents: SponsoredAccountActivationLog[];
blocks: Record<string, providers.Block>;
transactionReceipts: Record<string, providers.TransactionReceipt>;
transactions: Record<string, Transaction>;
Expand All @@ -80,6 +84,7 @@ export type StoreEventsResult = {
savedSimpleTransferFlowCompletedEvents: SaveQueryResult<entities.SimpleTransferFlowCompleted>[];
savedArbitraryActionsExecutedEvents: SaveQueryResult<entities.ArbitraryActionsExecuted>[];
savedFallbackHyperEVMFlowCompletedEvents: SaveQueryResult<entities.FallbackHyperEVMFlowCompleted>[];
savedSponsoredAccountActivationEvents: SaveQueryResult<entities.SponsoredAccountActivation>[];
};

// Taken from https://developers.circle.com/cctp/evm-smart-contracts
Expand Down Expand Up @@ -295,6 +300,7 @@ export class CCTPIndexerDataHandler implements IndexerDataHandler {
let arbitraryActionsExecutedEvents: ArbitraryActionsExecutedLog[] = [];
let fallbackHyperEVMFlowCompletedEvents: FallbackHyperEVMFlowCompletedLog[] =
[];
let sponsoredAccountActivationEvents: SponsoredAccountActivationLog[] = [];
if (sponsoredCCTPDstPeripheryAddress) {
simpleTransferFlowCompletedEvents = getEventsFromTransactionReceipts(
filteredMessageReceivedTxReceipts,
Expand All @@ -313,6 +319,17 @@ export class CCTPIndexerDataHandler implements IndexerDataHandler {
sponsoredCCTPDstPeripheryAddress,
EventDecoder.decodeFallbackHyperEVMFlowCompletedEvents,
);
const sponsoredCCTPDstPeripheryContract = new ethers.Contract(
sponsoredCCTPDstPeripheryAddress,
SPONSORED_ACCOUNT_ACTIVATION_ABI,
this.provider,
);
sponsoredAccountActivationEvents =
(await sponsoredCCTPDstPeripheryContract.queryFilter(
"SponsoredAccountActivation",
blockRange.from,
blockRange.to,
)) as unknown as SponsoredAccountActivationLog[];
}

this.runChecks(burnEvents, mintEvents);
Expand All @@ -337,6 +354,7 @@ export class CCTPIndexerDataHandler implements IndexerDataHandler {
simpleTransferFlowCompletedEvents,
arbitraryActionsExecutedEvents,
fallbackHyperEVMFlowCompletedEvents,
sponsoredAccountActivationEvents,
blocks,
transactionReceipts,
transactions: depositForBurnTransactions,
Expand Down Expand Up @@ -531,6 +549,7 @@ export class CCTPIndexerDataHandler implements IndexerDataHandler {
simpleTransferFlowCompletedEvents,
arbitraryActionsExecutedEvents,
fallbackHyperEVMFlowCompletedEvents,
sponsoredAccountActivationEvents,
blocks,
} = events;
const blocksTimestamps = this.getBlocksTimestamps(blocks);
Expand Down Expand Up @@ -560,6 +579,7 @@ export class CCTPIndexerDataHandler implements IndexerDataHandler {
savedSimpleTransferFlowCompletedEvents,
savedArbitraryActionsExecutedEvents,
savedFallbackHyperEVMFlowCompletedEvents,
savedSponsoredAccountActivationEvents,
] = await Promise.all([
this.cctpRepository.formatAndSaveBurnEvents(
chainAgnosticBurnEvents,
Expand Down Expand Up @@ -605,6 +625,16 @@ export class CCTPIndexerDataHandler implements IndexerDataHandler {
entities.FallbackHyperEVMFlowCompleted,
primaryKeyColumns as (keyof entities.FallbackHyperEVMFlowCompleted)[],
),
formatAndSaveEvents(
this.cctpRepository,
sponsoredAccountActivationEvents,
lastFinalisedBlock,
this.chainId,
blocksTimestamps,
formatSponsoredAccountActivationEvent,
entities.SponsoredAccountActivation,
primaryKeyColumns as (keyof entities.SponsoredAccountActivation)[],
),
]);

return {
Expand All @@ -614,6 +644,7 @@ export class CCTPIndexerDataHandler implements IndexerDataHandler {
savedSimpleTransferFlowCompletedEvents,
savedArbitraryActionsExecutedEvents,
savedFallbackHyperEVMFlowCompletedEvents,
savedSponsoredAccountActivationEvents,
};
}

Expand Down
Loading