ERC-8167: Modular Dispatch Proxies

Today I migrated a repo from the withdrawn ERC-8109 to ERC-8167. That repo has one implementation contract per function, which saves gas on networks that meter codesize.

To reduce boilerplate I wrote two scripts to generate code:

  • Selectors.sh: implements the selectors(bytes4) delegate by looping over the methods in a solidity interface
  • StorageView.sh: makes view delegates for each variable in contract storage.

Both code generation scripts run from make.

Moving this ERC to Last Call

I am working on tooling to help teams manage and upgrade facets. It tracks the facets a proxy is using and commits their deployment hashes into a config (example), so you can verify facet deployments locally. It also generates verifiable migration scripts automatically. I describe the end-to-end workflow here.

We will be using this in Filecoin to allow automation to deploy both the next upgrade and the migration script. Anyone being able to verify that the facets match the code in version control will improve confidence in the upgrade process.

for the reuse - a slide from ETH Prague

1 Like