What's the recommended pattern for deploying multiple proxies that use the same logic contract?
We're currently using the pattern:
// Migration M
const MyLogicContract = artifacts.require("MyLogicContract");
const firstProxy = await deployProxy(MyLogicContract, [], { deployer });
// Migration N
const MyLogicContract = artifacts.require("MyLogicContract");
const secondProxy = await deployProxy(MyLogicContract, [], { deployer });
After the second migration, build/contracts/MyLogicContract.json has the secondProxy
address and the firstProxy
address is not present anywhere that I can find.
The documentation describes the behavior and indicates reuse is a first-class usage pattern, yet doesn't seem to reconcile the former (A) with the latter (B):
(A)
During a migration, the proxy address will be stored in the implementation contract’s artifact
(B)
If you call
deployProxy
several times for the same implementation contract
Thanks.