Skip to content

Upgrade Scarb and Starknet Foundry#12

Merged
loothero merged 2 commits into
mainfrom
upgrade/scarb-2.18-foundry-0.60
May 21, 2026
Merged

Upgrade Scarb and Starknet Foundry#12
loothero merged 2 commits into
mainfrom
upgrade/scarb-2.18-foundry-0.60

Conversation

@loothero

Copy link
Copy Markdown
Member

Summary

  • upgrade Scarb pin to 2.18.0 and Starknet Foundry pin to 0.60.0
  • update Cairo/Starknet package compatibility and snforge_std registry dependency
  • update test address helpers for Cairo 2.18 and disable allowed-libfunc validation warnings for the contract target
  • refresh Scarb.lock and README prerequisite versions

Verification

  • scarb fmt --check --workspace
  • scarb build
  • snforge test
  • snforge test --max-n-steps 4294967295

All verification commands completed with no warnings or errors.

Copilot AI review requested due to automatic review settings May 20, 2026 12:57

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates project dependencies, including Scarb, Starknet Foundry, and Cairo versions. It also introduces a test_address helper function to replace contract_address_const across test files. Feedback was provided regarding the potential risks of disabling libfunc validation in Scarb.toml and the suggestion to centralize the test_address utility to improve code maintainability.

Comment thread Scarb.toml Outdated
Comment on lines +296 to +298
fn test_address(address: felt252) -> ContractAddress {
address.try_into().unwrap()
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The test_address helper function is duplicated across multiple test files (metadata_generator.cairo, mint_tests.cairo, and tests.cairo). To improve maintainability and adhere to the DRY (Don't Repeat Yourself) principle, consider moving this utility to a shared test helper module or an existing utility file that is accessible by all test modules.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the project’s Cairo/Scarb/Starknet Foundry toolchain and updates the codebase (notably tests and build config) to remain compatible with the newer versions.

Changes:

  • Bumped Cairo/Starknet dependency versions and updated dev dependency snforge_std to 0.60.0 (registry-based).
  • Replaced contract_address_const usage in tests with a local test_address helper that converts felt252 to ContractAddress.
  • Updated build configuration for the Starknet contract target and refreshed lockfile/docs/tool version pins.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/tests.cairo Updates test address creation to use felt252 -> ContractAddress conversion helper.
src/mint_tests.cairo Same test address helper migration across minting-related tests.
src/metadata_generator.cairo Same test address helper migration in metadata generator tests.
Scarb.toml Upgrades Cairo/Starknet dependencies, switches snforge_std to registry, and changes allowed-libfuncs configuration.
Scarb.lock Refreshes lockfile to reflect new registry-sourced snforge_* packages and checksums.
README.md Updates prerequisite tool versions to match new pins.
.tool-versions Updates pinned Scarb and Starknet Foundry versions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/tests.cairo
use starknet::ContractAddress;

fn test_address(address: felt252) -> ContractAddress {
address.try_into().unwrap()
Comment thread src/mint_tests.cairo
use starknet::ContractAddress;

fn test_address(address: felt252) -> ContractAddress {
address.try_into().unwrap()
use super::{Attribute, BeastSvgTrait, MetadataGeneratorTrait, PackableBeast};

fn test_address(address: felt252) -> ContractAddress {
address.try_into().unwrap()
Comment thread Scarb.toml Outdated

[[target.starknet-contract]]
allowed-libfuncs-list.name = "experimental"
allowed-libfuncs = false
@loothero loothero merged commit 38e60db into main May 21, 2026
1 check passed
@loothero loothero deleted the upgrade/scarb-2.18-foundry-0.60 branch May 21, 2026 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants