feat: implement timelocked emergency admin controls - #32
Merged
Divineifed1 merged 1 commit intoJul 19, 2026
Merged
Conversation
Contributor
Author
|
hey!!!! |
Closed
5 tasks
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.
Emergency Safety Mechanisms for Renaissance Vault
Summary
Adds timelocked admin operations and token recovery safety mechanisms to the Renaissance vault contract to handle platform bugs and accidental token transfers.
Changes
vault/src/lib.rsemergency_withdraw— 24-hour timelocked admin withdrawal. First call schedules the withdrawal (pending_until = now + 24h), second call after expiry executes the transfer. EmitsEmergencyActionevent with reason hash.cancel_emergency_withdraw— Allows admin to cancel a pending emergency withdrawal before execution.recover_token— Recovers accidentally sent tokens that are not tracked by the vault (i.e., have noVaultBalancedeposits/locks). EmitsEmergencyActionevent with reason hash.set_admin— 48-hour timelocked admin transfer. First call schedules the new admin (pending_until = now + 48h), second call after expiry completes the transfer. EmitsEmergencyActionevent with reason hash.cancel_set_admin— Allows current admin to cancel a pending admin transfer before expiry.vault/src/test.rstest_emergency_withdraw_schedule_and_execute— Simulates 24h timelock expiry and successful execution.test_emergency_withdraw_cancel— Verifies cancellation prevents execution after timelock expiry.test_set_admin_schedule_and_execute— Simulates 48h confirmation period and successful admin transfer.test_set_admin_cancel— Verifies pending admin transfer can be cancelled.test_recover_token— Verifies tracked tokens cannot be recovered, while untracked tokens can.Acceptance Criteria
emergency_withdrawhas 24-hour timelock (pending_until)recover_tokenonly works for tokens not owned by the contract's intended logicEmergencyActionevent with reason hashSecurity Considerations
EmergencyActionevents provide transparent on-chain audit trail.Closes #24