Closed zoedberg closed 8 months ago
This can be achieved by creating an AluVM script checking genesis. I will try to do this.
BTW we can have more strict requirements in the scheme than in the interface. I mean even if the RGB21 interface allows optional tokens, in schema we can require the presence of at least one:
interface RGB21
global tokens* :: TokenData
-- ...
schema UDA implements RGB21
global tokens+ :: TokenData
-- ...
I made the necessary changes to the UDA schema in https://github.com/RGB-WG/rgb-schemata/pull/19
Currently it's possible to issue an UDA contract with an asset owner but no tokens. But the
assetOwner
field wants a seal and an allocation, and the latter is defined asstruct Allocation(TokenIndex, OwnedFraction)
. If the asset has no tokens I don't see why the allocation should refer to a token index that doesn't exist.I would change the interface definition from
assetOwner*
andtokens*
toassetOwner+
andtokens+
. But I remember this was once said (https://github.com/LNP-BP/LNPBPs/pull/154#discussion_r1179659623):Therefore I'm ok keeping
assetOwner*
andtokens*
, but IMO we should add a check that prevents setting anassetOwner
without defining alsotokens
. Any other solution that removes this inconsistency will also be fine.