foundry-rs / starknet-foundry Goto Github PK
View Code? Open in Web Editor NEWBlazing fast toolkit for developing Starknet contracts.
Home Page: https://foundry-rs.github.io/starknet-foundry/
License: MIT License
Blazing fast toolkit for developing Starknet contracts.
Home Page: https://foundry-rs.github.io/starknet-foundry/
License: MIT License
In new scarb version the artifact name will change. Right now it is:
[package name].starknet_artifacts.json
and it will change to
[target name].starknet_artifacts.json
In most cases target name is the same as package name, but it could be different. We should take a target name from scarb metadata, and use the information to search for starknet_artifacts.json file
Docs for scarb metadata can be found here:
https://docs.rs/scarb-metadata/latest/scarb_metadata/struct.TargetMetadata.html#structfield.name
An example on how we retrieve some metadata can be found here:
software-mansion/protostar#2161
We should modify code in here https://github.com/starkware-libs/cairo/blob/05d4a9ec46885ac199025f829c9458989c1ddbba/crates/cairo-lang-starknet/src/plugin/dispatcher.rs#L259 to either change default dispatcher behavior, or introduce a separate dispatcher that will not unwrap call results by default.
We should then open a PR in original cairo repo.
software-mansion/protostar#2186
All public methods and structs should have rust docs strings ///
. We should verify that docs.rs style docs generate correctly for our library.
Add tests for deploy
software-mansion/protostar#2174
@MaksymilianDemitraszek please share your thoughts ๐
software-mansion/protostar#2116
docs docs docs
let's get inspired by current protostar docs https://docs.swmansion.com/protostar/docs/cairo-1/interacting-with-starknet
AND by foundry docs https://book.getfoundry.sh/reference/cast/transaction-commands
software-mansion/protostar#2100
We need a pipeline to release rust test runner. Installation as a scrb extension should be also taken into account: https://docs.swmansion.com/scarb/docs/extensions/json-output
software-mansion/protostar#2182
For now, we use &str to handle hex values, we should try to use number types such as u32 to do this. I spotted that it works nicely with deserialization via Serde.
software-mansion/protostar#2108
Deploy is already implemented in new runner (cheatcodes_hint_processor.rs
). Tests verifying if it actually works should be added. If not, it should be fixed in this or follow-up issue.
Test cases to cover apart from basic cases:
class_hash
exists, is correct and declared (and what happens if non-existing one does get passed)contract_address
is correct and aligned with the calculated one (and what hapens if incorrect one gets passeeddeploy
software-mansion/protostar#1950
Protostar init will be removed after the integration with scarb config. We should provide users a way to bootstrap their projects with scarb and protostar.
software-mansion/protostar#2148
Cheatcodes should use HintError::CustomHint or another mechanism so they fail in the way that can be handled by rust vm. Currently if cheatcodes panic for whatever reason, they panic "in rust" and cause the whole runner to fail which cannot be nicely handled.
software-mansion/protostar#2024
Edit:
Most of the errors should not be recoverable, excluding those with txn execution (which is handled by panic_data
).
Separately, we should consider avoiding having error_code
in cases which we always return 0
Edit2:
Delegated Invoke
s and Call
s error handling to #2156
software-mansion/protostar#2185
Setup initial starknet foundry book. For now let's just create an template and include some content based on current protostar docs.
We can use the same tool as it's used for https://book.getfoundry.sh/ or another tool like docusaurs.
We should use GH pages for hosting.
software-mansion/protostar#2072
Instead of implementing custom library functions we should use one general library function with signature
extern fn cheatcode<const selector: felt252>(
input: Span<felt252>
) -> Span<felt252> implicits() nopanic;
All cheatcodes should be implemented using this function
software-mansion/protostar#2156
Right now, we assert that the execution of invoke/call to contract succeeded and panic if it didn't. The code should be updated so panic data is returned to the test and can be handled.
software-mansion/protostar#2184
When tests panic, the devnet is not being cleaned up. We should try to fix that; one way could be to run:
pkill -f "starknet-devnet.*5055.*1053545548"
before starting it
software-mansion/protostar#2124
Instead of running e2e tests for each of the cheatcodes, we should design some general e2e tests and only run specific cheatcodes in integration tests. This will avoid having to run a whole application binary for each cheatcode.
software-mansion/protostar#2141
We're handling starknet_artifacts.json file both in all our components. Code for deserializing and handling this file could be moved to a separate crate and used in all of those projects.
Should include swapping code parts in Cast/Forge/Cheatnet which parse the artifacts
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.