-
Notifications
You must be signed in to change notification settings - Fork 185
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
Add support for numbers in multicall #2245
Comments
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedI'm Joseph a blockchain developer with over four years in blockchain and backend development, I’ve worked across different ecosystems, handling everything from smart contract design to on-chain interactions and protocol integration. I focus on building secure, scalable, and reliable blockchain applications, managing both on-chain and off-chain infrastructure. How I plan on tackling this issueBegin by studying the codebase to ensure design consistency, then proceed to work on the task.
|
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedI'm a Full Stack Web3 Developer with experience in Rust and Cairo and participated in ODHacks since 2.0, working as both a contributor and maintainer. How I plan on tackling this issueI would define a new [untagged] enum for the |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedi have experience in cairo and blockchain previously as personal projects and OS, so hoping to make use of them here and mark my first odhack contribution. How I plan on tackling this issueI'll enhance the multicall configuration by implementing a custom TOML deserializer that intelligently handles both string and numeric inputs, automatically detects and converts hexadecimal/decimal formats for all numeric fields (class_hash, contract_address, inputs), while maintaining backward compatibility with existing string inputs. This allows for a more intuitive developer experience without breaking existing configurations. |
@kfastov any progress on this? |
<!-- Reference any GitHub issues resolved by this PR --> Closes #2245 ## Introduced changes <!-- A brief description of the changes --> - Added new enum type `Input` with variants `String` and `Number(i64)` to support both string and numeric inputs in TOML files - Updated `DeployCall` and `InvokeCall` structs to use `Vec<Input>` instead of `Vec<String>` for their `inputs` field - Modified `parse_inputs` function to handle both string and numeric input variants - Added `#[serde(untagged)]` attribute to enable seamless deserialization of both input types from TOML ## Checklist <!-- Make sure all of these are complete --> - [x] Linked relevant issue - [x] Updated relevant documentation - [x] Added relevant tests - [x] Performed self-review of the code - [x] Added changes to `CHANGELOG.md` ## Other notes - Numbers larger than 2^64 are not supported by TOML format: https://toml.io/en/v1.0.0#integer - However, numbers outside i64 range cannot be supported currently due to an [issue](toml-rs/toml#705) in the toml parser --------- Co-authored-by: Franciszek Job <[email protected]>
Description
It seems counterintuitive not to allow raw integers inputs in the mutlicall, right now it's not supported and only string inputs are accepted
Example:
Desired Behavior
We can allow the
inputs
to be array of numbers:Also
contract_address
andclass_hash
can be numbers,Example:
Context
The text was updated successfully, but these errors were encountered: