foundry-rs / starknet-foundry

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

Remove `CairoSerialize` impl for String and &str. Use `ByteArray` explicitly #2147

Closed Draggu closed 1 week ago

Draggu commented 5 months ago

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

snforge

Description

Cairo does not support strings. We need to establish a one-to-one mapping and remove the CairoSerialize implementation for String and &str.

Proposed steps:

  1. remove this implementation here
  2. replace every occurrence in structs/enums implenting CairoSerialize with ByteArray instead of String or &str.

Tip:

Gerson2102 commented 1 week ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged


Hey! I'm Gerson. šŸ‘‹

Member of Dojo Coding. I have contributed before to other Rust projects like

Can I work on this issue?

Check my OnlyDust profile, I've contributed to many projects: Profile


How I plan on tackling this issue

Plan to Solve the Issue:

  1. Study the codebase to understand the current structure and functionality.
  2. Understand the problem that needs to be solved by thoroughly reading the issue details.
  3. Leverage all provided resources within the issue to get a better grasp of the task at hand.
  4. If I encounter roadblocks, I will ask questions ASAP in the Telegram group to move forward effectively.
  5. I will open a PR and wait for ur feedback

Nemezjusz commented 1 week ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, I am ICT student and for the last few months i was really intrested in Rust and Cario. I also work professionallyas software developer. I hope can help you solve this and start my journey in Cario world

How I plan on tackling this issue

I'd remove the CairoSerialize implementation for String and &str, then search for any structs or enums using these types and replace them with ByteArray. I'd use the methods to convert String and &str into ByteArray where needed.

0xNeshi commented 1 week ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Rust experience and a regular Foundry user for Starknet smart contract testing. Regular "Cairo Book" and "Starknet By Examle" contributor. Creator and maintainer of Cairo learning track on Exercism. As a regular Foundry user, I'm very interested in making it as efficient and as clean as possible.

How I plan on tackling this issue

DanielEmmanuel1 commented 1 week ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Good day, My name is Deon, I am a passionate Full-Stack Web3 developer. I have sufficient experience building web3 applications/smart contracts with rust as well as high-performance backends.

I have a solid understanding of both backend development and data management. Iā€™m committed to writing clean, maintainable code and actively contributing to open-source projects.

How I plan on tackling this issue

By following these steps, I will enhance the compatibility of our code with Cairo and improve overall data handling in the project.

ksew1 commented 1 week ago

Hi all! šŸŒŸ

Thank you so much for all the submissions! I'm curating this issue and would like to clarify that when I added this to the hackathon, I envisioned it more as an entry-level task. I want to provide a chance for new developers, so I'll be assigning this to @Nemezjusz.

Sorry, @Gerson2102! šŸ˜… I know you were first, but I think this task might be too easy for you.

Thanks for understanding! šŸ˜Š

Gerson2102 commented 1 week ago

@ksew1 got it mate, dont worry. Let me know if there is any issue for me please. Thanks!

ksew1 commented 1 week ago

@Nemezjusz any progress on this?

Nemezjusz commented 1 week ago

I couldn't find the time yesterday, but I'm on it now :)