You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR #177 implements the UUPS pattern in the QGB smart contract.
This changes how the QGB contract will be deployed from now on.
Previously, we were using a deploy command from the orchestrator-relayer to deploy the contract as it was straightforward.
Now that it's upgradable, to deploy it, we need to do the following:
Deploy the implementation
Deploy the proxy
Link the proxy to the implementation
Doing these steps, when deploying, and also when upgrading doing something similar, can be a bit tricky to implement/maintain correctly.
Proposals:
Hardhat project
Create a deploy folder inside the QGB repo, which would contain a hardhat project and a Makefile. This project will have already implemented scripts for deploying/upgrading, and will use the contracts in the root QGB repo.
This would allow keeping using foundry as a dev environment, and hardhat for deployment/upgrades.
The Makefile and a few scripts will help automate the whole process.
Also, we can incorporate some static code analyzers to be executed to check for known issues.
The upside is that we will use the hardhat abstractions directly, and not have to maintain them:
constqgb=awaithre.ethers.getContractFactory("QuantumGravityBridge");letqgbInstance=awaithre.upgrades.deployProxy(qgb,[12443,12344,"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"],{initializer: 'initialize',kind: 'uups'});awaitqgbInstance.waitForDeployment();console.log(`deployed to ${awaitqgbInstance.getAddress()}`);constqgbV2=awaithre.ethers.getContractFactory("QuantumGravityBridgeV2");console.log("Upgrading QGB...");awaithre.upgrades.upgradeProxy(awaitqgbInstance.getAddress(),qgbV2);console.log("QGB upgraded successfully");
Note: we will still have a go command to deploy so that we use it in E2E tests and others. However, it will contain an experimental implementation not advised for production.
Maintain our own implementation
Update the deploy go command to do all the steps done by hardhat deployProxy and also provide an upgrade command to perform the upgrades. And then having to maintain them for any changes, etc.
Decision
TBD.
The text was updated successfully, but these errors were encountered:
Context
This PR #177 implements the UUPS pattern in the QGB smart contract.
This changes how the QGB contract will be deployed from now on.
Previously, we were using a
deploy
command from the orchestrator-relayer to deploy the contract as it was straightforward.Now that it's upgradable, to deploy it, we need to do the following:
Doing these steps, when deploying, and also when upgrading doing something similar, can be a bit tricky to implement/maintain correctly.
Proposals:
Hardhat project
Create a deploy folder inside the QGB repo, which would contain a hardhat project and a Makefile. This project will have already implemented scripts for deploying/upgrading, and will use the contracts in the root QGB repo.
This would allow keeping using foundry as a dev environment, and hardhat for deployment/upgrades.
The Makefile and a few scripts will help automate the whole process.
Also, we can incorporate some static code analyzers to be executed to check for known issues.
The upside is that we will use the hardhat abstractions directly, and not have to maintain them:
Note: we will still have a go command to deploy so that we use it in E2E tests and others. However, it will contain an experimental implementation not advised for production.
Maintain our own implementation
Update the deploy go command to do all the steps done by hardhat
deployProxy
and also provide anupgrade
command to perform the upgrades. And then having to maintain them for any changes, etc.Decision
TBD.
The text was updated successfully, but these errors were encountered: