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 to Collections ("unique digital collection" or UDC) #24

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

crisdut
Copy link
Member

@crisdut crisdut commented Jan 15, 2024

Description

This PR implement the support UDC implementation on top of RGB21.

For now, I've only implemented the issuance, so I'm leaving it in draft. My goal is to complete the transfers in the next few days.

For help in test the issue subroutine, I documented all lines of the script and tested it with list bellow:

Validations (Checklist)
Basically, we validate the contract item data and allocations:

  • Amount of Items in tokens field (i.e. TokenData) must be equal than amount of items in assignments field (i.e. Allocation);
  • Each index token registered in tokens field must have an allocation defined in assignments field;
  • Each index token registered in assignments field must have an allocation defined in tokens field;
  • Every allocation must have if and only if a fraction of the contract;
  • If a token index is not found, the script must be failed.
  • If a fraction is greater than 1, the script must be failed.

BTW, this PR depends other PRs:

@crisdut crisdut marked this pull request as draft January 15, 2024 20:26
@crisdut crisdut changed the title Support to Collections of NFTs ("unique digital collection" or UDC) Support to Collections ("unique digital collection" or UDC) Jan 15, 2024
Copy link
Member

@dr-orlovsky dr-orlovsky left a comment

Choose a reason for hiding this comment

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

Wow, you became the third AluVM assembly developer in the whole world! And actually with this you already wrote more RGB asm code than I ever did!

I have just a single concern that the validation for a state transitions calls to some invalid offset - otherwise LGTM. I will try to test the script as well to make sure that all the loops work in a correct way.

PS. We need Contractum not to brainfuck with loops the way we have do when doing asm...

src/udc.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants