rgb-std icon indicating copy to clipboard operation
rgb-std copied to clipboard

add statechange for owned-fraction in rgb21 invoice data

Open cymqqqq opened this issue 8 months ago • 2 comments

Background:

Now there are Amount, and Ownedfraction in the RGB invoice module, that is pub struct Amount( u64); and pub struct OwnedFraction(u64);. We can perform a state change operation for the amount type when we want to build a transfer transition, and there is also the check_add method for the amount type. Both the StateChange and check_add for the amount type can perform algorithm operation(+, -).

Then for the rgb21 invoice, there is Ownedfraction which is u64 similar to Amount, and now if we want to build a transfer operation for the rgb21 contract, we just push all of them(owned fraction, token index) into the data state. So I think maybe there is also a state change and a check_add method requirement for the Ownedfraction type, and then the user can add an owned fraction when they want to transfer. Finally, they can push (changed owned fraction, token index) into a data state.

Description:

impl StateChange for Ownedfraction

cymqqqq avatar Jun 25 '24 03:06 cymqqqq