I'm writing smart contract for Ethereum using Solidity and OpenZeppelin. I wish to implement this kind of situation
Where I deploy a proxy for each user and the proxy uses the same smart contract with the storage of the proxy.
But I have not found the examples about it.
The unique example are this:
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const Box = await ethers.getContractFactory("BoxV1")
console.log("Deploying Box, ProxyAdmin, and then Proxy...")
// In order to use UUPS we have to manually specify so with the option kind: 'uups'.
const proxy = await upgrades.deployProxy(Box, ['hash'], { initializer: 'initialize', kind: 'uups'})
console.log("Proxy of Box deployed to:", proxy.address)
};
where I deploy the proxy with box. But I have not found the way to deploy the proxy alone and to link the proxy to the smart contract.
The goal is:
I have a smart contract that store a hash. I have 5.000.000 of user. I wish to give at each user the same smart contract. But one day I could update this smart contract, so I wish to do one or two transaction in order to update it. I thinks that I have to use the proxy but I have not found an example.
On above figure I have a user that has own proxy that is linked to another proxy. The idea is: one day I will update only the proxy with its smart contract.