feat(ephemeral_account): recover, upgrade authority, simulate_sweep#214
Merged
phertyameen merged 40 commits intoJun 29, 2026
Merged
Conversation
…Initialization fix(sweep-controller): store creator address during initialization
…erification fix: Implement real Ed25519 signature verification in verify_sweep_authorization()
…ansfers feat: Implement token transfers in SweepController
Integrate-wasm-opt-into-the-build-pip
GitHub-Actions-workflow-contract-build-and-test
implemented the optimize
…pt-into-the-build-pipeline Integrate-wasm-opt-into-the-build-pip
…nto GitHub-Actions-workflow-contract-build-and-test
…orkflow-contract-build-and-test GitHub actions workflow contract build and test
implemented the mutil batch account
auto-deploy-contracts-to-testnet
test: add ephemeral account unit coverage
Experiment: add pre-authorized gas-free claim flow
…eSweepExecution Testnet Deployment Script bridgelet-org#73
…nto auto-deploy-contracts-to-testnet
…racts-to-testnet auto-deploy-contracts-to-testnet
…org#109, bridgelet-org#122 Issue bridgelet-org#107 — recover(): auth-gated recovery sweep callable only by creator or recovery_address after account expiry. Issue bridgelet-org#109 — upgrade(): admin-restricted WASM upgrade via update_current_contract_wasm(); admin stored at initialize() time. Issue bridgelet-org#122 — simulate_sweep(): view function that returns expected Payment vec and an error_code (0 = ok) without executing on-chain. Supporting changes: - initialize() accepts new parameter - errors.rs: add NotUpgradeAdmin (15) - storage.rs: add Admin DataKey + get/set_admin helpers - test.rs: update all initialize() calls to 5 args; add tests for recover/upgrade/simulate_sweep; add NotUpgradeAdmin to error enum test Issue bridgelet-org#114 (double-init prevention) was already fully implemented.
|
@JudeDaniel6 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! 🚀 |
phertyameen
approved these changes
Jun 29, 2026
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.
Summary
Resolves all open issues assigned to JudeDaniel6 in a single PR.
Closes #107 — Recovery sweep for expired accounts
Added
recover(env, caller)function:is_expired()is truerequire_auth)recovery_address, emittingAccountExpiredeventError::NotExpired/Error::Unauthorized/Error::InvalidStatusas appropriateCloses #109 — Contract upgrade authority
Added
upgrade(env, new_wasm_hash)function:DataKey::Adminslot duringinitialize()env.deployer().update_current_contract_wasm()Error::NotUpgradeAdmin(error code 15) for non-admin callersinitialize()gains a new requiredadmin: AddressparameterCloses #114 — Prevent double-initialization (already implemented)
The guard (
storage::is_initializedcheck +Error::AlreadyInitialized) and its test (test_double_initialize_is_rejected) were already present. No code changes needed; closing via this PR.Closes #122 — Dry-run sweep simulation endpoint
Added
simulate_sweep(env, destination) -> (Vec<Payment>, u32)view function:Paymentlist that would be transferred and an error code (0= success)NotInitialized,AlreadySwept,NoPaymentReceived,AccountExpiredas numeric codesFiles changed
errors.rsNotUpgradeAdmin = 15storage.rsDataKey::Admin,set_admin,get_adminlib.rsinitializesignature; addrecover,upgrade,simulate_sweeptest.rsinitializecall-sites to 5 args; add 8 new testsTesting
All existing tests updated for the new
initializesignature. New tests added:test_recover_succeeds_for_creator_after_expirytest_recover_succeeds_for_recovery_address_after_expirytest_recover_returns_not_expired_before_expirytest_recover_returns_unauthorized_for_strangertest_upgrade_returns_not_upgrade_admin_for_non_admintest_simulate_sweep_returns_payments_on_happy_pathtest_simulate_sweep_returns_error_when_no_paymenttest_simulate_sweep_returns_error_when_expired