Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions contract_manager/src/core/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,7 @@ export class TonChain extends Chain {
wormholeChainName: string,
nativeToken: TokenId | undefined,
private rpcUrl: string,
private networkId: string,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 networkId field is added but never consumed by any TonChain logic

The new networkId field (contract_manager/src/core/chains.ts:1522) is stored and serialized/deserialized but is never referenced by any method in TonChain or in any TON contract code (contract_manager/src/core/contracts/ton.ts). By contrast, NearChain uses its networkId in getNearAccount() at contract_manager/src/core/chains.ts:1698 and contract_manager/src/core/chains.ts:1702. This isn't a bug — the commit message says "add missing networkId serialization" suggesting the field is needed for data completeness or future use — but it's worth confirming the intended consumer exists or is planned.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

) {
super(id, mainnet, wormholeChainName, nativeToken);
}
Expand Down Expand Up @@ -1583,6 +1584,7 @@ export class TonChain extends Chain {
return {
id: this.id,
mainnet: this.mainnet,
networkId: this.networkId,
rpcUrl: this.rpcUrl,
type: TonChain.type,
wormholeChainName: this.wormholeChainName,
Expand All @@ -1597,6 +1599,7 @@ export class TonChain extends Chain {
parsed.wormholeChainName ?? "",
parsed.nativeToken,
parsed.rpcUrl ?? "",
parsed.networkId ?? "",
);
}

Expand Down
2 changes: 2 additions & 0 deletions contract_manager/src/store/chains/TonChains.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
{
"id": "ton_testnet",
"mainnet": false,
"networkId": "0x2",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Verify correctness of TON networkId values (0x2 and 0x27)

The JSON config uses "0x2" (decimal 2) for testnet and "0x27" (decimal 39) for mainnet. These don't correspond to standard TON global IDs (mainnet = -239, testnet = -3), nor to the Wormhole chain IDs for TON (ton_mainnet = 60069, ton_testnet = 50104 per governance/xc_admin/packages/xc_admin_common/src/chains.ts:102,243). They also don't match the NearChain convention of using human-readable names like "testnet" and "mainnet". Since the field isn't consumed yet, incorrect values won't cause runtime failures today, but they should be verified before any logic depends on them.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

"rpcUrl": "https://testnet.toncenter.com/api/v2/jsonRPC#$ENV_TON_TESTNET_API_KEY",
"type": "TonChain",
"wormholeChainName": "ton_testnet"
},
{
"id": "ton_mainnet",
"mainnet": true,
"networkId": "0x27",
"rpcUrl": "https://toncenter.com/api/v2/jsonRPC#$ENV_TON_MAINNET_API_KEY",
"type": "TonChain",
"wormholeChainName": "ton_mainnet"
Expand Down