Releases: OpenZeppelin/rust-contracts-stylus
Releases · OpenZeppelin/rust-contracts-stylus
v0.3.0-rc.1
Summary
Added
- Add UUPS Proxy:
UUPSUpgradeable
contract andIErc1822Proxiable
trait. #752 - Add
EnumerableSet
generic type. #733 - Add
EnumerableSet
implementation for:Address
,B256
,U8
,U16
,U32
,U64
,U128
,U256
. #733 - Add
IErc1155Receiver
trait. #747 - Add
Erc1155Holder
contract. #747 - Add
IErc721Receiver
trait. #743 - Add
Erc721Holder
contract. #743 - Add
Precompiles::p256_verify
wrapper function. #754 - The
Precompiles::ec_recover
is now callable on&self
. #754 - The
ecdsa::recover
function now acceptsimpl StaticCallContext
instead of&mut impl TopLevelStorage
. #754 SafeErc20
now implements:try_safe_transfer
,try_safe_transfer_from
,transfer_and_call_relaxed
,transfer_from_and_call_relaxed
andapprove_and_call_relaxed
. #765- Add bidirectional conversions between
ruint::Uint
and crypto libraryUint
types behindruint
feature toggle. #758 - Add bidirectional conversions between
Uint
andu8
,u16
,u32
,u64
,u128
types. #764 - Add EDDSA (Ed25519) signature scheme. #757
Changed (Breaking)
- Remove initial
EnumerableAddressSet
implementation. #733 - Rename
IERC721Receiver
Solidity Interface toIErc721ReceiverInterface
. #743 - Change
RECEIVER_FN_SELECTOR
type toFixedBytes<4>
. #743 - Rename
IERC1155Receiver
Solidity Interface toIErc1155ReceiverInterface
. #747 - Change
Erc1155Receiver
constantsSINGLE_TRANSFER_FN_SELECTOR
andBATCH_TRANSFER_FN_SELECTOR
to typeB32
. #747 - Change
Erc721Receiver
constantRECEIVER_FN_SELECTOR
to typeB32
. #747 - Rename
Precompiles::ecrecover
wrapper function toPrecompiles::ec_recover
. #754 - Replace associated error type with
Vec<u8>
inIErc1155Receiver
andIErc721Receiver
traits. #770 - Add
IErc721Receiver
trait bound to theIErc721Wrapper
trait. #770
Changed
- Rename
FixedBytes<4>
toB32
andFixedBytes<32>
toB256
andStorageFixedBytes<32>
toStorageB256
. #747 - Replace
SafeErc20::encodes_true
withBool::abi_decode
inSafeErc20
when decoding the bytes result. #754 - Simplify Pedersen hash API to accept any type that implements
Into<P::BaseField>
. #758
Fixed
- Fix
export-abi
bug forreentrant
feature. #753
Full Changes List
- feat: add
Erc721Holder
contract by @bidzyyys in #743. - feat: add
Erc1155Holder
contract + use type aliases forFixedBytes<N>
by @bidzyyys in #747. - fix:
export-abi
bug for reentrant feature by @bidzyyys in #753. - ref: Replace
SafeErc20::encodes_true
withBool::abi_decode
inSafeErc20
when decoding the bytes result by @0xNeshi in #754. - feat:
secp256r1
precompile wrapper by @0xNeshi in #755. - feat:
EnumerableSet
Trait and Implementations by @davebryson & @qalisander in #733. - feat: implement conversions
ruint::Uint
<->openzeppelin_crypto::Uint
by @bidzyyys & @qalisander in #758. - feat: UUPS Proxy by @bidzyyys in #752.
- feat: update
SafeErc20
to match the new Solidity version of the Contract by @0xNeshi in #765. - feat: add
Erc1155Holder
&Erc721Holder
examples by @bidzyyys in #770. - feat: conversion between
Uint
and 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
BeaconProxy
contract andIBeacon
interface, supporting the beacon proxy pattern for upgradeable contracts. #729 - Add
UpgradeableBeacon
contract, 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
AccessControlEnumerable
extension 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
Precompiles
trait 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
PedersenParams
trait 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
AccessControlEnumerable
extension by @klingonaston & @bidzyyys in #622. - build: simplify
stylus-sdk
dep. declaration by @0xNeshi in #682. - docs: fix typo in the documentation of in
IErc20::approve
by @onurinanc in #692. - ref: remove
Deref
trait implementation by @bidzyyys in #724. - ref: small changes + warning fixes by @0xNeshi in #725.
- build: cargo-stylus
v0.6.1
by @bidzyyys in #726. - build: bump
motsu
tov0.10.0
by @0xNeshi in #737. - feat: twisted edwards curves by @qalisander in #633.
- feat: add more curves for Pedersen Hash by @bidzyyys in #738.
- feat: add
Precompiles
trait 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 implementMethodError
andIErc165
.
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_interface
takes&self
;Erc165
struct removed. - Public state fields made private.
- Feature
std
removed 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
Erc721Wrapper
extension 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 Erc20Wrapper
extension to support token wrapping. #498Erc20
events deriveDebug
. #498- Implement
MethodError
for all contracts' errors. #594 - Implement
IErc165
for all base contracts for standard interface detection. #603 - Expose interface ID for
Erc20Wrapper
,Erc4626
andErc20FlashMint
. #603 - Short Weierstrass elliptic curves primitives. #589
Changed
Changed (Breaking)
- Bump Stylus SDK to
v0.9.0
. #639 - Convert associated
const INTERFACE_ID
into an associatedfn interface_id()
on all traits. #639 IErc165::supports_interface
now accepts&self
as first parameter. #639- Removed
Erc165
struct. #639 - Contracts now use the new Stylus SDK inheritance model. #639
- Moved
Erc20
callable interface to /erc20/interface.rs module and renamed it toErc20Interface
. #461 - Bump
cargo-stylus
tov0.5.11
. #617 - Bump Stylus SDK to
v0.8.4
. #624 - Remove
ownable_two_step::Error
wrapper inOwnable2Step
, and emitownable::Error
directly. #594 - Poseidon babybear and goldilocks (64-bit) instances now have 256-bit security (capacity 4). #613
BitIteratorBE
(bit iteration) trait atopenzeppelin_crypto
now acceptsself
by value. #589- Feature
std
was 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
Erc2981
contract. #508- Implement
Deref<Target = Erc1155>
forErc1155Supply
andDeref<Target = Erc721>
forErc721Consecutive
. #569 - Implement
Deref<Target = Ownable>
forOwnable2Step
. #552
Changed (Breaking)
- Refactor
Erc20Permit
extension to be a composition ofErc20
andNonces
contracts. #574 - Replace
VestingWallet::receive_ether
with dedicatedreceive
function. #529 - Extract
IAccessControl
trait fromAccessControl
contract. #527 - Bump Stylus SDK to v0.8.1 #587
Fixed
IErc165
implementations forErc721Metadata
andErc721Enumerable
now 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>
forErc1155Supply
andDeref<Target = Erc721>
forErc721Consecutive
by @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
IErc165
Overrides 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_div
forU256
. #465 - Implement
AddAssignChecked
forStorageUint
. #474 Erc20FlashMint
extension. #407
Changed
- Keccak constants
PERMIT_TYPEHASH
inErc20Permit
, andTYPE_HASH
inErc712
are now statically computed. #478 - Use
AddAssignChecked
inVestingWallet
,Erc1155Supply
,Erc1155
,Erc20
,Nonces
. #474 - Use
AddAssignUnchecked
andSubAssignUnchecked
inerc20::_update
. #467
Changed (Breaking)
- Bump cargo-stylus to v0.5.8. #493
- Constants
TYPE_HASH
,FIELDS
,SALT
andTYPED_DATA_PREFIX
, and typeDomainSeparatorTuple
are no longer exported fromutils::cryptography::eip712
. #478 - Bump Stylus SDK to v0.7.0. #433
- Bump
alloy
dependencies to v0.8.14. #433 - Add full support for reentrancy (changed
VestingWallet
signature for some functions). #407 Nonce::use_nonce
panics 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
rand
Dev 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_interface
andErc721::_check_on_erc721_received
. #442 - Implement
AddAssignUnchecked
andSubAssignUnchecked
forStorageUint
. #418 - Implement
MethodError
forsafe_erc20::Error
. #402 - Use
function_selector!
to calculate transfer type selector inErc1155
. #417
Changed (Breaking)
- Update internal functions of
Erc721
andErc721Consecutive
to 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:
Erc1155MetadataUri
extension @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
SafeErc20
Utility. #289- Finite Fields arithmetics. #376
Ownable2Step
contract. #352IOwnable
trait. #352
Changed(breaking)
- Removed
only_owner
from 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
v0.1.1
Summary
Changed
- Mini alloc is now used by default via the stylus-sdk. This avoids conflicts with duplicate
#[global_allocator]
definitions. #373 - Removed the panic handler from the library, making it easier for
std
andno_std
projects to use the library. #373
Full Changes List
- fix: reference-types error on nightly version by @qalisander in #375
- fix: use mini-alloc by default and remove panic handler by @qalisander and @ggonzalez94 in #373
- build: bump v0.1.1 by @bidzyyys in #382
Full Changelog: v0.1.0...v0.1.1