Cairo Contracts Versions Save

OpenZeppelin Contracts written in Cairo for Starknet, a decentralized ZK Rollup

v0.13.0

3 weeks ago

Summary

Added

  • Sending transactions section in account docs (#981)
  • before_update and after_update hooks to ERC721Component (#978)
  • before_update and after_update hooks to ERC1155Component (#982)

Changed (Breaking)

  • ERC721Component internal implementation to support transfer, mint, and burn flows going through an _update function (#978)
  • ERC721Component implementations now require an ERC721HooksTrait implementation in scope (#978)
  • ERC1155Component implementations now require an ERC1155HooksTrait implementation in scope (#982)
  • AccountComponent, preset, and dispatcher now require a signature param in the public-key-setter functions (#989)
  • EthAccountComponent, preset, and dispatcher now require a signature param in the public-key-setter functions (#990)

Full Changes List

New Contributors

Full Changelog: https://github.com/OpenZeppelin/cairo-contracts/compare/v0.12.0...v0.13.0

v0.12.0

1 month ago

Summary

Added

  • before_update and after_update hooks to ERC20Component (#951)
  • INSUFFICIENT_BALANCE and INSUFFICIENT_ALLOWANCE errors to ERC20Component (#951)
  • ERC20Votes component (#951)
  • Preset interfaces (#964)
  • UDC docs (#954)
  • Util functions to precompute addresses (#954)

Changed

  • Allow testing utilities to be importable (#963)
  • Utilities documentation (#963)
  • Parameter name in tests::utils::drop_events (count -> n_events) (#963)
  • Presets to include upgradeable functionality (#964)
  • ERC20, ERC721, and ERC1155 presets include Ownable functionality (#964)
  • EthAccount
    • Expected signature format changed from (r, s, y) to (r, s) (#940)

Full Changes List

Full Changelog: https://github.com/OpenZeppelin/cairo-contracts/compare/v0.11.0...v0.12.0

v0.11.0

2 months ago

Summary

Added

  • SNIP12 utilities for on-chain typed messages hash generation (#935)
  • Nonces component utility (#935)
  • Presets Usage guide (#949)
  • UDC preset contract (#919)
  • ERC1155Component and ERC1155ReceiverComponent mixins (#941)
  • ERC721ReceiverComponent documentation (#945)

Changed

  • Bump scarb to v2.6.3 (#946)

Fixed

  • ERC721ReceiverComponent mixin embeddable implementation name (#945)

Removed

  • DualCase SRC5 (#882, #952)

Full Changes List

New Contributors

Full Changelog: https://github.com/OpenZeppelin/cairo-contracts/compare/v0.10.0...v0.11.0

v0.10.0

3 months ago

Summary

Added

  • ERC1155 component and preset (#896)
  • Mixin implementations in components (#863)
  • ERC721Component functions and Storage member
    • InternalTrait::_set_base_uri and InternalTrait::_base_uri to handle ByteArrays (#857)
    • ERC721_base_uri Storage member to store the base URI (#857)

Changed

  • Change unwrap to unwrap_syscall (#901)
  • ERC20Component
    • IERC20::name and IERC20::symbol return ByteArrays instead of felts (#857)
  • ERC721Component
    • IERC721::name, IERC721::symbol, and IERC721Metadata::token_uri return ByteArrays instead of felts (#857)
    • InternalTrait::initializer accepts an additional base_uri ByteArray parameter (#857)
    • IERC721Metadata SRC5 interface ID. This is changed because of the ByteArray integration (#857)

Removed

  • ERC721Component function and Storage member
    • InternalTrait::_set_token_uri because individual token URIs are no longer stored (#857)
    • ERC721_token_uri Storage member because individual token URIs are no longer stored (#857)

Full changes list

New Contributors

Full Changelog: https://github.com/OpenZeppelin/cairo-contracts/compare/v0.9.0...v0.10.0

v0.9.0

4 months ago

Summary

Added

  • EthAccount component and preset (#853)
  • Ownable two-step functionality (#809)

Changed

  • Bump scarb to v2.5.3 (#898)
  • OwnershipTransferred event args are indexed (#809)

Removed

  • Non standard increase_allowance and decrease_allowance functions in ERC20 contract (#881)

Full changes list

New Contributors

Full Changelog: https://github.com/OpenZeppelin/cairo-contracts/compare/v0.8.1...v0.9.0

v0.8.1

4 months ago

Summary

Added

  • Documentation for SRC5 migration (#821)
  • Usage docs (#823)
  • Utilities documentation (#825)
  • Documentation for presets (#832)
  • Backwards compatibility notice (#861)

Changed

  • Use ComponentState in tests (#836)
  • Docsite navbar (#838)
  • Support higher tx versions in Account (#858)
  • Bump scarb to v2.4.1 (#858)
  • Add security section to Upgrades docs (#861)

Full changes list

New Contributors

Full Changelog: https://github.com/OpenZeppelin/cairo-contracts/compare/v0.8.0...v0.8.1

v0.8.0

4 months ago

What's Changed

Added

Migrated to Component

Changed

New Contributors

Full Changelog: https://github.com/OpenZeppelin/cairo-contracts/compare/v0.7.0...v0.8.0

v0.8.0-beta.1

4 months ago

This beta release introduces the ERC20Votes extension and preset along with some of its dependencies such as Votes, Nonces, Checkpoints, EIP712, StorageArray, as well as introducing before/after hooks to ERC20.

v0.8.0-beta.0

4 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/OpenZeppelin/cairo-contracts/compare/v0.7.0...v0.8.0-beta.0

v0.7.0

4 months ago

This is the very first release of the OpenZeppelin Contracts for Cairo 1+, and the result of ~10 months of very hard work.

It’s been a long way, and now the end of the transition feels near. A new stage of maturity is ahead 🌺🚀.

Usage

Install the library as a scarb dependency:

[dependencies]
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.7.0" }

It requires scarb 0.7.0 and supports Cairo 2.2.0.

What has changed?

Most things! This is a brand new library written in a new language with a new type system. It exposes a new API and usage model (no more extensibility pattern), which will be continually improved.

The feature set is pretty much the same as previous versions with few notable differences:

  • ERC1155 and UniversalDeployer (UDC) are still in development
  • no EthAccount library (yet)
  • almost no presets like ERC20Upgradeable, ERC721Mintable, etc. (yet)
  • upgrades are now based on the replace_class syscall

This library also:

  • uses SRC5 instead of ERC165 for contract introspection
  • follows the great interface migration plan implementing dual interfaces (snake and camel case ones), while also providing dual-case dispatchers to interface with contracts implementing either standard
  • is distributed as a scarb package

What’s in it?

This release candidate includes a revamped docsite along with the following modules:

  • Account
  • Upgrades
  • Introspection module (SRC5)
  • Dual interface ABI dispatchers
  • Tokens
    • ERC20
    • ERC721
  • Access
    • AccessControl
    • Ownable
  • Security
    • Pausable
    • Initializable
    • Reentrancy guard

Acknowledgements

by @martriay

The main heroes of this story are @ericnordelo and @andrew-fleming. Over 10 months of relentless work, design, discussions, reviews back and forth, hitting the wall many times with the tooling, language, bugs, missing features. None of that stopped them. And here's the result, for the entire ecosystem to build and enjoy. Thank you.

Also thank you very much to our community of contributors, with special mention for recent contributions to @milancermak who contributed not only code but also ideas, @Amxx, @frangio, @maciektr and the scarb team, and @Bal7hazar. This is thanks to you too.