OpenZeppelin / openzeppelin-foundry-upgrades

Foundry library for deploying and managing upgradeable contracts
MIT License
177 stars 23 forks source link

Add support to create proposals through the OpenZeppelin Defender #3

Open gabrielstoica opened 10 months ago

gabrielstoica commented 10 months ago

I was searching for a method to create proposals (e.g. upgrade proposals) that require approval from a multisig wallet through the OpenZeppelin Defender but couldn't find anything out there.

Normally, when working with a Hardhat project using the @openzeppelin/hardhat-upgrades we can create proposals for a method protected by an onlyRole multisig guard in the following way or simply upgrade proposals in this way.

ericglau commented 10 months ago

Hi @gabrielstoica, thanks for the request. Defender deployments and proposals are in plan, but we expect to only support Defender 2.0 through this. Would the equivalent of Hardhat's proposeUpgradeWithApproval work for you? This requires using an upgrade approval process to perform the upgrade, which is slightly different from Defender Admin.

gabrielstoica commented 9 months ago

Hi @ericglau, thanks for your feedback. Yeah, should work this way for upgrade proposals, but what about creating proposals for any specific method protected by a role (onlyRole) granted to a multisig wallet?

ericglau commented 9 months ago

Can you provide more details on your use case, e.g. why you would like to create method call proposals through a Foundry script?

You can create proposals in Defender 2.0 using Actions https://docs.openzeppelin.com/defender/v2/module/actions. This can be automated using the Defender SDK which is a Typescript/Javascript package. Does that work for your use case?

gabrielstoica commented 9 months ago

Was thinking about automating everything (i.e. a method which needs complex inputs) through a script. As I can see, right now you have to manage two different projects: one Foundry-based project with all your contracts, tests and upgrade proposals and a second (i.e Node-based) with the Defender SDK to manage method call proposals, compared to a Hardhat-based project where everything can be combined into a single one. Am I right?

ericglau commented 9 months ago

Thanks for the feedback, we will likely add that to this library after the other features mentioned above.

ericglau commented 6 months ago

Update: At the moment, this plugin includes support for the following with OpenZeppelin Defender:

You can find the latest documentation here:

The remaining item (for this issue) is to add the ability to create proposals for functions other than upgrades.

gabrielstoica commented 6 months ago

Thanks, @ericglau - appreciate your effort!