Releases: OpenZeppelin/contracts-sui
Releases · OpenZeppelin/contracts-sui
v1.1.0-rc.0
Summary
openzeppelin_fp_math
Added
UD30x9fixed-point type with: (#129)- Core:
wrap,unwrap - Arithmetic:
add,sub,mul,div,pow,unchecked_add,unchecked_sub,mod - Comparison:
eq,neq,gt,gte,lt,lte,is_zero - Bitwise:
and,and2,or,xor,not,lshift,rshift
- Core:
SD29x9fixed-point type with: (#129)- Constants:
zero,min,max - Core:
wrap,unwrap - Arithmetic:
add,sub,mul,div,pow,unchecked_add,unchecked_sub,mod - Comparison:
eq,neq,gt,gte,lt,lte,is_zero - Bitwise:
and,and2,or,xor,not,lshift,rshift
- Constants:
casting_u128helpers forUD30x9andSD29x9. (#129)
openzeppelin_math
Added
is_power_of_tenhelpers foru8,u16,u32,u64,u128, andu256. (#125)
Full Changes List
- Backport v1.0.0.rc.1 changes by @ericnordelo in #128
- feat: add
is_power_of_tenfunction and tests by @Rajesh-Royal in #125 - docs: add CHANGELOGs by @ericnordelo in #127
- Add
ud30x9,sd29x9, and base functions by @ericnordelo in #129 - Update CHANGELOG and READMEs by @ericnordelo in #130
- ref: improve casting usage example by @ericnordelo in #131
- feat: implement
abs,ceil,divby @immrsd in #132 - feat: add quick_sort and quick_sort_by implementations by @qalisander in #133
- chore: update CODEOWNERS by @bidzyyys in #152
- feat: implement
negateby @immrsd in #160 - fix: tabWidth issue in Prettier Move + gitignore .vscode by @0xNeshi in #170
- Fixed-point:
mul,div,powby @immrsd in #199 - fix: inconsistent shift behavior in fixed-point math library by @bidzyyys in #201
- fix: unchecked_sub(x, zero) in SD29x9 aborts unexpectedly by @bidzyyys in #200
- docs: improve fixed-point docs by @immrsd in #202
- Fix: SD29x9 overflow behaviour by @immrsd in #203
- Fix: implement cross-type casting by @immrsd in #204
- Backport release v1.0.0 to main by @ericnordelo in #211
- docs: unify code docs for fixed-point math lib by @bidzyyys in #213
- Backport v1.0.0 delayed fix by @ericnordelo in #247
- ref: tests for fixed-point package by @immrsd in #248
- (v1.1.0-rc.0) Update CHANGELOG by @ericnordelo in #249
New Contributors
- @Rajesh-Royal made their first contribution in #125
- @qalisander made their first contribution in #133
Full Changelog: v1.0.0...v1.1.0-rc.0
v1.0.0
Summary
openzeppelin_access
Added
- Add missing event emissions on state changes (#159)
two_step_transfer::request_borrow_valandrequest_return_valfor borrowing the wrapper and its inner object during a pending transfer.two_step_transfer::RequestBorrowhot potato to guarantee wrapper return afterrequest_borrow_val.
Changed (Breaking)
- Redesigned
two_step_transferfrom a requester-initiated to an owner-initiated flow using sharedPendingOwnershipTransferand TTO.request,transfer, andrejectreplaced byinitiate_transfer,accept_transfer, andcancel_transfer.
- Renamed
two_step_transferevents:OwnershipRequested→TransferInitiated,OwnershipTransferred→TransferAccepted,OwnershipTransferRejected→TransferCancelled. - All events in
two_step_transferanddelayed_transfernow carryphantom Tfor type-specific indexing. two_step_transfer::unwrapnow accepts an additional&mut TxContextparam (#159)delayed_transfer::wrapnow takes an explicitrecipientand transfers the wrapper to that address instead of returningDelayedTransferWrapper<T>.delayed_transfer::schedule_transferandschedule_unwrapnow derivecurrent_ownerfromctx.sender()instead of accepting it as a parameter (#174)- Emit dedicated
UnwrapExecutedevent ondelayed_transfer::unwrapinstead ofOwnershipTransferred(#168)
openzeppelin_math
Fixed
- Preserve the remainder for
u512::div_rem_u256even when the quotient overflows, preventing incorrect results inmul_modfor large operands (#151)
Full Changes List
- fix(H-01): reminder issue in div_rem by @ericnordelo in #151
- fix(N-01): Missing Event Emission on State Change by @0xNeshi in #159
- fix: use &mut TxContext in two_step_transfer::unwrap by @0xNeshi in #169
- build(ci): trigger CI jobs on release branches by @bidzyyys in #173
- ci: triggers no longer apply to v* branches by @0xNeshi in #176
- fix(L-01): inaccurate data emitted in events by @bidzyyys in #174
- fix(L-02): Emit Dedicated UnwrapExecuted Event on delayed > unwrap by @0xNeshi in #168
- fix(N-08): unhandled overflow in safe_downcast_balance by @bidzyyys in #172
- fix(N-09): multiple calls to macro params by @immrsd in #161
- fix(N-10): unnecessary option destruction by @immrsd in #162
- fix(N-06): Incorrect Documentation by @ericnordelo in #187
- fix(N-03): code convention improvements by @immrsd in #163
- docs(N-04): add missing docs + fix existing docs by @0xNeshi in #175
- fix(N-05): Code and Documentation Inconsistencies by @ericnordelo in #188
- ref: Two Step Transfer (and Delayed) improvements by @ericnordelo in #183
- Add v1.0.0 release info by @ericnordelo in #210
Full Changelog: v1.0.0-rc.1...v1.0.0
v1.0.0-rc.1
Summary
openzeppelin_math
Changed
- Rename
coin_utilsmodule todecimal_scaling(#123)
All Packages
Fixed
- Add
#[test_only]attribute to test modules (#122)
Full Changes List
New Contributors
Full Changelog: v1.0.0-rc.0...v1.0.0-rc.1
v1.0.0-rc.0
Summary
openzeppelin_math
Added
rounding::RoundingModeenum plus helpers for expressing Down/Up/Nearest behavior reused across all arithmetic APIs.- public
u8,u16,u32,u64,u128, andu256modules exposing averaged computations, checked shifting, configurablemul_divandmul_shr, logarithms, square roots, and modular math helpers tailored to each bit width. u512wide integer type that supports splitting, multiplication, and division helpers to safely handle 512-bit intermediates needed by the narrow modules.coin_utilshelpers that upcast or downcast balances between decimal domains (up to 24 decimals) with overflow checks and explicit truncation semantics.
openzeppelin_access
Added
two_step_transfermodule that wraps akey + storecapability behind a request/approve flow.delayed_transfermodule that enforces configurable, clock-based delays before transferring or unwrapping a capability.
Full Changes List
- chore: update CODEOWNERS by @bidzyyys in #10
mul_divimplementation and coverage by @ericnordelo in #31- docs: add initial documentation and guidelines by @bidzyyys in #35
- docs: add security warning by @bidzyyys in #37
- build: add CI jobs by @bidzyyys in #34
averageimplementation and coverage by @ericnordelo in #32checked_shrimplementation and coverage by @ericnordelo in #33checked_shlimplementation and coverage by @ericnordelo in #36- Fix shift operations return values by @ericnordelo in #42
mul_shrimplementation and coverage by @ericnordelo in #40clzimplementation and tests by @immrsd in #43log2implementation and tests by @immrsd in #46- ref: improve
div_remperformance by @ericnordelo in #44 log256implementation and tests by @immrsd in #48- feat:
msbimplementation and tests by @immrsd in #52 - feat:
sqrtimplementation and tests by @immrsd in #53 - feat:
inv_modimplementation and coverage by @ericnordelo in #50 - feat: add safe cast u256 <> u64 for bridge operations by @bidzyyys in #49
- ref: ownership transfer wrappers by @ericnordelo in #47
log10implementation and tests by @immrsd in #104- Rounding improvements for
log2andlog256by @immrsd in #106 Optionreturn type formul_divby @immrsd in #105
New Contributors
- @bidzyyys made their first contribution in #10
- @ericnordelo made their first contribution in #31
- @immrsd made their first contribution in #43
Full Changelog: https://github.com/OpenZeppelin/contracts-sui/commits/v1.0.0-rc.0