Upgradable contracts and bridges

Hi! I'm Julien from Unlock!
We're big fans of OZ and have been using your upgradable contracts for long enough that it's now a pain to upgrade them :slight_smile:

Joke aside, our factory contract is upgradable via OZ. For now the proxy admin is owned by a Gnosis multisig but we're getting very very close to moving it to one of your Governor contracts (with our own ERC20 governance token).

This setup exists on mainnet, but also on Polygon and xDAI (and soon more!). However, we don't want to have a governor contract on each chain. We want the mainnet governor contract to be able to trigger upgrades on the side chains.

For this, we will necessarily have to use a bridge.
The rough design would be this:

  • an AMB (https://docs.tokenbridge.net/amb-bridge/arbitrary-message-bridge-deployment) exists between the mainnet and each of the chains we are deployed on
  • the AMB can only process messages which are coming from the governor contract on mainnet
  • on the local chain, the AMB is in fact the proxy admin (it only can upgrade the Unlock contract on that chain). Additionally since the unlock contract is Ownable, the AMB is also the owner (so it can call some specific admin functions on it)
  • when a new proposal is submitted it includes both the mainnet upgrade/admin calls AND all of the side chains corresponding calls to the bridges. Ideally, even when the proposal is executed, it's triggered automatically on all of the chains/l2.

Has anyone done anything similar? Is this crazy/dumb?

I would love to share notes!

We're just getting started on that front

1 Like

Hey Julien! While I'm not (yet) familiar with AMBs, I'd suggest you check out this project from AAVE, who is working on a very similar problem!