cowdao-grants / cow-fee

GNU General Public License v3.0
2 stars 0 forks source link

Add script to enable module on a target Safe #12

Closed fleupold closed 5 months ago

fleupold commented 5 months ago

We will likely have to enable/disable the module periodically (on every keeper rotation, in case someone wants to run the script manually with their own key, etc).

It would be nice to have a single script that someone can run from an owner account to propose a transaction that enables this module on a target safe.

meetmangukiya commented 5 months ago

Hmm, queuing to safe might be complicated from a forge script, can do a typescript one with safe sdk but will have some signer assumptions? i dont assume all signers will be hot wallets, some might have ledger, some trezor?

fleupold commented 5 months ago

This is just to "propose" the transaction to the Safe wallet (for this some teams use a dedicated proposer account, which is shared and doesn't count as a real signer). I would the review and signing assume to happen via the UI (using whatever properly secured keys signers use)

You can see https://github.com/cowprotocol/contracts/blob/main/src/tasks/withdraw/safe.ts#L36 for reference

mfw78 commented 5 months ago

I see it's already done (8cd3f853899bba3f9e31850e70629edb70bf776e already pushed), but in general, given the likely frequency this would be used, I'd think having documentation on how to use cast to generate the calldata that is required in order to enable / disable the module so that this could be inserted into the transaction builder would be simple enough (reasoning: reduced dependencies, reduced code base, simpler).

meetmangukiya commented 5 months ago

Enable a module with tx builder with to set to self address, data set to cast calldata "enableModule(address)" <module-address>. Disable a module from the settings page.