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
Declaring new composite fields is currently unsupported for all kinds of composites (resources, structs, contracts).
Currently, contracts are implemented as composite values, just like resources and structs, i.e. each contract variable is a field in the composite value.
When declaring a new field for a composite, we need to migrate all already existing composite values and add the new field, which might be prohibitively expensive for some composite declarations, like resources and structs of popular contracts (e.g. there are millions of TopShot Moment resources stored).
However, given that contract values are singletons, we could actually allow adding fields to contracts, as only one single value is stored and needs to be migrated.
Suggested Solution
Allow adding fields to contracts
Load the existing contract value and add the new field
The text was updated successfully, but these errors were encountered:
Issue To Be Solved
Declaring new composite fields is currently unsupported for all kinds of composites (resources, structs, contracts).
Currently, contracts are implemented as composite values, just like resources and structs, i.e. each contract variable is a field in the composite value.
When declaring a new field for a composite, we need to migrate all already existing composite values and add the new field, which might be prohibitively expensive for some composite declarations, like resources and structs of popular contracts (e.g. there are millions of TopShot Moment resources stored).
However, given that contract values are singletons, we could actually allow adding fields to contracts, as only one single value is stored and needs to be migrated.
Suggested Solution
The text was updated successfully, but these errors were encountered: