Skip to content

feat(circle): add update_config for mutable parameters before activation - #191

Open
wealth4ever123 wants to merge 1 commit into
cocor-tech:masterfrom
wealth4ever123:fix/166-circle-update-config
Open

feat(circle): add update_config for mutable parameters before activation#191
wealth4ever123 wants to merge 1 commit into
cocor-tech:masterfrom
wealth4ever123:fix/166-circle-update-config

Conversation

@wealth4ever123

Copy link
Copy Markdown
Contributor

Summary

  • Once a Circle was initialized, none of its configuration (contribution_amount, max_members, contribution_deadline_seconds, etc.) could be corrected — the only recourse was deploying an entirely new contract and re-onboarding every member.
  • Adds an admin-only update_config(admin, new_config) that lets the stored admin update: contribution_amount, max_members, payout_type, total_rounds, contribution_deadline_seconds, min_moi_score, collateral_amount, penalty_bps, grace_period_seconds, max_strikes.
  • Restricted to circles still in STATUS_PENDING (i.e. before the circle has filled up and started), so it can't disrupt in-flight rounds or existing members' accounting. max_members also can't be dropped below the number of members who've already joined.
  • Validates the same invariants deploy_circle/init already enforce (max_members >= 2, contribution_amount > 0, total_rounds > 0, payout_type <= 3).

Also included

Same as #164 (submitted alongside this): fixes the pre-existing Ok()Ok(()) compile error present in 14 other functions in packages/circle/src/contract.rs, which otherwise leaves the whole circle package unable to build. Purely mechanical, no behavior change. (If #164 merges first, this hunk will already be resolved and this PR's diff will shrink to just the new function.)

Test plan

  • cargo check -p circle — compiles clean
  • cargo test -p circle — all existing tests pass

Closes #166

Once a Circle was initialized there was no way to correct a misconfigured
parameter (contribution_amount, max_members, contribution_deadline_seconds,
etc.) short of deploying an entirely new contract and re-onboarding every
member.

Add an admin-only update_config(admin, new_config) that lets the stored
admin adjust contribution_amount, max_members, payout_type, total_rounds,
contribution_deadline_seconds, min_moi_score, collateral_amount,
penalty_bps, grace_period_seconds and max_strikes. Restricted to circles
still in STATUS_PENDING (before the circle has filled and started) so
in-flight rounds and existing members' accounting can't be disrupted,
and max_members can't be dropped below the members already joined.

Also fixes the same pre-existing `Ok()` vs `Ok(())` compile error
described in cocor-tech#164 (14 functions in this file), which otherwise leaves
the circle package unable to build.

Closes cocor-tech#166
@drips-wave

drips-wave Bot commented Jul 31, 2026

Copy link
Copy Markdown

@wealth4ever123 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@oraimoitel

Copy link
Copy Markdown
Contributor

@wealth4ever123
resolve conflicts

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.

feat(circle): add update_config function for mutable parameters after deployment

2 participants