Hello community.
There is an answer to this problem using truffle. But it is not clear to me how to solve the problem with hardhat.
Develop destroyed the JSON of the contents of the .openzeppelin folder where the manifestVersion, the admin contract, the proxies contracts and the implementations registry are located.
We deduce that if we manipulate somehow that JSON of a older version we could get it to work.
Is such a thing possible?
In the answer linked in truffle it is commented that it can be solved manually.
We see that we can deploy from Remix without being very clear if it is really updating those contracts.
Then, there is the solution suggested by hardhat:
To register a previously deployed proxy for upgrading, use the forceImport function.
We do not understand very well where this function has to be placed to perform this forced import and if it must be removed later.
From the structure of the code I understand that it will have to be added in some hardhat script, right?
async function forceImport(
address: string,
deployedImpl: ethers.ContractFactory,
opts?: {
kind?: 'uups' | 'transparent' | 'beacon',
},
): Promise<ethers.Contract>
If there is any example to check how to perform this process I would appreciate it. In any case clarify the process to be able to force the import and continue working from hardhat.
Or even if there is an alternative way to solve this problem.