Feat: PIM factories (restricted and immutable)
This PR consolidates the efforts on the two PIM factories:
- it removes the outdated generalized factory
- it adds the restricted factory (Qacc use case)
- it adds the immutable factory (coin launcher use case)
Open questions for me at this point:
Restricted PIM Factory:
- right now all privileges that exist go to the address that is set as
initialAdmin - this comprises:
- being workflow admin (1)
- receiving initialIssuanceSupply (2)
- being token owner for issuance token (3)
- receiving CURVE_INTERACTION_ROLE (4)
However, I learned this might not be ideal for qacc, since the participating projects won't be orchestrator admins. Would it make sense to make a "split" between (1) and (2,3,4)? So the user passes another address to the factory that receives privileges (2,3,4) while the address passed as initialAdmin "only" receives privilege (1)? @0xNuggan
I addressed your comments @marvinkruse. In addition to that I had to make some additional changes to cater for qacc specific needs:
- the restricted factory now contains a pre-funding mechanism where anyone can sponsor the initial collateral supply required for the deployment of a PIM workflow (sponsor can also withdraw their pre-funding again)
- to be able to use pre-funding, deployer needs to set sponsor as workflow admin
- initial issuance supply goes to deployer
- curve interaction role also goes to deployer
Note: fee claim for deployer is planned to be enabled through admin's Multisig via Zodiac Roles
@fabianschu Overall looks good to me, one thing I just noticed though: we want to deploy the factories any time a testnet deployment goes through, potentially even with every deployment (but I'm not sure about that last part). Two things come to mind there: (a) it should be included in the TestnetDeploymentScript to automatically just deploy both factories and (b) for that it would probably be cool to have not just a run() function in the DeployWorkflowSpecificFactory.s.sol but also a run(orchestratorFactory, trustedForwarder, factoryType)` or something like that - if that makes sense?
Will be split into multiple PRs