Skip to content

WIP: agglayer asset conversion procedure#2121

Closed
partylikeits1983 wants to merge 24 commits intoajl-b2agg-bridge-out-burnfrom
ajl-agglayer-asset-conversion
Closed

WIP: agglayer asset conversion procedure#2121
partylikeits1983 wants to merge 24 commits intoajl-b2agg-bridge-out-burnfrom
ajl-agglayer-asset-conversion

Conversation

@partylikeits1983
Copy link
Contributor

@partylikeits1983 partylikeits1983 commented Nov 26, 2025

Asset Conversion Procedure Overview

This PR adds the functionality for converting between asset amounts with various decimals for Agglayer bridging operations.

Note:

Resolves #2011
Builds on top of #2007


The convert_to_u256_scaled procedure converts Miden amounts to Agglayer-compatible u256 format for bridging to agglayer chains.

@partylikeits1983 partylikeits1983 requested review from Copilot and removed request for Copilot November 26, 2025 21:58
@partylikeits1983 partylikeits1983 added no changelog This PR does not require an entry in the `CHANGELOG.md` file agglayer PRs or issues related to AggLayer bridging integration labels Nov 26, 2025
@partylikeits1983 partylikeits1983 changed the base branch from agglayer to ajl-b2agg-bridge-out-burn November 27, 2025 14:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements asset conversion functionality to transform Miden amounts (1e6 base) to Ethereum-compatible u256 format with configurable decimal precision. The implementation includes a new MASM procedure, Rust component wrapper, and test suite.

Key changes:

  • New convert_to_u256_scaled MASM procedure that performs decimal scaling and u256 formatting
  • Asset conversion component library with initialization and wrapper functions
  • Comprehensive test suite covering USDC (6 decimals), ETH (18 decimals), and edge cases
  • Build system enhancements with debug mode and improved directory handling

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
crates/miden-lib/asm/agglayer/account_components/asset_conversion.masm Core MASM procedure implementing asset conversion with decimal scaling and u256 formatting
crates/miden-lib/src/agglayer/mod.rs Rust wrapper providing library initialization and component creation for asset conversion
crates/miden-testing/tests/agglayer/asset_conversion.rs Test suite validating conversion behavior for various token types and amounts
crates/miden-testing/tests/agglayer/mod.rs Module declaration adding asset_conversion tests to the test hierarchy
crates/miden-lib/build.rs Build system improvements including debug mode enablement and defensive directory checks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@partylikeits1983 partylikeits1983 changed the base branch from ajl-b2agg-bridge-out-burn to agglayer December 5, 2025 15:50
@partylikeits1983 partylikeits1983 changed the base branch from agglayer to ajl-b2agg-bridge-out-burn December 5, 2025 15:52
@partylikeits1983
Copy link
Contributor Author

Closing in favor of #2141

@partylikeits1983 partylikeits1983 removed the request for review from mmagician December 5, 2025 17:58
@bobbinth bobbinth deleted the ajl-agglayer-asset-conversion branch January 17, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agglayer PRs or issues related to AggLayer bridging integration no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants