-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contract changes to support ERC1155 #381
Conversation
…itlementGatedV2 contract.
…lement to have V2 naming.
…nsibility for decoding params.
transaction.roleIds.push(roleId); | ||
|
||
for (uint256 i = 0; i < selectedNodes.length; i++) { | ||
transaction.nodeVotesArray[roleId].push( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use EnumerableSet not arrays
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a straight copy of previous implementation, do you think we could defer to a follow-up PR?
contracts/src/spaces/facets/gated/EntitlementGatedStorageV2.sol
Outdated
Show resolved
Hide resolved
@@ -65,7 +67,8 @@ export type CheckOperation = { | |||
checkType: CheckOperationType | |||
chainId: bigint | |||
contractAddress: Address | |||
threshold: bigint | |||
threshold?: bigint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be params bytes, not specific data, so we never have to go through this again for new operation types.
RuleEntitlement, EntitlementGated, and EntitlementDataQueryable are now deprecated for new spaces in favor of RuleEntitlementV2, EntitlementGatedV2, and EntitlementDataQueryableV2, all of which expose their respective V1 interfaces for legacy interoperability. Old contracts are left in code for reference and for the sake of generating bindings, but should no longer be deployed once these contract changes are deployed.
Since V1 contracts are deprecated, contract tests are updated to run against V2 contract versions.
I added a
RuleDataUtil
library that converts between V2 and V1 rule data so that v2 contracts can return RuleData in v1 format for stream and xchain nodes. Role creation and updating would have required creating creating V2 versions of entitlements manager, IEntitlements, and many other contracts, but this happens exclusively through the client, so we can just upgrade all role creation to use V2 rule data and force client upgrades once these contracts are deployed.The client is updated entirely to use V2 rule data, but stream nodes and xchain nodes are still using V1 endpoints on the new contracts. There will be a follow-up PR that migrates core services to use V2 endpoints.
Tested locally on harmony with some staged changes ready for a follow-up PR and gating on spaces and channels works fine.