Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump scarb to 2.8 #1120

Merged
merged 8 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Bump snforge to v0.27.0 (#1107)
- Bump scarb to v2.7.1 (#1025)
- Bump scarb to v2.8.0 (#1120)

### Changed (Breaking)

- Changed ABI suffix to Trait in dual case account and eth account modules (#1096).
- `DualCaseAccountABI` renamed to `DualCaseAccountTrait`
- `DualCaseEthAccountABI` renamed to `DualCaseEthAccountTrait`
- Bump scarb to v2.7.1 (#1025)

## 0.15.1 (2024-08-13)

Expand Down
6 changes: 3 additions & 3 deletions Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ version.workspace = true
[workspace.package]
version = "0.15.1"
edition = "2023_11"
cairo-version = "2.7.1"
scarb-version = "2.7.1"
cairo-version = "2.8.0"
scarb-version = "2.8.0"
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 @@ -39,7 +39,7 @@ keywords = [
]

[workspace.dependencies]
starknet = "2.7.1"
starknet = "2.8.0"
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.27.0" }

[dependencies]
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ before proceeding, and run the following command to check that the installation
----
$ scarb --version

scarb 2.7.1 (e288874ba 2024-08-13)
cairo: 2.7.1 (https://crates.io/crates/cairo-lang-compiler/2.7.1)
scarb 2.8.0 (09590f5fc 2024-08-27)
cairo: 2.8.0 (https://crates.io/crates/cairo-lang-compiler/2.8.0)
sierra: 1.6.0
----

Expand Down
2 changes: 1 addition & 1 deletion packages/access/src/accesscontrol/accesscontrol.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/// Roles are referred to by their `felt252` identifier.
#[starknet::component]
pub mod AccessControlComponent {
use openzeppelin_access::accesscontrol::interface;
use crate::accesscontrol::interface;
use openzeppelin_introspection::src5::SRC5Component::InternalImpl as SRC5InternalImpl;
use openzeppelin_introspection::src5::SRC5Component::SRC5Impl;
use openzeppelin_introspection::src5::SRC5Component;
Expand Down
4 changes: 2 additions & 2 deletions packages/access/src/ownable/ownable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#[starknet::component]
pub mod OwnableComponent {
use core::num::traits::Zero;
use openzeppelin_access::ownable::interface::IOwnableTwoStep;
use openzeppelin_access::ownable::interface;
use crate::ownable::interface::IOwnableTwoStep;
use crate::ownable::interface;
use starknet::ContractAddress;
use starknet::get_caller_address;

Expand Down
12 changes: 6 additions & 6 deletions packages/access/src/tests/mocks/accesscontrol_mocks.cairo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[starknet::contract]
pub(crate) mod DualCaseAccessControlMock {
use openzeppelin_access::accesscontrol::AccessControlComponent;
use openzeppelin_access::accesscontrol::DEFAULT_ADMIN_ROLE;
use crate::accesscontrol::AccessControlComponent;
use crate::accesscontrol::DEFAULT_ADMIN_ROLE;
use openzeppelin_introspection::src5::SRC5Component;
use starknet::ContractAddress;

Expand Down Expand Up @@ -40,8 +40,8 @@ pub(crate) mod DualCaseAccessControlMock {

#[starknet::contract]
pub(crate) mod SnakeAccessControlMock {
use openzeppelin_access::accesscontrol::AccessControlComponent;
use openzeppelin_access::accesscontrol::DEFAULT_ADMIN_ROLE;
use crate::accesscontrol::AccessControlComponent;
use crate::accesscontrol::DEFAULT_ADMIN_ROLE;
use openzeppelin_introspection::src5::SRC5Component;
use starknet::ContractAddress;

Expand Down Expand Up @@ -84,8 +84,8 @@ pub(crate) mod SnakeAccessControlMock {

#[starknet::contract]
pub(crate) mod CamelAccessControlMock {
use openzeppelin_access::accesscontrol::AccessControlComponent;
use openzeppelin_access::accesscontrol::DEFAULT_ADMIN_ROLE;
use crate::accesscontrol::AccessControlComponent;
use crate::accesscontrol::DEFAULT_ADMIN_ROLE;
use openzeppelin_introspection::src5::SRC5Component;
use starknet::ContractAddress;

Expand Down
8 changes: 4 additions & 4 deletions packages/access/src/tests/mocks/ownable_mocks.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[starknet::contract]
pub(crate) mod DualCaseOwnableMock {
use openzeppelin_access::ownable::OwnableComponent;
use crate::ownable::OwnableComponent;
use starknet::ContractAddress;

component!(path: OwnableComponent, storage: ownable, event: OwnableEvent);
Expand Down Expand Up @@ -30,7 +30,7 @@ pub(crate) mod DualCaseOwnableMock {

#[starknet::contract]
pub(crate) mod SnakeOwnableMock {
use openzeppelin_access::ownable::OwnableComponent;
use crate::ownable::OwnableComponent;
use starknet::ContractAddress;

component!(path: OwnableComponent, storage: ownable, event: OwnableEvent);
Expand Down Expand Up @@ -60,7 +60,7 @@ pub(crate) mod SnakeOwnableMock {

#[starknet::contract]
pub(crate) mod CamelOwnableMock {
use openzeppelin_access::ownable::OwnableComponent;
use crate::ownable::OwnableComponent;
use starknet::ContractAddress;

component!(path: OwnableComponent, storage: ownable, event: OwnableEvent);
Expand Down Expand Up @@ -158,7 +158,7 @@ pub(crate) mod CamelOwnablePanicMock {

#[starknet::contract]
pub(crate) mod DualCaseTwoStepOwnableMock {
use openzeppelin_access::ownable::OwnableComponent;
use crate::ownable::OwnableComponent;
use starknet::ContractAddress;

component!(path: OwnableComponent, storage: ownable, event: OwnableEvent);
Expand Down
10 changes: 4 additions & 6 deletions packages/access/src/tests/test_accesscontrol.cairo
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use openzeppelin_access::accesscontrol::AccessControlComponent::{
use crate::accesscontrol::AccessControlComponent::{
InternalImpl, RoleAdminChanged, RoleGranted, RoleRevoked
};
use openzeppelin_access::accesscontrol::interface::{
IAccessControl, IAccessControlCamel, IACCESSCONTROL_ID
};
use openzeppelin_access::accesscontrol::{AccessControlComponent, DEFAULT_ADMIN_ROLE};
use openzeppelin_access::tests::mocks::accesscontrol_mocks::DualCaseAccessControlMock;
use crate::accesscontrol::interface::{IAccessControl, IAccessControlCamel, IACCESSCONTROL_ID};
use crate::accesscontrol::{AccessControlComponent, DEFAULT_ADMIN_ROLE};
use crate::tests::mocks::accesscontrol_mocks::DualCaseAccessControlMock;
use openzeppelin_introspection::interface::ISRC5;
use openzeppelin_testing::constants::{
ADMIN, AUTHORIZED, OTHER, OTHER_ADMIN, ROLE, OTHER_ROLE, ZERO
Expand Down
12 changes: 5 additions & 7 deletions packages/access/src/tests/test_dual_accesscontrol.cairo
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use openzeppelin_access::accesscontrol::DEFAULT_ADMIN_ROLE;
use openzeppelin_access::accesscontrol::dual_accesscontrol::DualCaseAccessControl;
use openzeppelin_access::accesscontrol::dual_accesscontrol::DualCaseAccessControlTrait;
use openzeppelin_access::accesscontrol::interface::{
use crate::accesscontrol::DEFAULT_ADMIN_ROLE;
use crate::accesscontrol::dual_accesscontrol::DualCaseAccessControl;
use crate::accesscontrol::dual_accesscontrol::DualCaseAccessControlTrait;
use crate::accesscontrol::interface::{
IACCESSCONTROL_ID, IAccessControlCamelDispatcher, IAccessControlCamelDispatcherTrait
};
use openzeppelin_access::accesscontrol::interface::{
IAccessControlDispatcher, IAccessControlDispatcherTrait
};
use crate::accesscontrol::interface::{IAccessControlDispatcher, IAccessControlDispatcherTrait};
use openzeppelin_testing as utils;
use openzeppelin_testing::constants::{ADMIN, AUTHORIZED, ROLE};
use openzeppelin_utils::serde::SerializedAppend;
Expand Down
4 changes: 2 additions & 2 deletions packages/access/src/tests/test_dual_ownable.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use core::num::traits::Zero;
use openzeppelin_access::ownable::dual_ownable::{DualCaseOwnable, DualCaseOwnableTrait};
use openzeppelin_access::ownable::interface::{
use crate::ownable::dual_ownable::{DualCaseOwnable, DualCaseOwnableTrait};
use crate::ownable::interface::{
IOwnableDispatcher, IOwnableCamelOnlyDispatcher, IOwnableDispatcherTrait
};
use openzeppelin_testing as utils;
Expand Down
8 changes: 4 additions & 4 deletions packages/access/src/tests/test_ownable.cairo
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use core::num::traits::Zero;
use openzeppelin_access::ownable::OwnableComponent::InternalTrait;
use openzeppelin_access::ownable::OwnableComponent;
use openzeppelin_access::ownable::interface::{IOwnable, IOwnableCamelOnly};
use openzeppelin_access::tests::mocks::ownable_mocks::DualCaseOwnableMock;
use crate::ownable::OwnableComponent::InternalTrait;
use crate::ownable::OwnableComponent;
use crate::ownable::interface::{IOwnable, IOwnableCamelOnly};
use crate::tests::mocks::ownable_mocks::DualCaseOwnableMock;

use openzeppelin_test_common::ownable::OwnableSpyHelpers;
use openzeppelin_testing::constants::{ZERO, OTHER, OWNER};
Expand Down
8 changes: 4 additions & 4 deletions packages/access/src/tests/test_ownable_twostep.cairo
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use core::num::traits::Zero;
use openzeppelin_access::ownable::OwnableComponent::{InternalTrait, OwnershipTransferStarted};
use openzeppelin_access::ownable::OwnableComponent;
use openzeppelin_access::ownable::interface::{IOwnableTwoStep, IOwnableTwoStepCamelOnly};
use openzeppelin_access::tests::mocks::ownable_mocks::DualCaseTwoStepOwnableMock;
use crate::ownable::OwnableComponent::{InternalTrait, OwnershipTransferStarted};
use crate::ownable::OwnableComponent;
use crate::ownable::interface::{IOwnableTwoStep, IOwnableTwoStepCamelOnly};
use crate::tests::mocks::ownable_mocks::DualCaseTwoStepOwnableMock;
use openzeppelin_test_common::ownable::OwnableSpyHelpers;
use openzeppelin_testing::constants::{ZERO, OWNER, OTHER, NEW_OWNER};
use openzeppelin_testing::events::EventSpyExt;
Expand Down
6 changes: 3 additions & 3 deletions packages/account/src/account.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ pub mod AccountComponent {
use core::hash::{HashStateExTrait, HashStateTrait};
use core::num::traits::Zero;
use core::poseidon::PoseidonTrait;
use openzeppelin_account::interface;
use openzeppelin_account::utils::{MIN_TRANSACTION_VERSION, QUERY_OFFSET};
use openzeppelin_account::utils::{execute_calls, is_valid_stark_signature};
use crate::interface;
use crate::utils::{MIN_TRANSACTION_VERSION, QUERY_OFFSET};
use crate::utils::{execute_calls, is_valid_stark_signature};
use openzeppelin_introspection::src5::SRC5Component::InternalTrait as SRC5InternalTrait;
use openzeppelin_introspection::src5::SRC5Component::SRC5Impl;
use openzeppelin_introspection::src5::SRC5Component;
Expand Down
2 changes: 1 addition & 1 deletion packages/account/src/dual_eth_account.cairo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts for Cairo v0.15.1 (account/dual_eth_account.cairo)

use openzeppelin_account::interface::EthPublicKey;
use crate::interface::EthPublicKey;
use openzeppelin_utils::UnwrapAndCast;
use openzeppelin_utils::selectors;
use openzeppelin_utils::serde::SerializedAppend;
Expand Down
10 changes: 5 additions & 5 deletions packages/account/src/eth_account.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ pub mod EthAccountComponent {
use core::num::traits::Zero;
use core::poseidon::{PoseidonTrait, poseidon_hash_span};
use core::starknet::secp256_trait::Secp256PointTrait;
use openzeppelin_account::interface::EthPublicKey;
use openzeppelin_account::interface;
use openzeppelin_account::utils::secp256k1::Secp256k1PointStorePacking;
use openzeppelin_account::utils::{MIN_TRANSACTION_VERSION, QUERY_OFFSET};
use openzeppelin_account::utils::{execute_calls, is_valid_eth_signature};
use crate::interface::EthPublicKey;
use crate::interface;
use crate::utils::secp256k1::Secp256k1PointStorePacking;
use crate::utils::{MIN_TRANSACTION_VERSION, QUERY_OFFSET};
use crate::utils::{execute_calls, is_valid_eth_signature};
use openzeppelin_introspection::src5::SRC5Component::InternalTrait as SRC5InternalTrait;
use openzeppelin_introspection::src5::SRC5Component::SRC5Impl;
use openzeppelin_introspection::src5::SRC5Component;
Expand Down
6 changes: 3 additions & 3 deletions packages/account/src/tests/mocks/account_mocks.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[starknet::contract(account)]
pub(crate) mod DualCaseAccountMock {
use openzeppelin_account::AccountComponent;
use crate::AccountComponent;
use openzeppelin_introspection::src5::SRC5Component;

component!(path: AccountComponent, storage: account, event: AccountEvent);
Expand Down Expand Up @@ -46,7 +46,7 @@ pub(crate) mod DualCaseAccountMock {

#[starknet::contract(account)]
pub(crate) mod SnakeAccountMock {
use openzeppelin_account::AccountComponent;
use crate::AccountComponent;
use openzeppelin_introspection::src5::SRC5Component;

component!(path: AccountComponent, storage: account, event: AccountEvent);
Expand Down Expand Up @@ -88,7 +88,7 @@ pub(crate) mod SnakeAccountMock {

#[starknet::contract(account)]
pub(crate) mod CamelAccountMock {
use openzeppelin_account::AccountComponent;
use crate::AccountComponent;
use openzeppelin_introspection::src5::SRC5Component;
use starknet::account::Call;

Expand Down
16 changes: 8 additions & 8 deletions packages/account/src/tests/mocks/eth_account_mocks.cairo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[starknet::contract(account)]
pub(crate) mod DualCaseEthAccountMock {
use openzeppelin_account::EthAccountComponent;
use openzeppelin_account::interface::EthPublicKey;
use crate::EthAccountComponent;
use crate::interface::EthPublicKey;
use openzeppelin_introspection::src5::SRC5Component;

component!(path: EthAccountComponent, storage: eth_account, event: EthAccountEvent);
Expand Down Expand Up @@ -44,8 +44,8 @@ pub(crate) mod DualCaseEthAccountMock {

#[starknet::contract(account)]
pub(crate) mod SnakeEthAccountMock {
use openzeppelin_account::EthAccountComponent;
use openzeppelin_account::interface::EthPublicKey;
use crate::EthAccountComponent;
use crate::interface::EthPublicKey;
use openzeppelin_introspection::src5::SRC5Component;

component!(path: EthAccountComponent, storage: eth_account, event: EthAccountEvent);
Expand Down Expand Up @@ -84,8 +84,8 @@ pub(crate) mod SnakeEthAccountMock {

#[starknet::contract(account)]
pub(crate) mod CamelEthAccountMock {
use openzeppelin_account::EthAccountComponent;
use openzeppelin_account::interface::EthPublicKey;
use crate::EthAccountComponent;
use crate::interface::EthPublicKey;
use openzeppelin_introspection::src5::SRC5Component;
use starknet::account::Call;

Expand Down Expand Up @@ -147,7 +147,7 @@ pub(crate) mod CamelEthAccountMock {

#[starknet::contract]
pub(crate) mod SnakeEthAccountPanicMock {
use openzeppelin_account::interface::EthPublicKey;
use crate::interface::EthPublicKey;
use starknet::SyscallResultTrait;
use starknet::secp256_trait::Secp256Trait;

Expand Down Expand Up @@ -188,7 +188,7 @@ pub(crate) mod SnakeEthAccountPanicMock {

#[starknet::contract]
pub(crate) mod CamelEthAccountPanicMock {
use openzeppelin_account::interface::EthPublicKey;
use crate::interface::EthPublicKey;
use starknet::SyscallResultTrait;
use starknet::secp256_trait::Secp256Trait;

Expand Down
20 changes: 8 additions & 12 deletions packages/account/src/tests/test_account.cairo
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
use core::num::traits::Zero;
use core::starknet::SyscallResultTrait;
use openzeppelin_account::AccountComponent::{InternalTrait, SRC6CamelOnlyImpl};
use openzeppelin_account::AccountComponent::{PublicKeyCamelImpl, PublicKeyImpl};
use openzeppelin_account::AccountComponent;
use openzeppelin_account::interface::{AccountABIDispatcherTrait, AccountABIDispatcher};
use openzeppelin_account::interface::{ISRC6, ISRC6_ID};
use openzeppelin_account::tests::mocks::account_mocks::DualCaseAccountMock;
use openzeppelin_account::tests::mocks::simple_mock::SimpleMock;
use openzeppelin_account::tests::mocks::simple_mock::{
ISimpleMockDispatcher, ISimpleMockDispatcherTrait
};
use crate::AccountComponent::{InternalTrait, SRC6CamelOnlyImpl};
use crate::AccountComponent::{PublicKeyCamelImpl, PublicKeyImpl};
use crate::AccountComponent;
use crate::interface::{AccountABIDispatcherTrait, AccountABIDispatcher};
use crate::interface::{ISRC6, ISRC6_ID};
use crate::tests::mocks::account_mocks::DualCaseAccountMock;
use crate::tests::mocks::simple_mock::{ISimpleMockDispatcher, ISimpleMockDispatcherTrait};
use openzeppelin_introspection::interface::{ISRC5, ISRC5_ID};
use openzeppelin_test_common::account::{AccountSpyHelpers, SignedTransactionData};
use openzeppelin_test_common::account::{SIGNED_TX_DATA, get_accept_ownership_signature};
use openzeppelin_testing as utils;
use openzeppelin_testing::constants::stark::{KEY_PAIR, KEY_PAIR_2};
use openzeppelin_testing::constants::{
SALT, ZERO, OTHER, CALLER, RECIPIENT, QUERY_OFFSET, QUERY_VERSION, MIN_TRANSACTION_VERSION
SALT, ZERO, OTHER, CALLER, QUERY_OFFSET, QUERY_VERSION, MIN_TRANSACTION_VERSION
};
use openzeppelin_testing::signing::StarkKeyPair;
use openzeppelin_utils::selectors;
use snforge_std::{
start_cheat_signature_global, start_cheat_transaction_version_global,
start_cheat_transaction_hash_global
Expand Down
4 changes: 2 additions & 2 deletions packages/account/src/tests/test_dual_account.cairo
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use openzeppelin_account::dual_account::{DualCaseAccountTrait, DualCaseAccount};
use openzeppelin_account::interface::{AccountABIDispatcherTrait, AccountABIDispatcher};
use crate::dual_account::{DualCaseAccountTrait, DualCaseAccount};
use crate::interface::{AccountABIDispatcherTrait, AccountABIDispatcher};
use openzeppelin_introspection::interface::ISRC5_ID;

use openzeppelin_test_common::account::{get_accept_ownership_signature};
Expand Down
6 changes: 3 additions & 3 deletions packages/account/src/tests/test_dual_eth_account.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use openzeppelin_account::dual_eth_account::{DualCaseEthAccountTrait, DualCaseEthAccount};
use openzeppelin_account::interface::{EthAccountABIDispatcherTrait, EthAccountABIDispatcher};
use openzeppelin_account::utils::secp256k1::{DebugSecp256k1Point, Secp256k1PointPartialEq};
use crate::dual_eth_account::{DualCaseEthAccountTrait, DualCaseEthAccount};
use crate::interface::{EthAccountABIDispatcherTrait, EthAccountABIDispatcher};
use crate::utils::secp256k1::{DebugSecp256k1Point, Secp256k1PointPartialEq};
use openzeppelin_introspection::interface::ISRC5_ID;

use openzeppelin_test_common::eth_account::get_accept_ownership_signature;
Expand Down
Loading