-
Notifications
You must be signed in to change notification settings - Fork 110
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 leading zeros to addresses #607
Comments
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedI have 4 years working in development environments, have encountered several challenges, requests and teams focusing in reusable and efficient code, so that gives me a better understanding of the code and how to solve problems efficiently. How I plan on tackling this issueFirst of all I will deep dive into the structure of the code in order to understand what is the current state so I can then make the solution with the function that will ensure the lenght reached 66, filling with leading zeros so the issue stop affecting the user experience. |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedHello, my name is Bernal. I currently work as a software developer and have 4 years of experience in the field. During this time, I have developed software for both the backend and the frontend. I am a technology enthusiast. How I plan on tackling this issueFirst, I will research how the Starknet.go library works. After I have a better understanding, I will analyze the presented problem and prepare an optimal solution. Then, I will add the solution to the source files and conduct various tests to ensure it functions correctly. |
Hi @thiagodeev I can do it real quick if you want. Also, do you guys have a Telegram group where I can ask some questions? |
Hey @wugalde19! |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedHello, my name is Luca! I have been a backend software engineer for over 8 years. It would be a pleasure to collaborate with you, especially on this issue, as I have experience with Golang and RPC communication. I started studying Web3 development a few months ago and would like to contribute. Thank you for considering me. How I plan on tackling this issueI have already forked the project, ran it locally pointing to Starknet Sepolia, and I see that the address for depositing ETH via faucet is not being generated correctly, causing the invocation of AddDeployAccountTransaction to fail. From what I analyzed, if we normalize the wallet address to ensure it has 66 characters by adding the necessary leading zeros, the issue would be resolved. |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedI mean I'll just create a function that fills with 0'S until get the 66 char length. How I plan on tackling this issueThere can be many approaches but probably I'd just remove the prefix (0x) then with the rest of the string will add leading zeros until get 64 chars. Then just join back the other leading chars(0x) |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedI am a backend software engineer with experience in Golang development, smart contracts (Solidity), and blockchain-related applications. I've worked extensively with distributed systems, API integrations, and smart contract development, including e-voting and crowdfunding systems on Ethereum. Recently, I've been working on Starknet-related projects, which includes integrating Go backends with Starknet for a Web3 hackathon. My experience with both backend Golang programming and blockchain smart contracts positions me well to address challenges like this one, where low-level details such as address formats and data validation play a key role. I am familiar with Golang’s string manipulation and formatting functions, as well as blockchain concepts like address management and wallet operations. Additionally, I've handled cryptographic data structures like wallet addresses, so I'm comfortable working with similar tasks on Starknet How I plan on tackling this issueTo address the issue where some addresses are shorter than the expected 66-character length, I would begin by carefully analyzing the format of Starknet addresses. Typically, these addresses are hexadecimal strings and must be 66 characters long, including the '0x' prefix. These addresses represent 256-bit values, so if they are shorter, they need to be padded with leading zeros to ensure they meet the required length. I would then proceed to create a function in Golang that addresses this problem. The function would check the length of the address and add leading zeros as necessary. Before applying any padding, the function would first validate that the input is a valid hexadecimal string and ensure that the address starts with the "0x" prefix. This way, we can guarantee that the input is in the correct format before proceeding to pad it. Once the validation is complete, the function would calculate how many zeros need to be added based on the current length of the address. It would then add the required number of leading zeros to bring the total length of the address up to 66 characters. For completeness, I would also implement error handling to ensure that if the address is already longer than 66 characters, an error is returned, as we do not want to modify valid addresses. |
Can I pickup this issue? |
Related issue: #603
The users are facing issues when trying to send tokens and use faucets with addresses generated by the code because some of them have less than 66 length characters (the default address length).
A possible solution can be the creation of a function that can add leading zeros to an address until reaches 66 in length.
The text was updated successfully, but these errors were encountered: