hardhat-ignition
hardhat-ignition copied to clipboard
Support for Diamond-like contract patterns
Describe the feature
Some contracts use a pattern similar to an upgradeable proxy, but where the implementation doesn't exist in a single contract but in multiple contracts instead. One of the reasons for doing this is to avoid the contract size limit.
The most well-known pattern that does this is the Diamond pattern, but there are systems with their implementation of something similar (e.g., The Graph and Synthetix).
You can now deploy such a system with Ignition, but you can't express a contractAt
that combines all the different implementations.
I think this snippet illustrates the problem:
const proxy = m.contract('DiamondLikeProxy');
const implementation1 = m.contract('Implementation1');
const implementation2 = m.contract('Implementation2');
// Somehow set the implementations
const proxyWithCombinedAbi = m.contractAt(?????, proxy) // Which contract name do we use?
As a workaround, you can do multiple contractAt
s, depending on how you need to interact with the contact, but that's really inconvenient.
Search terms
modules, diamond, proxy