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:
- At start of execution GenVM reads the
upgraderslist of Root Slot. It does not lead to RAM Consumption
- At start of execution GenVM reads the
- If the sender is not in the
upgraderslist of Root Slot, GenVM reads
locked_slotsand will prevent writing to them. It implies \(32*n\) RAM Consumption, where \(n\) is the number of locked slots. This memory is never released.
- If the sender is not in the
- GenVM reads the
codefield of Root Slot and executes it. It causes exactly
codesize in octets RAM Consumption
- GenVM reads the