You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FastNFT requires that every object in the global object pool has a unique ID.
In Move, objects that can be stored in the global object pool must have the key attribute
Thus, we need a bytecode verifier pass that ensures that every struct declaration with the key attribute has a field of type ID
For convenience + to avoid ambiguity, we should also enforce that this is the first field in the declaration and that the field is named id
In addition, any struct declaration with the key attribute must not have the drop attribute. This ensures that mutable references into the global object pool (e.g., via a &mut parameter in an entrypoint) cannot change the ID of an existing object in the pool (because ID's must be immutable--see [fastx adapter] bytecode verifier pass to ensure immutability + non-reuse of ID's #18)
An example of a similar bytecode verifier pass inside the VM is here. The code for this bytecode verifier pass should live in the fastNFT repo + be run in the adapter on the code path for publishing new Move modules.
The text was updated successfully, but these errors were encountered:
key
attributekey
attribute has a field of typeID
id
key
attribute must not have thedrop
attribute. This ensures that mutable references into the global object pool (e.g., via a&mut
parameter in an entrypoint) cannot change the ID of an existing object in the pool (because ID's must be immutable--see [fastx adapter] bytecode verifier pass to ensure immutability + non-reuse of ID's #18)An example of a similar bytecode verifier pass inside the VM is here. The code for this bytecode verifier pass should live in the fastNFT repo + be run in the adapter on the code path for publishing new Move modules.
The text was updated successfully, but these errors were encountered: