Replies: 1 comment
-
I think the motivation was simply being able to deploy a whole round with all contracts in one call. The factories basically just create proxies. What do you think about adding the clone logic into the initialize function. bytes32 salt = keccak256(abi.encodePacked(msg.sender, nonce));
votingStrategy = IVoteStrategy(ClonesUpgradeable.cloneDeterministic(votingContract, salt));
votingStrategy.init(); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Background:
We (somewhat recently?) updated the
InitAddress
struct to be addresses for factory contracts for voting and payout strategies:Source
This means, that when someone creates a round, they pass in factory contracts for each strategy (as opposed to the contracts themselves) and
initialize()
(1) callscreate()
on the factory contracts and then (2) calls init on the contract that comes back.Source
Context:
I think I missed what motivated this change and just want to flag, I think we'd prefer to have any factory logic be outside of the protocol and accept addresses for the strategies directly. This forces everyone to use a factory, which is extra code to write and extra gas to spend (both in deploying the factory and in calling
create()
here rather than just being able to callinit()
.Most strategies probably wont need a factory anyway. And our current implementation does create a way to pass arguments to
create()
so the utility of having a factory is somewhat negated.Suggested Implementation:
I think we should change the struct back to holding the strategy addresses and not assume that a factory is being passed in.
Then update
initialize()
toBeta Was this translation helpful? Give feedback.
All reactions