Skip to content

Commit 88c31d2

Browse files
authored
[indexer]: align indexer with updated intents v2 events (#826)
1 parent 898e9e9 commit 88c31d2

22 files changed

Lines changed: 770 additions & 259 deletions

sdk/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ env-config.json
9292
chain-ids-by-genesis.ts
9393
chains-by-ismp-host.ts
9494
token-gateway-addresses.ts
95-
intent-gateway-v2-addresses.ts
95+
intent-gateway-v3-addresses.ts
9696
testnet-state-machine-ids.ts
9797
l2-state-machine.helper.ts
9898

sdk/packages/indexer/scripts/generate-chain-yamls.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -267,19 +267,19 @@ const generateChainsTokenGatewayAddresses = () => {
267267
console.log("Generated token-gateway-addresses.ts")
268268
}
269269

270-
const generateChainsIntentGatewayV2Addresses = () => {
271-
const intentGatewayV2 = {}
270+
const generateChainsIntentGatewayV3Addresses = () => {
271+
const intentGatewayV3 = {}
272272

273273
validChains.forEach((config) => {
274-
if (config.type === "evm" && config.contracts?.intentGatewayV2) {
275-
intentGatewayV2[config.stateMachineId] = config.contracts.intentGatewayV2
274+
if (config.type === "evm" && config.contracts?.intentGatewayV3) {
275+
intentGatewayV3[config.stateMachineId] = config.contracts.intentGatewayV3
276276
}
277277
})
278278

279-
const value = `// Auto-generated, DO NOT EDIT \nexport const INTENT_GATEWAY_V2_ADDRESSES = ${JSON.stringify(intentGatewayV2, null, 2)}`
279+
const value = `// Auto-generated, DO NOT EDIT \nexport const INTENT_GATEWAY_V3_ADDRESSES = ${JSON.stringify(intentGatewayV3, null, 2)}`
280280

281-
fs.writeFileSync(root + "/src/intent-gateway-v2-addresses.ts", value)
282-
console.log("Generated intent-gateway-v2-addresses.ts")
281+
fs.writeFileSync(root + "/src/intent-gateway-v3-addresses.ts", value)
282+
console.log("Generated intent-gateway-v3-addresses.ts")
283283
}
284284

285285
const generateTestnetStateMachineIds = () => {
@@ -341,7 +341,7 @@ try {
341341
generateMultichainYaml()
342342
generateChainIdsByGenesis()
343343
generateChainsByIsmpHost()
344-
generateChainsIntentGatewayV2Addresses()
344+
generateChainsIntentGatewayV3Addresses()
345345
generateChainsTokenGatewayAddresses()
346346
generateTestnetStateMachineIds()
347347
generateEnvironmentConfig()

sdk/packages/indexer/scripts/templates/evm-chain.yaml.hbs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,50 +31,50 @@ dataSources:
3131
filter:
3232
topics:
3333
- 'Transfer(address indexed from, address indexed to, uint256 amount)'
34-
{{#if config.contracts.intentGatewayV2}}
34+
{{#if config.contracts.intentGatewayV3}}
3535
- kind: ethereum/Runtime
3636
startBlock: {{blockNumber}}
3737
options:
38-
abi: intentGatewayV2
39-
address: '{{config.contracts.intentGatewayV2}}'
38+
abi: intentGatewayV3
39+
address: '{{config.contracts.intentGatewayV3}}'
4040
assets:
41-
intentGatewayV2:
42-
file: ./abis/IntentGatewayV2.abi.json
41+
intentGatewayV3:
42+
file: ./abis/IntentGatewayV3.abi.json
4343
mapping:
4444
file: ./dist/index.js
4545
handlers:
4646
- kind: ethereum/LogHandler
47-
handler: handleOrderPlacedEventV2
47+
handler: handleOrderPlacedEventV3
4848
filter:
4949
topics:
5050
- 'OrderPlaced(bytes32,bytes,bytes,uint256,uint256,uint256,address,bytes32,(bytes32,uint256)[],(bytes32,uint256)[],(bytes32,uint256)[])'
5151
- kind: ethereum/LogHandler
52-
handler: handleOrderFilledEventV2
52+
handler: handleOrderFilledEventV3
5353
filter:
5454
topics:
5555
- 'OrderFilled(bytes32,address,(bytes32,uint256)[],(bytes32,uint256)[])'
5656
- kind: ethereum/LogHandler
57-
handler: handlePartialFilledEventV2
57+
handler: handlePartialFilledEventV3
5858
filter:
5959
topics:
6060
- 'PartialFill(bytes32,address,(bytes32,uint256)[],(bytes32,uint256)[])'
6161
- kind: ethereum/LogHandler
62-
handler: handleEscrowReleasedEventV2
62+
handler: handleEscrowReleasedEventV3
6363
filter:
6464
topics:
6565
- 'EscrowReleased(bytes32,(bytes32,uint256)[])'
6666
- kind: ethereum/LogHandler
67-
handler: handleEscrowRefundedEventV2
67+
handler: handleEscrowRefundedEventV3
6868
filter:
6969
topics:
7070
- 'EscrowRefunded(bytes32,(bytes32,uint256)[])'
7171
- kind: ethereum/LogHandler
72-
handler: handleDustCollectedEventV2
72+
handler: handleDustCollectedEventV3
7373
filter:
7474
topics:
7575
- 'DustCollected(address,uint256)'
7676
- kind: ethereum/LogHandler
77-
handler: handleDustSweptEventV2
77+
handler: handleDustSweptEventV3
7878
filter:
7979
topics:
8080
- 'DustSwept(address,uint256,address)'

sdk/packages/indexer/src/configs/abis/IntentGatewayV2.abi.json renamed to sdk/packages/indexer/src/configs/abis/IntentGatewayV3.abi.json

File renamed without changes.

sdk/packages/indexer/src/configs/config-local.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"ethereumHost": "0x8Aa0Dea6D675d785A882967Bf38183f6117C09b7",
1616
"handlerV1": "0xb45A4078A2D0B036C324A0046C2845aD59e769F6",
1717
"erc6160ext20": "0xA801da100bF16D07F668F4A49E1f71fc54D05177",
18-
"intentGatewayV2": "0xFbF50B2b32768127603cC9eF4b871574b881b8eD",
18+
"intentGatewayV3": "0xFbF50B2b32768127603cC9eF4b871574b881b8eD",
1919
"tokenGateway": "0xFcDa26cA021d5535C3059547390E6cCd8De7acA6"
2020
}
2121
},
@@ -28,7 +28,7 @@
2828
"ethereumHost": "0x58A41B89F4871725E5D898d98eF4BF917601c5eB",
2929
"handlerV1": "0x01b40De26Ba4C63c17A6f4Ed2cF96927C280B029",
3030
"erc6160ext20": "0xA801da100bF16D07F668F4A49E1f71fc54D05177",
31-
"intentGatewayV2": "0x0000000000000000000000000000000000000000",
31+
"intentGatewayV3": "0x0000000000000000000000000000000000000000",
3232
"tokenGateway": "0xFcDa26cA021d5535C3059547390E6cCd8De7acA6"
3333
}
3434
},

sdk/packages/indexer/src/configs/config-mainnet.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"ethereumHost": "0x792A6236AF69787C40cF76b69B4c8c7B28c4cA20",
4646
"erc6160ext20": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
4747
"handlerV1": "0x089248E869AEcd66199b64637207D366D6Cfe92D",
48-
"intentGatewayV2": "0x09a74AA91eb532C21862d4C6222753e4fC7e22dB",
48+
"intentGatewayV3": "0x09a74AA91eb532C21862d4C6222753e4fC7e22dB",
4949
"tokenGateway": "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE"
5050
}
5151
},
@@ -58,7 +58,7 @@
5858
"ethereumHost": "0xE05AFD4Eb2ce6d65c40e1048381BD0Ef8b4B299e",
5959
"erc6160ext20": "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",
6060
"handlerV1": "0x089248E869AEcd66199b64637207D366D6Cfe92D",
61-
"intentGatewayV2": "0x09a74AA91eb532C21862d4C6222753e4fC7e22dB",
61+
"intentGatewayV3": "0x09a74AA91eb532C21862d4C6222753e4fC7e22dB",
6262
"tokenGateway": "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE"
6363
}
6464
},
@@ -71,7 +71,7 @@
7171
"ethereumHost": "0x78c8A5F27C06757EA0e30bEa682f1FD5C8d7645d",
7272
"erc6160ext20": "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",
7373
"handlerV1": "0x089248E869AEcd66199b64637207D366D6Cfe92D",
74-
"intentGatewayV2": "0x09a74AA91eb532C21862d4C6222753e4fC7e22dB",
74+
"intentGatewayV3": "0x09a74AA91eb532C21862d4C6222753e4fC7e22dB",
7575
"tokenGateway": "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE"
7676
}
7777
},
@@ -84,7 +84,7 @@
8484
"ethereumHost": "0x6FFe92e4d7a9D589549644544780e6725E84b248",
8585
"erc6160ext20": "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",
8686
"handlerV1": "0x089248E869AEcd66199b64637207D366D6Cfe92D",
87-
"intentGatewayV2": "0x09a74AA91eb532C21862d4C6222753e4fC7e22dB",
87+
"intentGatewayV3": "0x09a74AA91eb532C21862d4C6222753e4fC7e22dB",
8888
"tokenGateway": "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE"
8989
}
9090
},
@@ -98,7 +98,7 @@
9898
"ethereumHost": "0x24B5d421Ec373FcA57325dd2F0C074009Af021F7",
9999
"erc6160ext20": "0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3",
100100
"handlerV1": "0x089248E869AEcd66199b64637207D366D6Cfe92D",
101-
"intentGatewayV2": "0x09a74AA91eb532C21862d4C6222753e4fC7e22dB",
101+
"intentGatewayV3": "0x09a74AA91eb532C21862d4C6222753e4fC7e22dB",
102102
"tokenGateway": "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE"
103103
}
104104
},
@@ -112,7 +112,7 @@
112112
"ethereumHost": "0x50c236247447B9d4Ee0561054ee596fbDa7791b1",
113113
"erc6160ext20": "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",
114114
"handlerV1": "0x089248E869AEcd66199b64637207D366D6Cfe92D",
115-
"intentGatewayV2": "0x09a74AA91eb532C21862d4C6222753e4fC7e22dB",
115+
"intentGatewayV3": "0x09a74AA91eb532C21862d4C6222753e4fC7e22dB",
116116
"tokenGateway": "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE"
117117
}
118118
},
@@ -138,7 +138,7 @@
138138
"ethereumHost": "0xD8d3db17C1dF65b301D45C84405CcAC1395C559a",
139139
"erc6160ext20": "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063",
140140
"handlerV1": "0x61f56ee7D15F4a11ba7ee9f233c136563cB5ad37",
141-
"intentGatewayV2": "0x09a74AA91eb532C21862d4C6222753e4fC7e22dB",
141+
"intentGatewayV3": "0x09a74AA91eb532C21862d4C6222753e4fC7e22dB",
142142
"tokenGateway": "0x8b536105b6Fae2aE9199f5146D3C57Dfe53b614E"
143143
}
144144
},
@@ -152,7 +152,7 @@
152152
"erc6160ext20": "0x078d782b760474a361dda0af3839290b0ef57ad6",
153153
"handlerV1": "0x85F82D70ceED45ca0D1b154C297946BabCf4d344",
154154
"tokenGateway": "0x8b536105b6Fae2aE9199f5146D3C57Dfe53b614E",
155-
"intentGatewayV2": "0x09a74AA91eb532C21862d4C6222753e4fC7e22dB"
155+
"intentGatewayV3": "0x09a74AA91eb532C21862d4C6222753e4fC7e22dB"
156156
}
157157
}
158158
}

