BeaconProxies upgradeAndCall() how to use it

I am using the Beacon pattern for some proxies that refer to the same implementation. Multiple BeaconProxies refer to the same UpgradeableBeacon for the implementation address.

Whenever I want to upgrade the implementation I simply have to call the "upgradeTo" method in the UpgradeableBeacon, but what if I need to run some new initialization code on all BeaconProxies refering to the UpgradeableBeacon? How tu run a recursive "UpgradeToAndCall" on all BeaconProxies?

The reason why the beacon proxy pattern exists is precisely to avoid invoking "upgradeToAndCall" on all beacon proxies. So there is no way to do this out of the box. Ideally, you would write your upgrade so that this is not necessary. If it's necessary, you should probably write a simple contract that invokes it on all proxies.

1 Like