Skip to content
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

Support multi asset per contract #496

Closed
xgreenx opened this issue Jun 16, 2023 · 0 comments · Fixed by #506
Closed

Support multi asset per contract #496

xgreenx opened this issue Jun 16, 2023 · 0 comments · Fixed by #506
Assignees
Labels
breaking A breaking api change fuel-vm Related to the `fuel-vm` crate. good first issue Good for newcomers

Comments

@xgreenx
Copy link
Collaborator

xgreenx commented Jun 16, 2023

Specification: FuelLabs/fuel-specs#491

The change should be simple and requires several modifications:

  • Update mint and burn opcodes in the fuel-asm to accept register b.
  • Add new Mint and Burn variants into the fuel_tx::Receipt enum. Update serialization and deserialization, and update unit tests to check the correctness of new values.
  • Update the mint and burn functions in the fuel-vm to process register b and append a new receipt.
  • Extend unit tests to validate the correctness of the register b, modification of the receipt_root.

Modification of the fuel_tx::Receipt will trigger a cascade of modification in downstream crates, so we don't need to track it in downstream repositories except for sway, TS sdk, and maybe indexer.

@xgreenx xgreenx added the good first issue Good for newcomers label Jun 16, 2023
@Dentosal Dentosal added breaking A breaking api change fuel-vm Related to the `fuel-vm` crate. labels Jun 30, 2023
@xgreenx xgreenx assigned MitchTurner and xgreenx and unassigned MitchTurner Jul 10, 2023
Voxelot added a commit to FuelLabs/fuel-specs that referenced this issue Aug 7, 2023
### Abstract

This PR introduces granular asset minting which would enable sub
identifiers to be included at asset creation. These sub identifiers can
include important metadata and be used to enable native level NFTs.

**This adds:**
- A new asset ID construction (which incorporates the contract ID and
the sub asset ID).
- New receipt logs for minting and burning which are helpful for
indexing.
- Changes to the MINT and BURN opcodes.

### Cons

- This removes the nice feature that asset IDs are the contract ID.

### Pros

- Native level UTXO based NFTs.
- Single contract multi-asset pools (useful for common AMM designs).

Implementation tickets/PRs:

- FuelLabs/fuel-vm#496
- FuelLabs/fuels-ts#1067
- FuelLabs/fuel-indexer#1012
- FuelLabs/sway#4651

---------

Co-authored-by: Brandon Kite <brandonkite92@gmail.com>
Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking A breaking api change fuel-vm Related to the `fuel-vm` crate. good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants