Skip to content

Commit 376be52

Browse files
authored
fix(infra): support parsing setMaxFeePpm in safe tx reader (#8531)
1 parent 71f0ca4 commit 376be52

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

typescript/infra/src/tx/govern-transaction-reader.ts

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
IXERC20__factory,
2020
MovableCollateralRouter__factory,
2121
Ownable__factory,
22+
TokenBridgeCctpV2__factory,
2223
ProxyAdmin__factory,
2324
RoutingFee__factory,
2425
TimelockController__factory,
@@ -1093,11 +1094,20 @@ export class GovernTransactionReader {
10931094
const { symbol } = await this.multiProvider.getNativeToken(chain);
10941095
const tokenRouterInterface =
10951096
MovableCollateralRouter__factory.createInterface();
1097+
const cctpV2Interface = TokenBridgeCctpV2__factory.createInterface();
10961098

1097-
const decoded = tokenRouterInterface.parseTransaction({
1098-
data: tx.data,
1099-
value: tx.value,
1100-
});
1099+
let decoded;
1100+
try {
1101+
decoded = tokenRouterInterface.parseTransaction({
1102+
data: tx.data,
1103+
value: tx.value,
1104+
});
1105+
} catch {
1106+
decoded = cctpV2Interface.parseTransaction({
1107+
data: tx.data,
1108+
value: tx.value,
1109+
});
1110+
}
11011111

11021112
let insight: string | undefined;
11031113
let feeDetails: Record<string, any> | undefined;
@@ -1253,6 +1263,15 @@ export class GovernTransactionReader {
12531263
insight = `Enroll remote router for domain ${domain}${chainName ? ` (${chainName})` : ''} to ${router}`;
12541264
}
12551265

1266+
if (
1267+
decoded.functionFragment.name ===
1268+
cctpV2Interface.functions['setMaxFeePpm(uint256)'].name
1269+
) {
1270+
const [maxFeePpm] = decoded.args;
1271+
const bps = BigNumber.from(maxFeePpm).toNumber() / 100;
1272+
insight = `Set max fee to ${maxFeePpm} ppm (${bps} bps)`;
1273+
}
1274+
12561275
let ownableTx = {};
12571276
if (!insight) {
12581277
ownableTx = await this.readOwnableTransaction(chain, tx);

0 commit comments

Comments
 (0)