Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
immrsd committed Dec 13, 2024
2 parents e2e361d + f7fdf6c commit c774c9e
Show file tree
Hide file tree
Showing 211 changed files with 4,808 additions and 2,285 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ jobs:
with:
starknet-foundry-version: ${{ env.FOUNDRY_VERSION }}

- name: Install cairo-coverage
run: curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh
# Issue with cairo-coverage. Re-add to CI once issues are fixed.
#
# - name: Install cairo-coverage
# run: curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh

- name: Markdown lint
uses: DavidAnson/markdownlint-cli2-action@eb5ca3ab411449c66620fe7f1b3c9e10547144b0 # v16
Expand All @@ -47,11 +49,21 @@ jobs:
- name: Cairo lint
run: scarb fmt --check --workspace

<<<<<<< HEAD

Check failure on line 52 in .github/workflows/test.yml

View workflow job for this annotation

GitHub Actions / lint

could not parse as YAML: yaml: line 52: could not find expected ':'
- name: Run tests and generate coverage report
run: snforge test --workspace --coverage --features fuzzing --fuzzer-runs 10000
=======
- name: Run tests
run: snforge test --workspace
>>>>>>> main

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.lcov
token: ${{ secrets.CODECOV_TOKEN }}
# Issue with cairo-coverage. Re-add to CI once issues are fixed.
#
# - name: Run tests and generate coverage report
# run: snforge test --workspace --coverage
#
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v4
# with:
# file: ./coverage.lcov
# token: ${{ secrets.CODECOV_TOKEN }}
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## 0.20.0 (2024-12-06)

### Added

