-
Notifications
You must be signed in to change notification settings - Fork 9
feat: factory for setting tree in CSM's VettedGate
#91
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
base: develop
Are you sure you want to change the base?
Conversation
d0245a4 to
22036b7
Compare
VettedGateVettedGate
| string memory treeCid | ||
| ) private pure { | ||
| require(treeRoot != bytes32(0), ERROR_TREE_ROOT); | ||
| require(bytes(treeCid).length > 0, ERROR_TREE_CID); |
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.
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.
fixed
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.
The new factory contract looks good!
I would recommend adding an integration or scenario test (using mock for VettedGate is fine while the new contracts are not yet deployed). This would serve as a usage example for the factory and help demonstrate the expected permissions setup.
| raise ValueError("Factory name cannot be empty") | ||
| if not isinstance(factory_name, str): | ||
| raise TypeError("Factory name must be a string") | ||
| if len(factory_name) > 32: |
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.
With this constraint, a factory named IdentifiedCommunityStakerSetTreeParams cannot be deployed, as its name exceeds the 32-character limit
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.
We can use ICSSetTreeParams
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.
That’s OK, but the name "IdentifiedCommunityStakerSetTreeParams" was used in the test and mentioned in a comment in the contract. If the deploy script doesn’t actually allow creating a factory with that name, it can be a bit misleading.
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.
We will remove the restriction from the deploy script
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.
@Psirex Added scenario test and removed the restriction
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.
LGTM👍🏻
No description provided.