Limit on Number of Accounts Managed by AccessManager

I'm currently using OpenZeppelin's AccessManager for role-based access control in my smart contract. I'm wondering if there's any practical limit on the number of accounts (wallets) that can be assigned roles using AccessManager. I need to "whitelist" a potentially large (potentially unbounded) number of wallets to access certain functions.

Does anyone have experience with managing a large number of accounts with AccessManager? Are there any best practices or considerations to keep in mind when scaling this up? Any limit?

Thanks in advance!

There's no limit defined by the OZ itself. There will be practical limit based on gas costs, storage, etc. , but I think it's enough to host a large amount address.

If the use case is only about whitelisting, then I would suggest you to use off-chain Merkle proof-based solution. This would be more efficient. And no practical limit.

I've personally used the same, and currently 5k+ addresses are whitelisted. Much better than mappings or structs to store whitelists.

1 Like