Repository navigation
Summary
openzeppelin_finance
Added
vesting_wallet: newVestingSchedule<W, P>type bundling a curve's schedule params with its witness, plus anew_scheduleconstructor andparamsaccessor. Lets a curve-agnostic consumer accept a witness-pinned schedule that keeps its witness and params type arguments coherent. (#489)vesting_wallet_linear:vesting_scheduleandvesting_schedule_continuousconstructors that validate and bundle a stepped/continuousParamsinto aVestingSchedule<Linear, Params>, plusinto_vesting_scheduleto wrap an already-builtParams. (#489)
openzeppelin_sale
Added
- new getter
max_sale_duration_ms. (#488) prefunded_sale::mint_quote_unversioned: a witness-gated quote constructor that opts out of freshness, for curves whose price is immune to sale-state changes (e.g.fixed_rate_curve); lets several quotes be minted and purchased in one PTB. (#499)prefunded_sale: the phase predicatesis_init,is_active,is_finalized, andis_cancelledare nowpublic(previously package-private), plus a newrefund_vault_idgetter returning the paired refund vault'sOption<ID>. (#504)prefunded_sale::refund_allbatch helper. (#507)
Changed (Breaking)
prefunded_sale:Quotes minted viamint_quoteare now freshness-enforced.mint_quotestamps the sale's newstate_version, everypurchaseadvances it, andpurchaseaborts with the newEStaleQuoteif an intervening same-PTB purchase advanced it since the quote was minted. Adds astate_versionfield toPrefundedSaleandminted_at_versiontoQuote. (#499)prefunded_sale::mint_quotenow takes a precomputedallocation: u64instead ofrate: u64; aborts if the curve-computed allocation is zero. (#487)- Moved the
allocation = paid * rateoverflow check (and theEAllocationOverflowerror) fromprefunded_saleintofixed_rate_curve, where the multiplication now lives. (#487) prefunded_sale:EAllocationOverflow(code13) is no longer emitted - itspaid * rateoverflow check moved tofixed_rate_curve- and its code is retired rather than reused;ERaisedOverflow,EHardCapExceeded, andEInsufficientInventoryAtActivatekeep their existing codes10/11/12. A newEZeroAllocationerror is appended at code42. (#487)prefunded_sale: renamedVestingScheduleParamsSet -> VestingScheduleSet, adding theVestingWitnesstype param; renamedset_vesting_schedule_params -> set_vesting_schedule, which now accepts theVestingSchedule<VestingWitness, VestingScheduleParams>parameter instead of justVestingScheduleParams; renamed gettervesting_schedule_params -> vesting_schedule. (#489)- set a maximum sale duration cap
prefunded_sale::create_sale, aborts withESaleDurationTooLong. (#488) prefunded_sale::SaleCreatedevent'sCurveParamstype parameter moved to the end, and addedCurvetype parameter. (#491)prefunded_sale: aligned every abort message and doc comment with the guard that raises it, splitting error codes that conflated two predicates.pair_refund_vault's wrong-cap check now raises a dedicatedEWrongVaultCap(distinct fromEWrongVault);cancel_after_close's window check raisesESaleNotClosed(distinct fromfinalize'sESaleWindowStillOpen); and the sharedESoftCapMetis replaced byESoftCapNotSetandESoftCapReached.EActivationAfterClose's message now reflects its inclusivenow >= closes_at_msguard. (#498)prefunded_sale: removed thephasegetter (which returned the internalPhasevalue); query the phase through theis_init/is_active/is_finalized/is_cancelledpredicates instead. (#504)prefunded_sale::mint_activation_ticketandfixed_rate_curve::activation_ticketnow abort withENotInitunless the sale is in theInitphase. (#505)prefunded_sale::depositno longer emitsInventoryDepositedon zero amount. (#508)refund_vault::release_balancenow rejects a zeroamount(EZeroRelease). (#508)refund_vault::withdraw_allno longer emitsVaultReleaseon zero amount. (#508)prefunded_sale::SaleCreatednow carries theadmin_cap_idof the admin cap minted alongside the sale, andrefund_vault::RefundVaultCreatednow carries thecap_idof the controller cap minted alongside the vault. (#511)prefunded_sale::SaleActivatednow carries therequired_inventorycomputed at activation. (#511)prefunded_sale:Purchased,Claimed, andRefundednow carrytotal_allocated_after(the sale's total allocated after the operation), andRefundedadditionally carriesallocation(the allocation released back to the unallocated pool by the refund). (#511)- Renamed events
VaultDeposit/VaultReleasetoVaultDeposited/VaultReleasedfor naming consistency. (#515)
Full Changes List
- fix(audit): audit fixes + examples by @0xNeshi in #487
- ci: ignore
differential_testsandquick_sort_random_is_sorted_and_preserves_elementsfrom tracing by @0xNeshi in #517 - audit: Token sale audit report by @0xNeshi in #518
- docs: bump referenced library version to v1.5.1 by @0xNeshi in #519
- docs: add maintenance status disclaimers to READMEs by @stevep0z in #520
- docs: add maintenance status disclaimer to collections + make all disclaimers into warnings by @0xNeshi in #521
- Update fixed point math published info by @ericnordelo in #522
New Contributors
Full Changelog: v1.5.0...v1.5.1