Skip to content

Naive approaches

Parameterize everything

Make everything configurable by default so if there is ever a change you need to make, there is a backdoor for you to make it.

This is very similar to how mobile apps are made highly configurable so they can be updated in the background without needing to go through App store / Play store approval.

// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.22;
contract Storage {
uint multiplier;
uint num;
constructor() {
num = 0;
multiplier = 1;
}
function setNum(uint _num) public {
num = _num * multiplier;
}
function getnum() public virtual returns (uint) {
return num;
}
function setMultiplier(uint _multiplier) public {
multiplier = _multiplier;
}
}

Migrating contracts

Ask everyone to upgrade to a new smart contract address.

Pros -

  1. Easy enough. No need to understand proxies/upgrades

Cons -

  1. Storage needs to be migrated to the new contract
  2. Everyone needs to update the contract address in their clients