Skip to content
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

Extra functionality to improve reusable contracts #68

Merged
merged 3 commits into from
Aug 28, 2024

Conversation

darcys22
Copy link
Collaborator

No description provided.

@darcys22 darcys22 changed the title Owner can modify the serviceNodeParams of a multi contributor contract Extra functionality to improve reusable contracts Aug 27, 2024
Copy link
Collaborator

@Doy-lee Doy-lee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like some precursor work for the larger reusable contracts change. I suspect we'll be getting rid of the finalized flag which is still used here, and, we might just end up with a very chunky reset function that lets you assign all the parameters at once.

If we end up down that route then it'd remove the need for individual setter functions. But for now this looks fine.

function updateBLSPubkey(BN256G1.G1Point memory newBlsPubkey) public onlyOperator {
require(!finalized, "Cannot update pubkey: Node has already been finalized.");
require(contributorAddresses.length == 1, "Cannot update pubkey: Other contributors have already joined.");
require(contributorAddresses[0] == operator, "Cannot update pubkey: Operator has not contributed yet.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The operator has to be at slot 0, I think we can omit this. Shouldn't be possible to hit. Though if we keep it, the error string is inaccurate, it's more that there's an unexpected contributor in the 0th slot (and they've somehow as a non-operator already contributed for them to be in the array).

Similarly with the same require in updateServiceNodeParams

@darcys22 darcys22 merged commit c50c999 into oxen-io:master Aug 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants