Skip to content

Releases: OpenZeppelin/rust-contracts-stylus

v0.3.0-rc.1

07 Aug 11:35
231d4f1
Compare
Choose a tag to compare
v0.3.0-rc.1 Pre-release
Pre-release

Summary

Added

  • Add UUPS Proxy: UUPSUpgradeable contract and IErc1822Proxiable 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 accepts impl 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 and approve_and_call_relaxed. #765
  • Add bidirectional conversions between ruint::Uint and crypto library Uint types behind ruint feature toggle. #758
  • Add bidirectional conversions between Uint and u8, u16, u32, u64, u128 types. #764
  • Add EDDSA (Ed25519) signature scheme. #757

Changed (Breaking)

  • Remove initial EnumerableAddressSet implementation. #733
  • Rename IERC721Receiver Solidity Interface to IErc721ReceiverInterface. #743
  • Change RECEIVER_FN_SELECTOR type to FixedBytes<4>. #743
  • Rename IERC1155Receiver Solidity Interface to IErc1155ReceiverInterface. #747
  • Change Erc1155Receiver constants SINGLE_TRANSFER_FN_SELECTOR and BATCH_TRANSFER_FN_SELECTOR to type B32. #747
  • Change Erc721Receiver constant RECEIVER_FN_SELECTOR to type B32. #747
  • Rename Precompiles::ecrecover wrapper function to Precompiles::ec_recover. #754
  • Replace associated error type with Vec<u8> in IErc1155Receiver and IErc721Receiver traits. #770
  • Add IErc721Receiver trait bound to the IErc721Wrapper trait. #770

Changed

  • Rename FixedBytes<4> to B32 and FixedBytes<32> to B256 and StorageFixedBytes<32> to StorageB256. #747
  • Replace SafeErc20::encodes_true with Bool::abi_decode in SafeErc20 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 for reentrant feature. #753

Full Changes List

  • feat: add Erc721Holder contract by @bidzyyys in #743.
  • feat: add Erc1155Holder contract + use type aliases for FixedBytes<N> by @bidzyyys in #747.
  • fix: export-abi bug for reentrant feature by @bidzyyys in #753.
  • ref: Replace SafeErc20::encodes_true with Bool::abi_decode in SafeErc20 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

21 Jul 16:17
ae0b7fa
Compare
Choose a tag to compare
v0.3.0-alpha.1 Pre-release
Pre-release

Summary

Added

  • Add BeaconProxy contract and IBeacon 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> for Erc1155Supply, Deref<Target = Erc721> for Erc721Consecutive, and Deref<Target = Ownable> for Ownable2Step. #724
  • Adjust PedersenParams trait to support both SWCurveConfig & 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

Full Changelog: v0.2.0...v0.3.0-alpha.1

v0.2.0

20 Jun 12:08
aa6f290
Compare
Choose a tag to compare

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 implement MethodError and IErc165.

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

22 May 15:12
5ed33dd
Compare
Choose a tag to compare
v0.2.0-rc.0 Pre-release
Pre-release

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. #498
  • Erc20 events derive Debug. #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 and Erc20FlashMint. #603
  • Short Weierstrass elliptic curves primitives. #589

Changed

  • Optimize Stylus SDK imports. #598
  • Updated the recommended way to inherit errors. #602

Changed (Breaking)

  • Bump Stylus SDK to v0.9.0. #639
  • Convert associated const INTERFACE_ID into an associated fn 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 to Erc20Interface. #461
  • Bump cargo-stylus to v0.5.11. #617
  • Bump Stylus SDK to v0.8.4. #624
  • Remove ownable_two_step::Error wrapper in Ownable2Step, and emit ownable::Error directly. #594
  • Poseidon babybear and goldilocks (64-bit) instances now have 256-bit security (capacity 4). #613
  • BitIteratorBE (bit iteration) trait at openzeppelin_crypto now accepts self 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

12 Apr 10:58
2471bbd
Compare
Choose a tag to compare

Summary

Breaking Change

  • build: in v0.1.1 bump sdk to 0.6.1. #628

Full Changelog: v0.1.1...v0.1.2

v0.2.0-alpha.4

06 Mar 13:51
97fd57b
Compare
Choose a tag to compare
v0.2.0-alpha.4 Pre-release
Pre-release

Summary

Added

  • Erc2981 contract. #508
  • Implement Deref<Target = Erc1155> for Erc1155Supply and Deref<Target = Erc721> for Erc721Consecutive. #569
  • Implement Deref<Target = Ownable> for Ownable2Step. #552

Changed (Breaking)

  • Refactor Erc20Permit extension to be a composition of Erc20 and Nonces contracts. #574
  • Replace VestingWallet::receive_ether with dedicated receive function. #529
  • Extract IAccessControl trait from AccessControl contract. #527
  • Bump Stylus SDK to v0.8.1 #587

Fixed

  • IErc165 implementations for Erc721Metadata and Erc721Enumerable 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> for Erc1155Supply and Deref<Target = Erc721> for Erc721Consecutive 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

30 Jan 19:51
43c73ce
Compare
Choose a tag to compare
v0.2.0-alpha.3 Pre-release
Pre-release

Summary

Added

  • Optimised implementation of bigintegers Uint<_> for finite fields. #495
  • Erc4626 "Tokenized Vault Standard". #465
  • Implement mul_div for U256. #465
  • Implement AddAssignChecked for StorageUint. #474
  • Erc20FlashMint extension. #407

Changed

  • Keccak constants PERMIT_TYPEHASH in Erc20Permit, and TYPE_HASH in Erc712 are now statically computed. #478
  • Use AddAssignChecked in VestingWallet, Erc1155Supply, Erc1155, Erc20, Nonces. #474
  • Use AddAssignUnchecked and SubAssignUnchecked in erc20::_update. #467

Changed (Breaking)

  • Bump cargo-stylus to v0.5.8. #493
  • Constants TYPE_HASH, FIELDS, SALT and TYPED_DATA_PREFIX, and type DomainSeparatorTuple are no longer exported from utils::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 exceeding U256::MAX. #467

Full Changes List

Full Changelog: v0.2.0-alpha.2...v0.2.0-alpha.3

v0.2.0-alpha.2

19 Dec 14:06
4de08e5
Compare
Choose a tag to compare
v0.2.0-alpha.2 Pre-release
Pre-release

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 and Erc721::_check_on_erc721_received. #442
  • Implement AddAssignUnchecked and SubAssignUnchecked for StorageUint. #418
  • Implement MethodError for safe_erc20::Error. #402
  • Use function_selector! to calculate transfer type selector in Erc1155. #417

Changed (Breaking)

  • Update internal functions of Erc721 and Erc721Consecutive to accept a reference to Bytes. #437

Full Changes List

Full Changelog: v0.2.0-alpha.1...v0.2.0-alpha.2

v0.2.0-alpha.1

15 Nov 01:09
28f3178
Compare
Choose a tag to compare
v0.2.0-alpha.1 Pre-release
Pre-release

Summary

Added

  • ERC-1155 Multi Token Standard. #275
  • SafeErc20 Utility. #289
  • Finite Fields arithmetics. #376
  • Ownable2Step contract. #352
  • IOwnable trait. #352

Changed(breaking)

  • Removed only_owner from the public interface of Ownable. #352

Full Changes List

Full Changelog: v0.1.1...v0.2.0-alpha.1

v0.1.1

28 Oct 19:20
1500735
Compare
Choose a tag to compare

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 and no_std projects to use the library. #373

Full Changes List

Full Changelog: v0.1.0...v0.1.1