-
Notifications
You must be signed in to change notification settings - Fork 20
Labels
Description
For DirectPayments and UbiPools only supports adding single members.
for some use-cases, with pre-defined larger member lists, it would make sense to support BulkAdding members.
OpenZeppelin’s AccessControl only exposes single-account grantRole/revokeRole.
there’s no native batch helper, so bulk member adds are commonly implemented by looping over an address[] in a custom function.
Gas is linear in addresses, so batches must stay below block limits.
- Contract changes (both factories + pools):
- add addMembers(address[] ...) callable by pools/managers
- emit event,
- reuse current validation (uniqueness/membersValidator/onlyMembers), ensure factory memberPools registry updates per new member without double-counting. add revert/skip strategy for invalid entries.
- Contract tests:
- Hardhat specs for UBI and DirectPayments factories/pools covering happy path (bulk adds all),
- mixed valid/invalid members, duplicate handling,
3/ onlyPool/manager gating, and member registry lookups.
- SDK changes (packages/sdk-js/src/goodcollective/goodcollective.ts):
- expose bulk method(s) to call new contract functions; update types/ABIs and regenerate typechain if needed.
- add a flow that returns the amount of gas and native token required for executing the bulk-add-member.
To keep in mind:
- Research a bit on how to keep gas consumption at a minimum
- Handle reverts gracefully, potentially hardcoding the max amount of members (above which it would not fit in a block)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
In Review