feat(vault): add remove_address to revoke a single allowlisted depositor - #1336
Open
Manta-Byte wants to merge 1 commit into
Open
Manta-Byte wants to merge 1 commit into
Manta-Byte wants to merge 1 commit into
Conversation
…tor (CalloraOrg#1109) Owner-only remove_address removes one entry, leaves the rest intact, is idempotent when absent, and emits allowlist_remove with version, caller and depositor topics.
|
@Manta-Byte 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! 🚀 |
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.
Closes #1109
Summary
Adds
remove_address(caller, depositor)to the vault so a single compromised depositor can be revoked without clearing the whole allowlist and re-adding everyone else.Criteria → code and tests
remove_addressinlib.rsremoves only the matching entryremove_address_keeps_other_entries_and_they_can_depositCallerNotInAllowliston next depositremoved_address_cannot_depositUnauthorizedrequire_auth+ owner check, same pattern asadd_address/clear_allnon_owner_remove_address_returns_unauthorizedallowlist_removeevent with caller and depositor topicsevent_allowlist_removeinevents.rs, published as(allowlist_remove, callora_v1, caller, depositor)remove_address_emits_allowlist_remove_event_with_correct_topics,test_event_allowlist_remove_bytesDesign and failure modes
Ok(()), changes no state and emits no event. Retries are safe, and events only reflect real state changes. Documented in the function's doc comment. Test:remove_address_not_in_list_is_idempotent_and_emits_no_event.remove_then_re_add_works).docs/EVENT_TOPICS.mdnow listsallowlist_remove(topic 47), with totals and the vault filter list updated.scripts/check-event-shape.shpasses locally.Files changed
contracts/vault/src/lib.rs:remove_addressand test module declarationcontracts/vault/src/events.rs:event_allowlist_removeand snapshot testcontracts/vault/src/test_allowlist_remove.rs: new testsdocs/EVENT_TOPICS.md: topic documentationValidation
cargo test -p callora-vault allowlist