Releases: OpenZeppelin/rust-contracts-stylus
Releases · OpenZeppelin/rust-contracts-stylus
v0.3.0
Added
- UUPS Proxy:
UUPSUpgradeablecontract andIErc1822Proxiabletrait for user-controlled upgradeable proxies. - Beacon Proxy:
BeaconProxycontract andIBeaconinterface, supporting the beacon proxy pattern for upgradeable contracts. - Upgradeable Beacon:
UpgradeableBeaconcontract, allowing upgradeable beacon-based proxies with owner-controlled implementation upgrades. - Enumerable Sets: Generic
EnumerableSettype with implementations forAddress,B256,U8,U16,U32,U64,U128,U256. - Token Receivers:
IErc1155ReceiverandIErc721Receivertraits with correspondingErc1155HolderandErc721Holdercontracts. - Access Control Extensions:
AccessControlEnumerableextension that supports role member enumeration. - Enhanced SafeERC20: Additional methods including
try_safe_transfer,try_safe_transfer_from, and relaxed call variants. - Cryptography: EDDSA (Ed25519) signature scheme, Twisted-Edwards Curves, and enhanced elliptic curve configurations (secp256k1, Baby Jubjub, Bandersnatch, Curve25519, Jubjub).
- Precompiles: Enhanced
Precompilestrait withp256_verifywrapper function for ergonomic precompile invocation. - Type Conversions: Bidirectional conversions between
ruint::Uintand crypto libraryUinttypes, plus conversions betweenUintand primitive integer types.
Changed
- Type Aliases: Standardized
FixedBytes<4>toB32,FixedBytes<32>toB256, andStorageFixedBytes<32>toStorageB256. - API Simplifications: Simplified Pedersen hash API to accept any type implementing
Into<P::BaseField>. - Interface Compliance: Removed redundant interface ID checks in
Erc1155Supply.
Changed (Breaking)
- Interface Naming: Renamed Solidity interfaces for consistency (
IERC721Receiver→IErc721ReceiverInterface,IERC1155Receiver→IErc1155ReceiverInterface). - Trait Bounds: Added
IErc721Receivertrait bound toIErc721Wrappertrait. - Error Handling: Replaced associated error types with raw byte output (
Vec<u8>) in receiver traits for ABI compliance. - Deref Removal: Removed
Derefimplementations for extension contracts to improve API clarity. - API Simplifications: Prefix
ct_removed for constant functions atopenzeppelin-crypto.
Full Changelog: v0.2.0...v0.3.0.
v0.3.0-rc.1
Summary
Added
- Add UUPS Proxy:
UUPSUpgradeablecontract andIErc1822Proxiabletrait. #752 - Add
EnumerableSetgeneric type. #733 - Add
EnumerableSetimplementation for:Address,B256,U8,U16,U32,U64,U128,U256. #733 - Add
IErc1155Receivertrait. #747 - Add
Erc1155Holdercontract. #747 - Add
IErc721Receivertrait. #743 - Add
Erc721Holdercontract. #743 - Add
Precompiles::p256_verifywrapper function. #754 - The
Precompiles::ec_recoveris now callable on&self. #754 - The
ecdsa::recoverfunction now acceptsimpl StaticCallContextinstead of&mut impl TopLevelStorage. #754 SafeErc20now implements:try_safe_transfer,try_safe_transfer_from,transfer_and_call_relaxed,transfer_from_and_call_relaxedandapprove_and_call_relaxed. #765- Add bidirectional conversions between
ruint::Uintand crypto libraryUinttypes behindruintfeature toggle. #758 - Add bidirectional conversions between
Uintandu8,u16,u32,u64,u128types. #764 - Add EDDSA (Ed25519) signature scheme. #757
Changed (Breaking)
- Remove initial
EnumerableAddressSetimplementation. #733 - Rename
IERC721ReceiverSolidity Interface toIErc721ReceiverInterface. #743 - Change
RECEIVER_FN_SELECTORtype toFixedBytes<4>. #743 - Rename
IERC1155ReceiverSolidity Interface toIErc1155ReceiverInterface. #747 - Change
Erc1155ReceiverconstantsSINGLE_TRANSFER_FN_SELECTORandBATCH_TRANSFER_FN_SELECTORto typeB32. #747 - Change
Erc721ReceiverconstantRECEIVER_FN_SELECTORto typeB32. #747 - Rename
Precompiles::ecrecoverwrapper function toPrecompiles::ec_recover. #754 - Replace associated error type with
Vec<u8>inIErc1155ReceiverandIErc721Receivertraits. #770 - Add
IErc721Receivertrait bound to theIErc721Wrappertrait. #770
Changed
- Rename
FixedBytes<4>toB32andFixedBytes<32>toB256andStorageFixedBytes<32>toStorageB256. #747 - Replace
SafeErc20::encodes_truewithBool::abi_decodeinSafeErc20when decoding the bytes result. #754 - Simplify Pedersen hash API to accept any type that implements
Into<P::BaseField>. #758
Fixed
- Fix
export-abibug forreentrantfeature. #753
Full Changes List
- feat: add
Erc721Holdercontract by @bidzyyys in #743. - feat: add
Erc1155Holdercontract + use type aliases forFixedBytes<N>by @bidzyyys in #747. - fix:
export-abibug for reentrant feature by @bidzyyys in #753. - ref: Replace
SafeErc20::encodes_truewithBool::abi_decodeinSafeErc20when decoding the bytes result by @0xNeshi in #754. - feat:
secp256r1precompile wrapper by @0xNeshi in #755. - feat:
EnumerableSetTrait and Implementations by @davebryson & @qalisander in #733. - feat: implement conversions
ruint::Uint<->openzeppelin_crypto::Uintby @bidzyyys & @qalisander in #758. - feat: UUPS Proxy by @bidzyyys in #752.
- feat: update
SafeErc20to match the new Solidity version of the Contract by @0xNeshi in #765. - feat: add
Erc1155Holder&Erc721Holderexamples by @bidzyyys in #770. - feat: conversion between
Uintand primitive integers by @qalisander in #764. - feat: Ed25519 signature (EDDSA) by @qalisander in #757.
Full Changelog: v0.3.0-alpha.1...v0.3.0-rc.1
v0.3.0-alpha.1
Summary
Added
- Add
BeaconProxycontract andIBeaconinterface, supporting the beacon proxy pattern for upgradeable contracts. #729 - Add
UpgradeableBeaconcontract, allowing upgradeable beacon-based proxies with owner-controlled implementation upgrades. #729 - Add Solidity interface bindings for beacon-related contracts. #729
- Add internal utilities for interacting with beacon proxies and validating beacon implementations. #729
- Add
AccessControlEnumerableextension that supports role member enumeration. #622 - Add
EnumerableAddressSet. #622 - Add Twisted-Edwards Curves. #633
- Add Elliptic Curve Configurations: secp256k1, Baby Jubjub, Bandersnatch, Curve25519, Jubjub. #738
- Add
Precompilestrait for ergonomic precompile invocation. #689
Changed (Breaking)
- Bump cargo-stylus to
v0.6.1. #726 - Remove implementation of
Deref<Target = Erc1155>forErc1155Supply,Deref<Target = Erc721>forErc721Consecutive, andDeref<Target = Ownable>forOwnable2Step. #724 - Adjust
PedersenParamstrait to support bothSWCurveConfig&TECurveConfig. #738 - Move Starknet Curve configuration to a dedicated instance module. #738
Changed
- Remove redundant interface ID check from
Erc1155Supply::supports_interface. #725
Full Changes List
- feat: add
AccessControlEnumerableextension by @klingonaston & @bidzyyys in #622. - build: simplify
stylus-sdkdep. declaration by @0xNeshi in #682. - docs: fix typo in the documentation of in
IErc20::approveby @onurinanc in #692. - ref: remove
Dereftrait implementation by @bidzyyys in #724. - ref: small changes + warning fixes by @0xNeshi in #725.
- build: cargo-stylus
v0.6.1by @bidzyyys in #726. - build: bump
motsutov0.10.0by @0xNeshi in #737. - feat: twisted edwards curves by @qalisander in #633.
- feat: add more curves for Pedersen Hash by @bidzyyys in #738.
- feat: add
Precompilestrait by @0xNeshi in #689. - docs: improve README and Antora docs by @bidzyyys in #740.
- feat: add Proxy-UUPS by @0xNeshi & @bidzyyys in #729.
Full Changelog: v0.2.0...v0.3.0-alpha.1
v0.2.0
Added
- ERC-1155 token (
Erc1155,Burnable,MetadataUri,Supply,UriStorage). - ERC-4626 “Tokenized Vault Standard” and ERC-20 Flash Mint extension.
- ERC-2981 on-chain royalties.
- ERC-20 Utils:
SafeErc20. - Finance:
VestingWallet. - Ownership:
Ownable2Step. - Token wrappers:
Erc20Wrapper,Erc721Wrapper. - Cryptography: Poseidon2 hash, Pedersen hash (Starknet params), Short-Weierstrass Curves.
- Math & utils: optimised
Uint<_>big-integer ops (mul_div, shift-left/right, checked/unchecked add/sub). - Constructors now supported across all contracts.
- All events derive
Debug; contracts implementMethodErrorandIErc165.
Changed
- Keccak constants pre-computed at compile-time.
- Optimisations across contracts and crypto libraries.
Changed (Breaking)
- Stylus SDK ↑ to v0.9.0 (
cargo-stylus↑ to v0.6.0) - Contracts refactored to new inheritance model.
- Interface IDs now returned by
fn interface_id();IErc165::supports_interfacetakes&self;Erc165struct removed. - Public state fields made private.
- Feature
stdremoved from libraries.
Fixed
- Correct ERC-165 IDs for
IErc721Metadata,IErc721Enumerable, etc. #[interface_id]macro now propagates super-traits correctly.- Edge-cases in Merkle proofs, big-int overflows and re-entrancy bugs resolved.
Full Changelog: v0.1.2...v0.2.0.
v0.2.0-rc.0
Summary
Added
- Contracts now support constructors. #639
- Add Pedersen hash with Starknet parameters. #644
- Add shift left, right operators to Uint. #644
Erc721Wrapperextension to support token wrapping. #461- Add callable interface for ERC-721. #461
- Add missing functions to callable ERC-20 interface. #461
- All events now derive
Debug. #614 Erc20Wrapperextension to support token wrapping. #498Erc20events deriveDebug. #498- Implement
MethodErrorfor all contracts' errors. #594 - Implement
IErc165for all base contracts for standard interface detection. #603 - Expose interface ID for
Erc20Wrapper,Erc4626andErc20FlashMint. #603 - Short Weierstrass elliptic curves primitives. #589
Changed
Changed (Breaking)
- Bump Stylus SDK to
v0.9.0. #639 - Convert associated
const INTERFACE_IDinto an associatedfn interface_id()on all traits. #639 IErc165::supports_interfacenow accepts&selfas first parameter. #639- Removed
Erc165struct. #639 - Contracts now use the new Stylus SDK inheritance model. #639
- Moved
Erc20callable interface to /erc20/interface.rs module and renamed it toErc20Interface. #461 - Bump
cargo-stylustov0.5.11. #617 - Bump Stylus SDK to
v0.8.4. #624 - Remove
ownable_two_step::Errorwrapper inOwnable2Step, and emitownable::Errordirectly. #594 - Poseidon babybear and goldilocks (64-bit) instances now have 256-bit security (capacity 4). #613
BitIteratorBE(bit iteration) trait atopenzeppelin_cryptonow acceptsselfby value. #589- Feature
stdwas removed from libraries. #662
Fixed
- The
#[interface_id]attribute now correctly copies supertraits. #651 IErc721Metadata::interface_id()now has the correct value.
Full Changes List
Full Changelog: v0.2.0-alpha.4...v0.2.0-rc.0
v0.1.2
v0.2.0-alpha.4
Summary
Added
Erc2981contract. #508- Implement
Deref<Target = Erc1155>forErc1155SupplyandDeref<Target = Erc721>forErc721Consecutive. #569 - Implement
Deref<Target = Ownable>forOwnable2Step. #552
Changed (Breaking)
- Refactor
Erc20Permitextension to be a composition ofErc20andNoncescontracts. #574 - Replace
VestingWallet::receive_etherwith dedicatedreceivefunction. #529 - Extract
IAccessControltrait fromAccessControlcontract. #527 - Bump Stylus SDK to v0.8.1 #587
Fixed
IErc165implementations forErc721MetadataandErc721Enumerablenow support ERC-165 interface ID. #570- Handle missing leaves for non-trivial merkle trees. #578
Full Changes List
- build(deps): bump crate-ci/typos from 1.29.4 to 1.29.5 by @dependabot in #521
- docs: make Rust docs consistent by @DarkLord017 in #497
- docs: normalize struct docs by @emrhncvsgl in #507
- test: Investigate Fuzzing by @0xNeshi in #477
- ref: make all proptests stand-alone + replace prop_assume calls with helper fn by @0xNeshi in #526
- build: bump nitro-testnode by @bidzyyys in #531
- refactor(test): migrate unit tests to the new motsu layout by @qalisander in #423
- refactor: extract IAccessControl trait from AccessControl by @Dhanraj30 in #527
- ref: privatize and rename state fields by @0xNeshi in #500
- build(deps): bump crate-ci/typos from 1.29.5 to 1.29.7 by @dependabot in #551
- feat: implement Deref for Erc20Permit and Ownable2Step by @0xNeshi in #552
- build(deps): bump crate-ci/typos from 1.29.7 to 1.29.8 by @dependabot in #564
- feat: Implement
Deref<Target = Erc1155>forErc1155SupplyandDeref<Target = Erc721>forErc721Consecutiveby @0xNeshi in #569 - build(deps): bump crate-ci/typos from 1.29.8 to 1.29.9 by @dependabot in #567
- ref: use dedicated receive fn in VestingWallet by @iamjaeholee in #529
- build(deps): bump crate-ci/typos from 1.29.9 to 1.29.10 by @dependabot in #577
- fix: clippy warning in AccessControl by @bidzyyys in #581
- fix: Debug proof consistency test by @0xNeshi in #578
- feat: Implement Missing
IErc165Overrides by @0xNeshi in #570 - ref: new design of Erc20Permit extension by @bidzyyys in #574
- feat: ERC2981 contract by @18aaddy in #508
- build(deps): bump crate-ci/typos from 1.29.10 to 1.30.0 by @dependabot in #583
- build(deps): bump crate-ci/typos from 1.30.0 to 1.30.1 by @dependabot in #586
- build: bump Stylus SDK to v0.8 (no use of vm() api) by @qalisander in #587
- build: bump to v0.2.0-alpha.4 by @0xNeshi in #590
- feat: reimplement erc165 for erc20 by @0xNeshi in #591
Full Changelog: v0.2.0-alpha.3...v0.2.0-alpha.4
v0.2.0-alpha.3
Summary
Added
- Optimised implementation of bigintegers
Uint<_>for finite fields. #495 Erc4626"Tokenized Vault Standard". #465- Implement
mul_divforU256. #465 - Implement
AddAssignCheckedforStorageUint. #474 Erc20FlashMintextension. #407
Changed
- Keccak constants
PERMIT_TYPEHASHinErc20Permit, andTYPE_HASHinErc712are now statically computed. #478 - Use
AddAssignCheckedinVestingWallet,Erc1155Supply,Erc1155,Erc20,Nonces. #474 - Use
AddAssignUncheckedandSubAssignUncheckedinerc20::_update. #467
Changed (Breaking)
- Bump cargo-stylus to v0.5.8. #493
- Constants
TYPE_HASH,FIELDS,SALTandTYPED_DATA_PREFIX, and typeDomainSeparatorTupleare no longer exported fromutils::cryptography::eip712. #478 - Bump Stylus SDK to v0.7.0. #433
- Bump
alloydependencies to v0.8.14. #433 - Add full support for reentrancy (changed
VestingWalletsignature for some functions). #407 Nonce::use_noncepanics on exceedingU256::MAX. #467
Full Changes List
- Remove motsu from the repo and just import from crates.io by @ggonzalez94 in #456
- build(deps): bump crate-ci/typos from 1.28.2 to 1.28.4 by @dependabot in #460
- ref: Add/Sub Assignment Operations + e2e-tests.sh by @0xNeshi in #467
- feat: add ERC20FlashMint extension by @Ifechukwudaniel in #407
- build(deps): bump crate-ci/typos from 1.28.4 to 1.29.4 by @dependabot in #475
- feat: implement trait AddAssignChecked for StorageUint by @bidzyyys in #474
- docs: add README for openzeppelin-stylus-proc by @0xNeshi in #471
- build: bump Stylus SDK to v0.7.0 and alloy to v0.8.14 by @bidzyyys in #433
- feat: stylus poseidon hash benchmark against solidity by @qalisander in #463
- ref: Revamp e2e's error-checking mechanism by @0xNeshi in #479
- ref: Use Static Keccak Calculation Instead of Magic Values by @0xNeshi in #478
- test: change Panic error's arg name to 'code' by @0xNeshi in #485
- build: bump cargo-stylus to v0.5.7 by @bidzyyys in #484
- docs: use fixed versions in solidity docs URLs by @0xNeshi in #486
- test: add missing E2E tests for Erc721 by @DarkLord017 in #489
- ref: Remove
randDev Dependency from ./contracts/* by @0xNeshi in #490 - build: cargo stylus v0.5.8 by @bidzyyys in #493
- Update LICENSE by @ericglau in #496
- ref: improve Erc1155Receiver and Erc721Receiver by @Ifechukwudaniel in #509
- feat: ERC-4626 extension by @Ifechukwudaniel in #465
- feat: Big Integer Implementation for Cryptographic Applications by @qalisander in #495
- build: bump to v0.2.0 alpha.3 by @0xNeshi in #512
Full Changelog: v0.2.0-alpha.2...v0.2.0-alpha.3
v0.2.0-alpha.2
Summary
Added
- Erc1155Supply extension. #418
- Erc1155Pausable extension. #432
- Erc1155UriStorage extension. #431
- VestingWallet contract. #402
- Erc1155Burnable extension. #417
- Erc1155MetadataUri extension. #416
- Poseidon2 sponge hash function. #388
Changed
- Update "magic values" to explicit calculations in
Erc721Metadata::supports_interfaceandErc721::_check_on_erc721_received. #442 - Implement
AddAssignUncheckedandSubAssignUncheckedforStorageUint. #418 - Implement
MethodErrorforsafe_erc20::Error. #402 - Use
function_selector!to calculate transfer type selector inErc1155. #417
Changed (Breaking)
- Update internal functions of
Erc721andErc721Consecutiveto accept a reference toBytes. #437
Full Changes List
- feat: add ERC1155Supply extension by @0xNeshi and @bidzyyys in #418
- feat: add ERC1155 Pausable Extension by @0xNeshi and @bidzyyys in #432
- feat: ERC1155 URIStorage Extension by @0xNeshi in #431
- feat: Add VestingWallet by @0xNeshi, @bidzyyys and @qalisander in #402
- feat: ERC1155Burnable extension by @0xNeshi, @bidzyyys and @qalisander in #417
- feat:
Erc1155MetadataUriextension @0xNeshi and @qalisander in #416 - feat: Poseidon2 sponge hash function by @qalisander and @bidzyyys in #388
Full Changelog: v0.2.0-alpha.1...v0.2.0-alpha.2
v0.2.0-alpha.1
Summary
Added
- ERC-1155 Multi Token Standard. #275
SafeErc20Utility. #289- Finite Fields arithmetics. #376
Ownable2Stepcontract. #352IOwnabletrait. #352
Changed(breaking)
- Removed
only_ownerfrom the public interface of Ownable. #352
Full Changes List
- feat: Ownable2Step by @ggonzalez94, and @bidzyyys in #352
- feat: ERC1155 by @programskillforverification, @bidzyyys, @qalisander, and @0xNeshi in #275
- feat: SafeErc20 utility by @0xNeshi, @bidzyyys and @qalisander in #289
- feat: finite fields by @qalisander in #376
- fix: contract caching for benchmarks by @qalisander in #387
Full Changelog: v0.1.1...v0.2.0-alpha.1