Skip to content

Comments

feat: Renounce admin function#137

Merged
Akshola00 merged 1 commit intoWeb3Novalabs:mainfrom
anonfedora:feat/renouce_admin_function
Feb 21, 2026
Merged

feat: Renounce admin function#137
Akshola00 merged 1 commit intoWeb3Novalabs:mainfrom
anonfedora:feat/renouce_admin_function

Conversation

@anonfedora
Copy link
Contributor

Add renounce_admin Function to Crowdfunding Contract

Summary

Implements an irreversible admin renouncement mechanism, allowing the current admin to permanently relinquish control of the crowdfunding contract.

Changes

Closes #79

New functionality (renounce_admin) — the admin can now permanently remove themselves from the contract. Once renounced, all admin-gated actions (e.g. pause/unpause) become inaccessible, as the contract enters a NotInitialized state for admin lookups.

Event emission — a new admin_renounced event is emitted on successful renouncement, enabling off-chain listeners to react to the change in contract governance.

Interface updaterenounce_admin is added to the CrowdfundingTrait interface, making it part of the public contract API.

Minor refactor — replaced an explicit .unwrap_or(PoolMetrics::new()) with .unwrap_or_default() for cleaner idiom.

Test Coverage

A dedicated renounce_admin_test.rs module covers:

  • Successful renouncement and subsequent loss of admin privileges
  • Double-renouncement returning NotInitialized
  • Auth enforcement (non-admin callers cannot invoke the function)

Notes

  • This action is irreversible — there is no mechanism to reassign admin after renouncement. Callers should be certain before invoking.
  • Any integrations relying on admin availability should handle NotInitialized errors gracefully post-renouncement.

@Akshola00
Copy link
Contributor

thanks for your contribution my boss

@Akshola00 Akshola00 merged commit 133b653 into Web3Novalabs:main Feb 21, 2026
1 check 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.

[FUNCTION] implement renounce_admin

2 participants