Conversation
🦋 Changeset detectedLatest commit: e720946 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This reverts commit 2e8caa7.
|
🧚 Live preview: galacticcouncil/hydration-ui#3599 |
|
🧚 Live preview: galacticcouncil/hydration-ui#3603 |
There was a problem hiding this comment.
Pull request overview
Adds initial InstaBridge support to the xc stack, wiring a new EVM contract ABI + contract builder and exposing a Base→Hydration EURC route tagged as InstaBridge.
Changes:
- Add InstaBridge ABI to
@galacticcouncil/xc-coreand expose it via the central ABI registry. - Extend EVM chain configuration to optionally include an InstaBridge contract address and add the Base mainnet address.
- Add an
InstaBridgecontract builder and a Base→Hydration EURC route template/config tagged withTag.InstaBridge.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/xc-core/src/evm/abi/index.ts | Registers the new InstaBridge ABI in the core ABI map. |
| packages/xc-core/src/evm/abi/InstaBridge.ts | Adds the InstaBridge contract ABI definition. |
| packages/xc-core/src/chain/EvmChain.ts | Adds optional instaBridge config and accessor on EvmChain. |
| packages/xc-cfg/src/tags.ts | Introduces Tag.InstaBridge for route tagging. |
| packages/xc-cfg/src/configs/evm/base/templates.ts | Adds a Base→Hydration InstaBridge route template. |
| packages/xc-cfg/src/configs/evm/base/index.ts | Adds the new InstaBridge route to the Base route list. |
| packages/xc-cfg/src/chains/evm/base.ts | Configures the InstaBridge contract address for Base. |
| packages/xc-cfg/src/builders/contracts/InstaBridge.ts | Implements the InstaBridge contract call builder. |
| packages/xc-cfg/src/builders/ContractBuilder.ts | Exposes InstaBridge() from the top-level ContractBuilder. |
| .github/workflows/snapshot.yml | Adjusts snapshot workflow (removes npm cache config). |
| .changeset/olive-worms-cut.md | Adds a changeset bumping xc-core/xc-cfg (minor) and xc-sdk (patch). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| amount, | ||
| rcvWh.getWormholeId(), | ||
| toHydrationPrecompile(destAssetId as number), | ||
| toBytes32(H160.fromAccount(address) as `0x${string}`), |
| type BridgeViaWormholeOpts = { | ||
| destChain: EvmParachain; | ||
| destAsset: Asset; | ||
| }; |
| const bridgeViaWormhole = (opts: BridgeViaWormholeOpts): ContractConfigBuilder => ({ | ||
| build: async (params) => { | ||
| const { address, amount, asset, source, destination } = params; | ||
| const ctx = source.chain as EvmChain; | ||
| const rcv = destination.chain as EvmParachain; | ||
|
|
||
| const rcvWh = Wh.fromChain(opts.destChain); | ||
|
|
||
| const assetId = ctx.getAssetId(asset); | ||
| const destAssetId = rcv.getAssetId(opts.destAsset); | ||
|
|
||
| const instaBridgeAddress = ctx.getInstaBridge(); | ||
| if (!instaBridgeAddress) { | ||
| throw new Error(`InstaBridge not configured for ${ctx.name}`); | ||
| } | ||
|
|
||
| return new ContractConfig({ | ||
| abi: Abi.InstaBridge, | ||
| address: instaBridgeAddress, | ||
| args: [ | ||
| parseAssetId(assetId), | ||
| amount, | ||
| rcvWh.getWormholeId(), | ||
| toHydrationPrecompile(destAssetId as number), | ||
| toBytes32(H160.fromAccount(address) as `0x${string}`), | ||
| ], | ||
| func: 'bridgeViaWormhole', | ||
| module: 'InstaBridge', | ||
| }); | ||
| }, | ||
| }); |
| export const baseConfig = new ChainRoutes({ | ||
| chain: base, | ||
| routes: [...toHydrationViaWormhole], | ||
| routes: [...toHydrationViaWormhole, ...toHydrationViaInstaBridge], |
|
replaced by #304 |
No description provided.