Skip to content

Commit

Permalink
chore: upgrade contract version
Browse files Browse the repository at this point in the history
  • Loading branch information
Darlington02 committed Jan 25, 2025
1 parent d0bc192 commit 444fffe
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 146 deletions.
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
scarb 2.9.2
starknet-foundry 0.36.0
Binary file modified contracts/.DS_Store
Binary file not shown.
87 changes: 24 additions & 63 deletions contracts/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,106 +4,67 @@ version = 1
[[package]]
name = "contracts"
version = "0.1.0"
dependencies = [
"openzeppelin",
"snforge_std",
]

[[package]]
name = "openzeppelin"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_governance",
"openzeppelin_introspection",
"openzeppelin_presets",
"openzeppelin_security",
"openzeppelin_token",
"openzeppelin_upgrades",
"openzeppelin_utils",
"snforge_std",
]

[[package]]
name = "openzeppelin_access"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"
version = "0.20.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:7734901a0ca7a7065e69416fea615dd1dc586c8dc9e76c032f25ee62e8b2a06c"
dependencies = [
"openzeppelin_introspection",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_account"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"
version = "0.20.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:1aa3a71e2f40f66f98d96aa9bf9f361f53db0fd20fa83ef7df04426a3c3a926a"
dependencies = [
"openzeppelin_introspection",
"openzeppelin_token",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_governance"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"
dependencies = [
"openzeppelin_access",
"openzeppelin_introspection",
]

[[package]]
name = "openzeppelin_introspection"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"

[[package]]
name = "openzeppelin_presets"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_introspection",
"openzeppelin_token",
"openzeppelin_upgrades",
]

[[package]]
name = "openzeppelin_security"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"
version = "0.20.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:13e04a2190684e6804229a77a6c56de7d033db8b9ef519e5e8dee400a70d8a3d"

[[package]]
name = "openzeppelin_token"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"
version = "0.20.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:4452f449dc6c1ea97cf69d1d9182749abd40e85bd826cd79652c06a627eafd91"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_governance",
"openzeppelin_introspection",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_upgrades"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"

[[package]]
name = "openzeppelin_utils"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"
version = "0.20.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:44f32d242af1e43982decc49c563e613a9b67ade552f5c3d5cde504e92f74607"

[[package]]
name = "snforge_scarb_plugin"
version = "0.31.0"
source = "git+/~https://github.com/foundry-rs/starknet-foundry?tag=v0.31.0#72ea785ca354e9e506de3e5d687da9fb2c1b3c67"
version = "0.36.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:b9550f5c921502be3e240e83aa9e2dc6ee63ae76bfecee082b7a15bead0460c0"

[[package]]
name = "snforge_std"
version = "0.31.0"
source = "git+/~https://github.com/foundry-rs/starknet-foundry?tag=v0.31.0#72ea785ca354e9e506de3e5d687da9fb2c1b3c67"
version = "0.36.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:9f38c6c376447cfe225c5869905122f6a64bc301f5872c7855d2abe6e9c0a1da"
dependencies = [
"snforge_scarb_plugin",
]
19 changes: 13 additions & 6 deletions contracts/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
[package]
name = "contracts"
version = "0.1.0"
edition = "2023_11"

[dependencies]
starknet = "2.8.2"
snforge_std = { git = "/~https://github.com/foundry-rs/starknet-foundry", tag = "v0.31.0" }
openzeppelin = { git = "/~https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.15.0" }
starknet = "2.9.2"
openzeppelin_access = "0.20.0"
openzeppelin_token = "0.20.0"

[dev-dependencies]
openzeppelin_utils = "0.20.0"
snforge_std = "0.36.0"

[[target.starknet-contract]]
casm = true
sierra = true

[tool.fmt]
sort-module-level-items = false
sort-module-level-items = true

[tool.snforge]
exit_first = false
[[tool.snforge.fork]]
name = "SEPOLIA_LATEST"
url = "https://starknet-sepolia.public.blastapi.io/rpc/v0_7"
block_id.tag = "latest"
87 changes: 20 additions & 67 deletions contracts/scripts/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,103 +12,56 @@ dependencies = [
[[package]]
name = "contracts"
version = "0.1.0"
dependencies = [
"openzeppelin",
"snforge_std",
]

[[package]]
name = "openzeppelin"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_governance",
"openzeppelin_introspection",
"openzeppelin_presets",
"openzeppelin_security",
"openzeppelin_token",
"openzeppelin_upgrades",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_access"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"
version = "0.20.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:7734901a0ca7a7065e69416fea615dd1dc586c8dc9e76c032f25ee62e8b2a06c"
dependencies = [
"openzeppelin_introspection",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_account"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"
version = "0.20.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:1aa3a71e2f40f66f98d96aa9bf9f361f53db0fd20fa83ef7df04426a3c3a926a"
dependencies = [
"openzeppelin_introspection",
"openzeppelin_token",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_governance"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"
dependencies = [
"openzeppelin_access",
"openzeppelin_introspection",
]

[[package]]
name = "openzeppelin_introspection"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"

[[package]]
name = "openzeppelin_presets"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_introspection",
"openzeppelin_token",
"openzeppelin_upgrades",
]

[[package]]
name = "openzeppelin_security"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"
version = "0.20.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:13e04a2190684e6804229a77a6c56de7d033db8b9ef519e5e8dee400a70d8a3d"

[[package]]
name = "openzeppelin_token"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"
version = "0.20.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:4452f449dc6c1ea97cf69d1d9182749abd40e85bd826cd79652c06a627eafd91"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_governance",
"openzeppelin_introspection",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_upgrades"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"

[[package]]
name = "openzeppelin_utils"
version = "0.15.0"
source = "git+/~https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.0#f57642960f1c8cffafefb88bfff418eca8510634"
version = "0.20.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:44f32d242af1e43982decc49c563e613a9b67ade552f5c3d5cde504e92f74607"

[[package]]
name = "sncast_std"
version = "0.27.0"
source = "git+/~https://github.com/foundry-rs/starknet-foundry?tag=v0.27.0#2d99b7c00678ef0363881ee0273550c44a9263de"

[[package]]
name = "snforge_std"
version = "0.27.0"
source = "git+/~https://github.com/foundry-rs/starknet-foundry?tag=v0.27.0#2d99b7c00678ef0363881ee0273550c44a9263de"
version = "0.36.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:5012ac1b1dd4fe9c0b5c01c4f45f791edd5f217b5b3e54196d7d26848f802af1"
4 changes: 2 additions & 2 deletions contracts/scripts/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ edition = "2023_11"
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html

[dependencies]
sncast_std = { git = "/~https://github.com/foundry-rs/starknet-foundry", tag = "v0.31.0" }
starknet = "2.8.2"
sncast_std = "0.36.0"
starknet = "2.9.2"
contracts = { path = "../" }

[lib]
Expand Down
4 changes: 4 additions & 0 deletions contracts/scripts/hellostarknet_alpha-sepolia_state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": 1,
"transactions": null
}
11 changes: 5 additions & 6 deletions contracts/scripts/src/hellostarknet.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use sncast_std::{
declare, deploy, DeclareResult, DeployResult, get_nonce, DisplayContractAddress,
DisplayClassHash, FeeSettings, EthFeeSettings
declare, deploy, DeclareResultTrait, get_nonce, FeeSettings, EthFeeSettings
};

fn main() {
Expand All @@ -15,12 +14,12 @@ fn main() {
)
.expect('contract already declared');

let class_hash = declare_result.class_hash;
let class_hash = declare_result.class_hash();

println!("Class hash of the declared contract: {}", declare_result.class_hash);
println!("Class hash of the declared contract: {:?}", declare_result.class_hash());

let deploy_result = deploy(
class_hash,
*class_hash,
ArrayTrait::new(),
Option::Some(salt),
true,
Expand All @@ -29,5 +28,5 @@ fn main() {
)
.expect('deploy failed');

println!("Deployed the contract to address: {}", deploy_result.contract_address);
println!("Deployed the contract to address: {:?}", deploy_result.contract_address);
}
3 changes: 1 addition & 2 deletions contracts/tests/test_contract.cairo
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use core::starknet::SyscallResultTrait;
use snforge_std::{declare, ContractClassTrait, DeclareResultTrait, DeclareResult};
use snforge_std::{declare, ContractClassTrait, DeclareResult};
use contracts::{IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait};

#[test]
Expand Down

0 comments on commit 444fffe

Please sign in to comment.