Is there an equivalent method to
ethers.GetContract()
that gives me access to the deployment contract that is returned from:
await exampleContract.deployed()
which was previously deployed with OpenZeppelin upgrades?
ie
const ExContract = await exampleContract.deployProxy();
const exContract = await exampleContract.deployed();
Context:
I've deployed a contract using the hardhat deploy plugin in conjunction with
Openzepplin's upgrades.
In essence I've populated my deploy folder with a sequence of 4 files (01-04) each deploying different contracts.
Inside of each deploymentFunction, I'm deploying the upgradable contract with:
const GovToken = await ethers.getContractFactory("GovToken");
const govToken = await upgrades.deployProxy(GovToken, { kind: "uups" });
await govToKen.deployed();
I've deployed these contracts to a local node. This all works fine.
Where I'm hitting a wall is:
I'm attempting to invoke a script, post deployment, that needs access to the previously deployed contract instance.
How can I get access to these now deployed contracts in another script?
In the past, before using the upgrades plugin, I would use
from hardhat deploy: hre.deployments.get("ExampleContract")
or from ethers : ether.getContract("ExampleContract")
I've scoured the internet and openZepplin's upgrades API as well as upgradesCore in my node module but cant see to find anything.
Thanks in advance.