Repository navigation
Conversation
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 #202 by reconstructing the
streamscontract from a non-compiling shell into a fully functional Soroban smart contract implementing linear token streaming, stepped milestones, and cliff vesting.Changes
contracttypemacro enum limitations by convertingSchedulevariants from named fields to tuple variants:Linear,LinearWithCliff(u64), andStepped(Vec<(u64, i128)>).validate_scheduleensuring strictly increasing milestone checkpoints up toMAX_CHECKPOINTS(64) bounded within[start, end]and terminating attotal.create_stream&create_stream_stepped: upfront token deposit pull withTransferShortfallbalance delta verification, preventing underfunded or fee-on-transfer shortfalls.withdraw: allows recipients to withdraw accrued vested tokens computed via deterministic time-based curve.cancel: funder or governance cancellation with exact pro-rata split (accrued balance paid to recipient, remainder refunded to funder).transfer: recipient reassigns stream ownership and unwithdrawn accruals to a new recipient.funding ops:top_up,extend_duration,increase_rate, andset_funding_delegaterebase the schedule via monotonic checkpoints so vested tokens never decrease.schema_version,migrate,migrate_batch: fully integrated schema migration guards.InitializedEvent,StreamCreatedEvent,WithdrawnEvent,StreamCanceledEvent, andStreamTransferredEventconforming toevents.json.cargo test -p zenith-streams), including unit tests, adversarial token tests, and proptests (prop_withdrawn_never_exceeds_deposit,prop_withdrawable_never_decreases,prop_vested_is_monotonic_across_funding_calls).cargo clippy -p zenith-streams --tests --no-deps -- -D warnings).Payout Wallet:
0xC345C07229307d4f1c7935aD2cAe48e390215808(Polygon / Base / Arbitrum / Stellar)