Skip to content

Feat/deployment access control#319

Merged
manoahLinks merged 3 commits into
crowdpass-live:mainfrom
Sage-senpai:feat/deployment-access-control
Apr 29, 2026
Merged

Feat/deployment access control#319
manoahLinks merged 3 commits into
crowdpass-live:mainfrom
Sage-senpai:feat/deployment-access-control

Conversation

@Sage-senpai
Copy link
Copy Markdown
Contributor

PR Description — feat/deployment-access-control
Description
Adds a role-based access control (RBAC) layer that gates who is allowed to deploy new CrowdPass child contracts (per-event ticket NFTs deployed via ticket_factory). The system is split into two pieces:

A new standalone DeployerRegistry contract holding the admin pointer, a per-address allowlist, and a two-step admin transfer flow.
An optional registry hook on ticket_factory::deploy_ticket that consults registry.is_authorized(minter) before invoking env.deployer() when a registry has been wired in via set_deployer_registry(Some(addr)). When no registry is configured the factory falls back to its historical admin-only model — fully backwards-compatible.
The branch carries two commits:

fix(contracts): restore event_manager and resolve SDK v25 build errors — the same prerequisite cherry-picked from the #203/#205 branches. origin/main doesn't compile because of a botched merge in event_manager plus residual SDK v22 → v25 migration debt; without this fix there's no buildable baseline to test #208 against.
feat(contracts): implement access control for contract deployment — the actual #208 work.
If you'd prefer one commit on merge, squash. If the build-fix lands first via a separate PR (e.g. via the #203 branch), this branch will rebase cleanly onto it.

Type of Change
Bug fix (behavioral)
New feature
Build fix (prerequisite — upstream main was broken before this PR)
Breaking change
Related Issues
Closes #208

Sage-senpai and others added 3 commits April 28, 2026 12:52
The workspace on `origin/main` does not currently compile: a botched
merge replaced `event_manager/src/lib.rs` with a 329-line MultiSig
fragment, and the SDK v22 -> v25 upgrade left several callers using
removed APIs.

- Restore event_manager/src/lib.rs from 097f857 (last-good post-SDK
  version) and add the PoapBadgeMetadata/PoapMintMetadata
  #[contracttype] defs that distribute_poaps references
- ticket_factory + tba_registry: deploy(wasm, args) -> deploy_v2(...)
- ticket_nft: clone Address before storage move so the subsequent
  events.publish still sees `from`/`to`/`owner`
- marketplace: import Symbol; handle the v25 Option return from
  Vec::get; cache recipients.len() before the move into RoyaltyConfig
- dao_governance: drop env.invoker() in favor of admin require_auth();
  cast usize -> u32 for Vec::remove; cast i128 -> u128 for the
  voting-power return type; stub total_supply() (removed in v25)
  returning 0 with a TODO

After this commit `cargo check --workspace` is green; storage
optimization for crowdpass-live#203 follows in a separate commit.
Adds a role-based access control system governing which addresses are
authorized to deploy new CrowdPass Soroban contract instances.

- DeployerRegistry contract with admin-managed allowlist
- Role enum covering Admin, Deployer, and Operator permissions
- require_auth() enforcement on all deployment paths
- Events emitted for deployer additions, removals, and deployments
- Admin transfer function with two-step confirmation pattern
- Comprehensive tests for all permission combinations

Closes crowdpass-live#208
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 29, 2026

@Sage-senpai 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

@manoahLinks manoahLinks merged commit bb90120 into crowdpass-live:main Apr 29, 2026
0 of 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.

Implement Access Control for Soroban Contract Deployment

2 participants