sdk/packages/indexer/src/configs/config-testnet.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"handlerV1": "0xb45A4078A2D0B036C324A0046C2845aD59e769F6",
9090
"erc6160ext20": "0xA801da100bF16D07F668F4A49E1f71fc54D05177",
9191
"tokenGateway": "0xFcDa26cA021d5535C3059547390E6cCd8De7acA6",
92-
"intentGatewayV2": "0xFbF50B2b32768127603cC9eF4b871574b881b8eD"
92+
"intentGatewayV3": "0xFbF50B2b32768127603cC9eF4b871574b881b8eD"
9393
}
9494
},
9595
"gnosis-chiado": {
@@ -141,7 +141,7 @@
141141
"handlerV1": "0xda9aa832cf1024862a23f9fdd47cc2358b7d549c",
142142
"erc6160ext20": "0xECa9bC828A3005B9a3b909f2cc5c2a54794DE05F",
143143
"tokenGateway": "0x1c1e5be83df4a54c7a2230c337e4a3e8b7354b1c",
144-
"intentGatewayV2": "0xbB6BFF5Cf62cf5a091C29D88FAe88b3010F100D1"
144+
"intentGatewayV3": "0xbB6BFF5Cf62cf5a091C29D88FAe88b3010F100D1"
145145
}
146146
},
147147
"pharos-atlantic": {
@@ -154,7 +154,7 @@
154154
"handlerV1": "0x8B37747BBF8c8485026B9Dc2f8Fb177096EF574f",
155155
"erc6160ext20": "0xeaB7572c5506978C9A4Ff0A0BA5A1291e327B0B8",
156156
"tokenGateway": "0x451bDd8273839AD0Ec7F4Fa798E8B3DABb223fD8",
157-
"intentGatewayV2": "0xb8039832c6c9266F928d038eA49A8a169300C670"
157+
"intentGatewayV3": "0xb8039832c6c9266F928d038eA49A8a169300C670"
158158
}
159159
}
160160
}

sdk/packages/indexer/src/configs/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const evmContractsSchema = z.object({
99
ethereumHost: z.string().min(3, "Invalid Ethereum address"),
1010
handlerV1: z.string().min(3, "Invalid Ethereum address"),
1111
erc6160ext20: z.string().min(3, "Invalid Ethereum address"),
12-
intentGatewayV2: z.string().optional(),
12+
intentGatewayV3: z.string().optional(),
1313
tokenGateway: z.string().optional(),
1414
})
1515

0 commit comments

Comments
 (0)