feat(circle): add update_config for mutable parameters before activation - #191
Open
wealth4ever123 wants to merge 1 commit into
Open
feat(circle): add update_config for mutable parameters before activation#191wealth4ever123 wants to merge 1 commit into
wealth4ever123 wants to merge 1 commit into
Conversation
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
|
@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! 🚀 |
Contributor
|
@wealth4ever123 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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.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.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_membersalso can't be dropped below the number of members who've already joined.deploy_circle/initalready 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 inpackages/circle/src/contract.rs, which otherwise leaves the wholecirclepackage 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 cleancargo test -p circle— all existing tests passCloses #166