Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify interaction with multisig wallets in deployment scripts #1859

Conversation

alysiahuggins
Copy link
Contributor

@alysiahuggins alysiahuggins commented Aug 13, 2024

Closes #1838

This PR:

  • provides scripts to deploy the FeeContract, LightClient Contract and PlonkVerifier library without OpenZeppelin Defender and without a multisig wallet creating the transaction (thus via an EOA)
  • provides scripts to upgrade the FeeContract and LightClient using an EOA to deploy the new implementation contracts and the Safe SDK to create a transaction on the Safe interface so that a Safe multisig wallet can be used to upgrade the proxy contracts as its the owner of these proxies
  • consolidates scripts, improve comments across scripts and uses a stricter naming convention for scripts & their containing functions

Key places to review:

  • updated README
  • updated scripts
  • the use of vm.ffi to interact with the Safe wallet (this was used since that interaction flow was already set up for a previous admin modification)

How to test this PR:

  • Follow the instructions in the README to deploy the the FeeContract and LightClient proxies
  • Follow the instructions in the README to upgrade the FeeContract and LightClient

Things tested

  • deploying the contracts mentioned above using the forge script command
  • upgrading the respective proxies using the forge script command

Things not tested

  • interacting with functions on the PlonkVerifier library once deployed

@alysiahuggins alysiahuggins changed the title DRAFT PR | simplify interaction with multisig wallets in deployment scripts simplify interaction with multisig wallets in deployment scripts Aug 22, 2024
/// @notice Upgrades the fee contract first by deploying the new implementation
/// and then executing the upgrade via the Safe Multisig wallet using the SAFE SDK.
contract UpgradeFeeContractScript is Script {
string internal originalContractName = "FeeContract.sol";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to use this upgrade more than once, should we also make it so that the originalContractName can be derived from an environment variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @Ayiga , i did that in this update 4ac6ca7 however, the actual contract still needs to be imported into the script as we see here

FC implementationContract = new FC();
so there will still need to be changes to the script when the time comes

Copy link
Member

@zacshowa zacshowa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one comment / nit for my own understanding 😄

@@ -0,0 +1,59 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my own understanding, Are these run files used by something in the repo like CI or tests?

If we do need to be committing them to the repo, what are we using them for? If not should we add the /contracts/broadcast directory to the .gitignore and remove ones that currently reside in the repo?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is to only commit the files for public deployments to the repo. It's to make life easy for anyone who wants to interact with the deployed contracts.

* change from SEPOLIA_RPC_URL to production URL when deploying to production
*/
// Initialize web3 provider using the RPC URL from environment variables
const web3Provider = new ethers.JsonRpcProvider(getEnvVar("SEPOLIA_RPC_URL"));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could just name it RPC_URL then we can just change the RPC_URL in .env and no code changes needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like, will do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, added a few extra comments related to this

.env Show resolved Hide resolved
justfile Show resolved Hide resolved
@Sneh1999 Sneh1999 self-requested a review September 16, 2024 19:51
Copy link

@Sneh1999 Sneh1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

.env Show resolved Hide resolved
@alysiahuggins alysiahuggins merged commit f3ce319 into main Sep 16, 2024
16 checks passed
@alysiahuggins alysiahuggins deleted the 1838-simplify-interaction-with-multisig-wallets-in-deployment-scripts branch September 16, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

simplify interaction with multisig wallets in deployment scripts
5 participants