-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bifrost XCM Integration #248
Conversation
🦋 Changeset detectedLatest commit: 209e392 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
WalkthroughThis update introduces support for Deposit/Withdrawal of BNC and vDOT tokens on the Bifrost chain within the Polkadex ecosystem. It includes adding new assets, updating configurations, and enhancing the SDK to handle the new chain and assets. Changes
Possibly related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (13)
- .changeset/honest-teachers-shout.md (1 hunks)
- packages/polkadex-api/src/modules/constants.ts (1 hunks)
- packages/thea/src/config/genesis.ts (1 hunks)
- packages/thea/src/config/substrate/assets.ts (2 hunks)
- packages/thea/src/config/substrate/builders/pallets/xTokens.ts (2 hunks)
- packages/thea/src/config/substrate/chains.ts (5 hunks)
- packages/thea/src/config/substrate/config/bifrost.ts (1 hunks)
- packages/thea/src/config/substrate/config/index.ts (2 hunks)
- packages/thea/src/config/substrate/config/polkadex.ts (4 hunks)
- packages/thea/src/config/theaConfig.ts (1 hunks)
- packages/thea/src/sdk/helpers.ts (3 hunks)
- packages/thea/src/sdk/substrate/bifrost.ts (1 hunks)
- packages/thea/src/sdk/substrate/index.ts (1 hunks)
Files skipped from review due to trivial changes (4)
- .changeset/honest-teachers-shout.md
- packages/thea/src/config/genesis.ts
- packages/thea/src/config/substrate/assets.ts
- packages/thea/src/sdk/substrate/index.ts
Additional comments not posted (11)
packages/thea/src/config/theaConfig.ts (1)
11-11
: LGTM! Ensure the exclusion of EVM chains is intentional as this change focuses on substrate chains.packages/thea/src/config/substrate/config/index.ts (1)
11-11
: LGTM! The addition ofbifrostConfig
aligns with the integration objectives.Also applies to: 22-22
packages/thea/src/sdk/helpers.ts (1)
33-34
: LGTM! The addition of theBifrost
case ingetChainConnector
aligns with the integration of the Bifrost chain.packages/thea/src/config/substrate/config/bifrost.ts (1)
42-45
: LGTM! ThebifrostConfig
is well-defined and aligns with the integration requirements. Verify the correctness of asset IDs and decimal places.packages/polkadex-api/src/modules/constants.ts (1)
81-94
: LGTM! The addition of BNC and vDOT to theASSETS
array is correctly implemented. Verify the uniqueness and correctness of the asset IDs.packages/thea/src/config/substrate/builders/pallets/xTokens.ts (1)
36-37
: LGTM! The update to thegetArgs
function for X3 transfer type aligns with XCM Version 3 specifications. Verify compatibility with XCM Version 3.packages/thea/src/config/substrate/chains.ts (1)
185-206
: LGTM! The addition of the Bifrost chain configuration is well-defined and aligns with the integration requirements. Verify the correctness of asset details and chain settings.Verification successful
The verification process has confirmed the following details:
- The
bnc
andvdot
assets are defined inpackages/thea/src/config/substrate/assets.ts
.- The
BIFROST_GENESIS
value is correctly set to"0x262e1b2ad728475fd6fe88e62d34c200abe6fd693931ddad144059b1eb884e5b"
.- The
parachainId
,ss58Format
, andws
settings for the Bifrost chain are correctly configured.The addition of the Bifrost chain configuration is well-defined and aligns with the integration requirements.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of asset details and chain settings for the Bifrost chain. # Test: Check asset details and chain settings against a trusted source or documentation. echo "Verify asset details and chain settings for the Bifrost chain."Length of output: 134
Script:
#!/bin/bash # Description: Verify the correctness of asset details and chain settings for the Bifrost chain. # Search for the definition of bnc and vdot assets in the codebase. echo "Searching for bnc asset definition..." bnc_definition=$(rg -A 5 'const bnc' | head -n 10) echo "$bnc_definition" echo "Searching for vdot asset definition..." vdot_definition=$(rg -A 5 'const vdot' | head -n 10) echo "$vdot_definition" # Search for the genesisHash, parachainId, ss58Format, and ws settings in the codebase. echo "Searching for BIFROST_GENESIS definition..." genesis_hash=$(rg 'const BIFROST_GENESIS' | head -n 1) echo "$genesis_hash" echo "Searching for parachainId, ss58Format, and ws settings..." parachain_settings=$(rg -A 5 'parachainId: 2030' | head -n 10) echo "$parachain_settings"Length of output: 2077
Script:
#!/bin/bash # Description: Verify the correctness of asset details and chain settings for the Bifrost chain. # Search for the definition of bnc and vdot assets in the codebase more broadly. echo "Searching for bnc asset definition..." bnc_definition=$(rg 'bnc' | head -n 20) echo "$bnc_definition" echo "Searching for vdot asset definition..." vdot_definition=$(rg 'vdot' | head -n 20) echo "$vdot_definition" # Verify the BIFROST_GENESIS value. echo "Verifying BIFROST_GENESIS value..." genesis_value=$(rg 'export const BIFROST_GENESIS' packages/thea/src/config/genesis.ts) echo "$genesis_value" # Verify the parachainId, ss58Format, and ws settings. echo "Verifying parachainId, ss58Format, and ws settings..." parachain_settings=$(rg -A 5 'parachainId: 2030' packages/thea/src/config/substrate/chains.ts) echo "$parachain_settings"Length of output: 7611
Script:
#!/bin/bash # Description: Verify the correctness of asset details and chain settings for the Bifrost chain. # Search for the definition of bnc and vdot assets in the assets.ts file. echo "Searching for bnc asset definition in assets.ts..." bnc_definition=$(rg 'bnc' packages/thea/src/config/substrate/assets.ts) echo "$bnc_definition" echo "Searching for vdot asset definition in assets.ts..." vdot_definition=$(rg 'vdot' packages/thea/src/config/substrate/assets.ts) echo "$vdot_definition" # Verify the full BIFROST_GENESIS value. echo "Verifying full BIFROST_GENESIS value..." genesis_value=$(rg 'export const BIFROST_GENESIS' packages/thea/src/config/genesis.ts -A 1) echo "$genesis_value"Length of output: 1458
packages/thea/src/sdk/substrate/bifrost.ts (1)
20-211
: LGTM! TheBifrost
class is well-implemented and aligns with the integration requirements. Verify the correctness of method implementations and data handling.packages/thea/src/config/substrate/config/polkadex.ts (3)
14-14
: Import ofbifrost
is correctly added for use in asset configurations.
28-29
: Import ofbnc
andvdot
assets is correctly added for use in asset configurations.
324-324
: Inclusion oftoBifrost
inpolkadexConfig
is correctly implemented, ensuring that the new assets are part of the overall chain configuration.
Description
As of now, We have Polkadot, AssetHub and some more chains in THEA. We can make deposits and withdrawls between these chains and Polkadex Network. Now, our next target is to add Bifrost Network in frontend so that more users can bring thier BNC and vDOT tokens in polkadex chain and trade in orderbook.
BNC - Subscan
vDOT - Subscan
✅ Tasks
🤔 Expected Behavior
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Refactor