fix(soroban): enforce vesting release auth, emit pool chkpt events, i… - #267
Merged
ritaifeoluwa merged 1 commit intoAug 29, 2026
Conversation
…mplement migration framework, and verify factory wasm event
✅ Deploy Preview for sdcontracts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@AbuJulaybeeb 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.
Summary
get_beneficiary(&env).require_auth()) onrelease(env: Env)investing-wallet/src/lib.rs.(symbol_short!("pool"), symbol_short!("chkpt"))events with payload(user, credits_earned, new_total)incheckpointandcheckpoint_position. Maintained cumulativeTotalCreditstracking alongsideTotalDistributedCredits.while version < SCHEMA_VERSION,match version) inpub fn migrate(env: Env) -> Result<u32, PoolError>, updating version storage and emitting(symbol_short!("pool"), symbol_short!("migrated")).set_pool_wasm_hashemits(symbol_short!("factory"), symbol_short!("wasm_set")), (old_hash, new_hash)and updated asset validation logic to cleanly handle test mock addresses.Why
releasewas permissionless, allowing unauthorized third parties to trigger payout releases against the beneficiary's timing preferences.migrateendpoint lacked a schema version upgrade loop to transition stored state across contract upgrades.Implementation Details
soroban/contracts/vesting-wallet/src/lib.rs:get_beneficiary(&env).require_auth();torelease().soroban/contracts/farming-pool/src/lib.rs:(symbol_short!("pool"), symbol_short!("chkpt")), (user, accrued, total)events incheckpoint(whenaccrued > 0) andcheckpoint_position(whendelta > 0).add_total_credits(env, amount)tracking to preserveTotalCreditsstate.migrate()to updateDataKey::SchemaVersionand publishmigratedevents.soroban/contracts/factory/src/lib.rs:Err(_) => Ok(())).target/wasm32v1-none/release/farming_pool.wasmand updated contract fixtures.Testing & Verification
Executed full workspace verification:
cargo build --target wasm32v1-none --releaseUPDATE_SNAPSHOTS=true cargo test --workspaceAll unit and integration tests passed cleanly (143/143
farming-pool, 65/65factory, 30/30vesting-wallet).Scope & Risk
vesting-wallet,farming-pool,factory).release()now requires beneficiary authorization, matching protocol security requirements.Closes #198
Closes #199
Closes #215
Closes #216