Skip to content
CCPEDIAby Unity Nodes
App Development

Upgrading a template by changing a field from being mandatory to Optional

3 posts46 viewsLast activity May 2026

  1. cohen.avrahamOP

    Hello,

    I am using the SCU tool when upgrading my contracts, and I would like to know why when I change the definition of a field from Int to Optional Int it require bumping the main version of the package?

    Why is this change not defined as an SCU-compatible? In terms of knowing the new value, that is not an issue, as it will be Some <Int>

  2. Jatin_Pandya_cf

    hey,

    before this, just a heads up that SCU compatibility table is explicit on this point that “Change of Field Type” is listed as not covered by SCU so changing Int to Optional Int is a type of change, even though it seems semantically lossless.

    AFIK, a v1 contract with myField: Int = 42 can be represented in v2 as myField: Optional Int = Some 42. That direction works.

    BUT buttom line is SCU does allow adding a new Optional field at the end.

  3. cohen.avraham

    Thank you @Jatin_Pandya_cf for your response, and I am well aware of what is defined as SCU compatible and what is not.

    I would like to know why such changes are not possible to be SCU compatible.

    Is it related to protobuf compatibility?