Contract Upgradability#

GenVM provides a native contract upgradability system that allows contracts to be modified after deployment while maintaining security guarantees and clear access controls.

Data that is necessary for this process resides in Root Slot.

Upgrade Control Mechanism#

The upgrade system works through access control during write transactions:

  1. At start of execution GenVM reads the upgraders list of Root Slot.

    It does not lead to RAM Consumption

  2. If the sender is not in the upgraders list of Root Slot,

    GenVM reads locked_slots and will prevent writing to them. It implies \(32*n\) RAM Consumption, where \(n\) is the number of locked slots. This memory is never released.

  3. GenVM reads the code field of Root Slot and executes it.

    It causes exactly code size in octets RAM Consumption