Skip to content

Feat/issue 862 update holder cap - #865

Open
meem08 wants to merge 18 commits into
accesslayerorg:mainfrom
meem08:feat/issue-862-update-holder-cap
Open

meem08 wants to merge 18 commits into
accesslayerorg:mainfrom
meem08:feat/issue-862-update-holder-cap

Conversation

@meem08

@meem08 meem08 commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Testing

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace

Checklist

  • Linked issue or backlog item
  • Added or updated creator-keys unit/integration tests for every changed contract behavior, including failure paths for new or reachable ContractError variants
  • Ran cargo fmt --all -- --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace, or explained exactly why a command was not run
  • Reviewed persistent storage changes against docs/storage-key-invariants.md; any storage layout change includes a migration/backward-compatibility note
  • Confirmed event names, topic order, payload field order, and field meanings remain compatible with docs/contract-event-conventions.md, or documented the breaking change and versioning plan
  • Updated docs for any changed public contract interface, read-only method, event schema, storage behavior, fee logic, or deployment workflow
  • Scope stays limited to one contract concern and does not include unrelated formatting, lockfile, generated artifact, or dependency changes

meem08 and others added 12 commits August 31, 2026 13:32
…yerorg#831)

- Reworked DataKey to store Vec<Address> per creator (holder_registry)
- Added get_holder_registry view returning full list
- Derived has_ever_held and get_historical_holder_count from registry
- TTL bumped on every read and write (extend_key_ttl_to_full_window)
- Circuit breaker fix: read CIRCUIT_BREAKER_THRESHOLD from storage, default 30%
- Pre-existing formatting fixes to prelaunch_auction and staking_reward_claim tests
…yerorg#831)

- Reworked DataKey to store Vec<Address> per creator (holder_registry)
- Added get_holder_registry view returning full list
- Derived has_ever_held and get_historical_holder_count from registry
- TTL bumped on every read and write (extend_key_ttl_to_full_window)
- Circuit breaker fix: read CIRCUIT_BREAKER_THRESHOLD from storage, default 30%
- Pre-existing formatting fixes to prelaunch_auction, staking_reward_claim, events.rs, and test_staking_lifecycle.rs for cargo fmt compliance
Merging upstream/main into feat/holder-registry-831 left duplicate
FeeCollectedEvent/LockupBlockedEvent structs and FEE_COLLECTED_EVENT_NAME/
LOCKUP_BLOCKED_EVENT_NAME constants in events.rs, which failed to compile
(E0428, "defined multiple times") and broke CI. Keep the canonical copies.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
…merge

The merge with upstream main left duplicate definitions in lib.rs that
broke compilation (E0428): last_buy_timestamp x3 and holder_cap_bps x2
inside constants::storage, plus two conflicting top-level
credit_staking_rewards_pool fns. Keep the canonical StakingRewardsState
implementation and drop the stale bare-i128 variant and its reader.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
…y-831

Resolve conflicts with upstream main:
- events.rs: keep upstream auction events, drop duplicate fee event doc
- lib.rs: keep holder_registry alongside staking/auction DataKey variants;
  single circuit-breaker threshold read from storage
- test_issues_778_779_781_782.rs: use unwrapped client view results
- delete staking_reward_claim.rs (incompatible 2-arg API; superseded by
  test_staking_lifecycle.rs)
- fix clippy lint errors in holder_registry.rs tests

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
- Fix read_holder_registry to not call extend_ttl on missing storage key (prevents MissingValue panic at runtime)
- Update holder_registry integration tests to advance ledger between buy and sell (avoids FlashLoanDetected error accesslayerorg#55)

All tests pass: cargo test --workspace -p creator-keys
Format: cargo fmt --all -- --check
Clippy: cargo clippy --workspace -p creator-keys -- -D warnings
… tighten after launch (issue accesslayerorg#862)

- Add update_holder_cap function callable only by key creator
- Validate new_cap_bps between 100 (HOLDER_CAP_MIN_BPS) and current stored cap
- Panic with CapCannotIncrease if new_cap_bps exceeds current cap
- Panic with CapTooLow if new_cap_bps below 100
- Panic with Unauthorized if non-creator caller invokes
- Update holderCapBps in persistent storage with TTL bump
- Emit holder_cap_updated event with key_id, old_cap_bps, new_cap_bps

New error variants: CapCannotIncrease (70), CapTooLow (71), HolderCapNotSet (72)
New event: HolderCapUpdatedEvent with topics and data payload
Test coverage for all acceptance criteria
@drips-wave

drips-wave Bot commented Sep 24, 2026

Copy link
Copy Markdown

@meem08 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

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.

Add a configurable max wallet holding percentage that the creator can tighten after launch

1 participant