- SRC9 (Outside Execution) integration to account presets (#1201)
Expand All @@ -30,13 +32,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed (Breaking)

- Bump snforge_std to v0.34.0 (#1239)
- Bump scarb to v2.9.1 (#1239)
- The initializer in `OwnableComponent` now checks that `owner` is not the zero address (#1221)
- Add `verifying_contract` member to the `Delegation` struct used in Votes `delegate_by_sig` (#1214)
use crate::votes::VotesComponent::VotingUnitsTrait;
- VotingUnitsTrait moved from `openzeppelin_governance::votes::votes` to `openzeppelin_governance::votes::VotesComponent` (#1214)
- VestingComponent `release` function won't emit an event or attempt to transfer when the amount is zero (#1209)
- Bump snforge_std to v0.33.0 (#1203)

### Fixed

- Scarb manifest dependencies (#1249):
- Move `openzeppelin_utils` from dev dep to dep in governance manifest
- Remove `openzeppelin_utils` as dep in access package
- Change `openzeppelin_account` to `crate` in `src9.cairo`

## 0.19.0 (2024-11-08)

### Added
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ Edit `scarb.toml` and add:

```toml
[dependencies]
openzeppelin = "0.20.0-rc.0"
openzeppelin = "0.20.0"
```

The previous example would import the entire library. We can also add each package as a separate dependency to improve the building time by not including modules that won't be used:

```toml
[dependencies]
openzeppelin_token = "0.20.0-rc.0"
openzeppelin_token = "0.20.0"
```

Build the project to download it:
Expand Down
38 changes: 19 additions & 19 deletions Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version = 1

[[package]]
name = "openzeppelin"
version = "0.20.0-rc.0"
version = "0.20.0"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
Expand All @@ -23,18 +23,17 @@ dependencies = [

[[package]]
name = "openzeppelin_access"
version = "0.20.0-rc.0"
version = "0.20.0"
dependencies = [
"openzeppelin_introspection",
"openzeppelin_test_common",
"openzeppelin_testing",
"openzeppelin_utils",
"snforge_std",
]

[[package]]
name = "openzeppelin_account"
version = "0.20.0-rc.0"
version = "0.20.0"
dependencies = [
"openzeppelin_introspection",
"openzeppelin_test_common",
Expand All @@ -45,18 +44,19 @@ dependencies = [

[[package]]
name = "openzeppelin_finance"
version = "0.20.0-rc.0"
version = "0.20.0"
dependencies = [
"openzeppelin_access",
"openzeppelin_test_common",
"openzeppelin_testing",
"openzeppelin_token",
"openzeppelin_utils",
"snforge_std",
]

[[package]]
name = "openzeppelin_governance"
version = "0.20.0-rc.0"
version = "0.20.0"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
Expand All @@ -70,22 +70,22 @@ dependencies = [

[[package]]
name = "openzeppelin_introspection"
version = "0.20.0-rc.0"
version = "0.20.0"
dependencies = [
"openzeppelin_test_common",
"snforge_std",
]

[[package]]
name = "openzeppelin_merkle_tree"
version = "0.20.0-rc.0"
version = "0.20.0"
dependencies = [
"snforge_std",
]

[[package]]
name = "openzeppelin_presets"
version = "0.20.0-rc.0"
version = "0.20.0"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
Expand All @@ -101,7 +101,7 @@ dependencies = [

[[package]]
name = "openzeppelin_security"
version = "0.20.0-rc.0"
version = "0.20.0"
dependencies = [
"openzeppelin_test_common",
"openzeppelin_testing",
Expand All @@ -110,7 +110,7 @@ dependencies = [

[[package]]
name = "openzeppelin_test_common"
version = "0.20.0-rc.0"
version = "0.20.0"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
Expand All @@ -127,14 +127,14 @@ dependencies = [

[[package]]
name = "openzeppelin_testing"
version = "0.20.0-rc.0"
version = "0.20.0"
dependencies = [
"snforge_std",
]

[[package]]
name = "openzeppelin_token"
version = "0.20.0-rc.0"
version = "0.20.0"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
Expand All @@ -147,7 +147,7 @@ dependencies = [

[[package]]
name = "openzeppelin_upgrades"
version = "0.20.0-rc.0"
version = "0.20.0"
dependencies = [
"openzeppelin_test_common",
"openzeppelin_testing",
Expand All @@ -156,7 +156,7 @@ dependencies = [

[[package]]
name = "openzeppelin_utils"
version = "0.20.0-rc.0"
version = "0.20.0"
dependencies = [
"openzeppelin_test_common",
"openzeppelin_testing",
Expand All @@ -165,15 +165,15 @@ dependencies = [

[[package]]
name = "snforge_scarb_plugin"
version = "0.33.0"
version = "0.34.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:b4dd6088372decd367652827091e0589bbf6bc550dfc3957baa3e9c61d6eb449"
checksum = "sha256:56f2b06ff2f0d8bbdfb7fb6c211fba7e4da6e5334ea70ba849af329a739faf11"

[[package]]
name = "snforge_std"
version = "0.33.0"
version = "0.34.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:f7dc3349f8a6ef4915c93df447a00bd5a53a31129fd0990a00afa0ad31d91b06"
checksum = "sha256:bd20964bde07e6fd0f7adb50d41216f05d66abd422ed82241030369333385876"
dependencies = [
"snforge_scarb_plugin",
]
13 changes: 7 additions & 6 deletions Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ name = "openzeppelin"
readme = "README.md"
version.workspace = true
keywords.workspace = true
edition.workspace = true

[workspace.package]
version = "0.20.0-rc.0"
version = "0.20.0"
edition = "2024_07"
cairo-version = "2.8.5"
scarb-version = "2.8.5"
cairo-version = "2.9.1"
scarb-version = "2.9.1"
authors = ["OpenZeppelin Community <[email protected]>"]
description = "OpenZeppelin Contracts written in Cairo for Starknet, a decentralized ZK Rollup"
documentation = "https://docs.openzeppelin.com/contracts-cairo"
Expand All @@ -40,9 +41,9 @@ keywords = [
]

[workspace.dependencies]
assert_macros = "2.8.5"
starknet = "2.8.5"
snforge_std = "0.33.0"
assert_macros = "2.9.1"
starknet = "2.9.1"
snforge_std = "0.34.0"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion docs/antora.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: contracts-cairo
title: Contracts for Cairo
version: 0.20.0-rc.0
version: 0.20.0
nav:
- modules/ROOT/nav.adoc
asciidoc:
Expand Down
7 changes: 5 additions & 2 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
** xref:finance.adoc[Finance]
*** xref:/api/finance.adoc[API Reference]
** xref:governance.adoc[Governance]
** Governance
*** xref:/governance/governor.adoc[Governor]
*** xref:/governance/timelock.adoc[Timelock Controller]
*** xref:/governance/votes.adoc[Votes]
*** xref:/api/governance.adoc[API Reference]
** xref:introspection.adoc[Introspection]
Expand All @@ -33,7 +36,7 @@
*** xref:/api/security.adoc[API Reference]

** Tokens
*** xref:erc20.adoc[ERC20]
*** xref:/erc20.adoc[ERC20]
**** xref:/guides/erc20-supply.adoc[Creating Supply]
**** xref:/guides/erc20-permit.adoc[ERC20Permit]
**** xref:/api/erc20.adoc[API Reference]
Expand Down
6 changes: 3 additions & 3 deletions docs/modules/ROOT/pages/api/access.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ assigned each to multiple accounts.

[.contract]
[[OwnableComponent]]
=== `++OwnableComponent++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0-rc.0/packages/access/src/ownable/ownable.cairo[{github-icon},role=heading-link]
=== `++OwnableComponent++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0/packages/access/src/ownable/ownable.cairo[{github-icon},role=heading-link]

```cairo
use openzeppelin_access::ownable::OwnableComponent;
Expand Down Expand Up @@ -260,7 +260,7 @@ Emitted when the ownership is transferred.

[.contract]
[[IAccessControl]]
=== `++IAccessControl++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0-rc.0/packages/access/src/accesscontrol/interface.cairo[{github-icon},role=heading-link]
=== `++IAccessControl++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0/packages/access/src/accesscontrol/interface.cairo[{github-icon},role=heading-link]

:grant_role: xref:#IAccessControl-grant_role[grant_role]
:revoke_role: xref:#IAccessControl-revoke_role[revoke_role]
Expand Down Expand Up @@ -393,7 +393,7 @@ Emitted when `account` is revoked `role`.

[.contract]
[[AccessControlComponent]]
=== `++AccessControlComponent++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0-rc.0/packages/access/src/accesscontrol/accesscontrol.cairo[{github-icon},role=heading-link]
=== `++AccessControlComponent++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0/packages/access/src/accesscontrol/accesscontrol.cairo[{github-icon},role=heading-link]

:assert_only_role: xref:#AccessControlComponent-assert_only_role
:grant_role: xref:#AccessControlComponent-grant_role[grant_role]
Expand Down
14 changes: 7 additions & 7 deletions docs/modules/ROOT/pages/api/account.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include::../utils/_common.adoc[]

[.contract]
[[ISRC6]]
=== `++ISRC6++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0-rc.0/packages/account/src/interface.cairo[{github-icon},role=heading-link]
=== `++ISRC6++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0/packages/account/src/interface.cairo[{github-icon},role=heading-link]

```cairo
use openzeppelin_account::interface::ISRC6;
Expand Down Expand Up @@ -67,7 +67,7 @@ Returns the short string `'VALID'` if valid, otherwise it reverts.

[.contract]
[[AccountComponent]]
=== `++AccountComponent++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0-rc.0/packages/account/src/account.cairo[{github-icon},role=heading-link]
=== `++AccountComponent++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0/packages/account/src/account.cairo[{github-icon},role=heading-link]

:OwnerAdded: xref:AccountComponent-OwnerAdded[OwnerAdded]
:OwnerRemoved: xref:AccountComponent-OwnerRemoved[OwnerRemoved]
Expand Down Expand Up @@ -317,7 +317,7 @@ Emitted when a `public_key` is removed.

[.contract]
[[EthAccountComponent]]
=== `++EthAccountComponent++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0-rc.0/packages/account/src/eth_account.cairo[{github-icon},role=heading-link]
=== `++EthAccountComponent++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0/packages/account/src/eth_account.cairo[{github-icon},role=heading-link]

:OwnerAdded: xref:EthAccountComponent-OwnerAdded[OwnerAdded]
:OwnerRemoved: xref:EthAccountComponent-OwnerRemoved[OwnerRemoved]
Expand Down Expand Up @@ -572,7 +572,7 @@ Emitted when a `public_key` is removed.

[.contract]
[[ISRC9_V2]]
=== `++ISRC9_V2++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0-rc.0/packages/account/src/extensions/src9/interface.cairo[{github-icon},role=heading-link]
=== `++ISRC9_V2++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0/packages/account/src/extensions/src9/interface.cairo[{github-icon},role=heading-link]

```cairo
use openzeppelin_account::extensions::src9::ISRC9_V2;
Expand Down Expand Up @@ -622,7 +622,7 @@ Get the status of a given nonce. `true` if the nonce is available to use.

[.contract]
[[SRC9Component]]
=== `++SRC9Component++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0-rc.0/packages/account/src/extensions/src9/src9.cairo[{github-icon},role=heading-link]
=== `++SRC9Component++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0/packages/account/src/extensions/src9/src9.cairo[{github-icon},role=heading-link]

```cairo
use openzeppelin_account::extensions::SRC9Component;
Expand Down Expand Up @@ -698,7 +698,7 @@ Initializes the account by registering the `ISRC9_V2` interface ID.

[.contract]
[[AccountUpgradeable]]
=== `++AccountUpgradeable++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0-rc.0/packages/presets/src/account.cairo[{github-icon},role=heading-link]
=== `++AccountUpgradeable++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0/packages/presets/src/account.cairo[{github-icon},role=heading-link]

```cairo
use openzeppelin_presets::AccountUpgradeable;
Expand Down Expand Up @@ -762,7 +762,7 @@ Requirements:

[.contract]
[[EthAccountUpgradeable]]
=== `++EthAccountUpgradeable++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0-rc.0/packages/presets/src/eth_account.cairo[{github-icon},role=heading-link]
=== `++EthAccountUpgradeable++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.20.0/packages/presets/src/eth_account.cairo[{github-icon},role=heading-link]

```cairo
use openzeppelin_presets::EthAccountUpgradeable;
Expand Down
Loading

0 comments on commit c774c9e

Please sign in to comment.