wighawag / clones-with-immutable-args

BSD 3-Clause "New" or "Revised" License
229 stars 44 forks source link

Combine with cacheable beacon proxy to make it upgradable #9

Open BlinkyStitt opened 2 years ago

BlinkyStitt commented 2 years ago

Having upgradability and some immutables could be helpful for my current project. https://github.com/frangio/cacheable-beacon-proxy/blob/master/contracts/CacheableBeaconProxy.sol

BlinkyStitt commented 2 years ago

I've thought about it some more and I'm not sure how best to do this. Deploying the "cache" would be expensive since it clones the implementation and not the thin proxy. And I think multiple layers of delegatecall is probably not worth the gas cost.

BlinkyStitt commented 2 years ago

I think if we: 1) change https://github.com/frangio/cacheable-beacon-proxy/blob/master/contracts/CacheableBeaconProxy.sol#L92 to deploy a simple delegatecall proxy 2) change https://github.com/frangio/cacheable-beacon-proxy/blob/master/contracts/CacheableBeaconProxy.sol#L82 to include the extra data in the calldata

then it might work