foundry-rs / starknet-foundry

Blazing fast toolkit for developing Starknet contracts.
https://foundry-rs.github.io/starknet-foundry/
MIT License
281 stars 140 forks source link

Implement a derive for `SerializeToFelt252Vec` #2109

Closed Arcticae closed 2 months ago

Arcticae commented 2 months ago

Which components does the task require to be changed? (think hard pls)

snforge

Description

For reduction of code amount and complexity

Draggu commented 2 months ago

SerializeToFelt252Vec is always implemented same way that corresponding cairo type, so it can be easily derived. Same applies for FromReader (there is already macro for it). We should keep them together (in conversions or new crate, preferably conversions as this allows for blanket implementation for every felt type) and probably rename to something more accurate like CairoSerialize / CairoDeserialize