Open s0lness opened 2 months ago
great! i would love to work on this
I am applying to this issue via OnlyDust platform.
I would love to work on this issue I'm a frontend developer I have over 30 + contributions and first contribution to this project it would give me delight to work on this issue
To solve this issue i would :
Understand the Requirements: Begin by thoroughly understanding the requirements mentioned in the issue. It involves writing a program to manage ERC721 tokens in Rust, which can be proved with Risc0, and deploying it on Hylé.
Research and Documentation: Utilize the provided documentation to code your first smart contract on Hylé. Additionally, refer to the example of the Cairo ERC20 contract used for the vibe check demo for insights and best practices.
Setting Up Environment: Ensure you have the necessary development environment set up for Rust and Hylé smart contract development. You may need to install required packages, libraries, or plugins.
Code Implementation: Begin coding your program to manage ERC721 tokens in Rust. Leverage the example documentation and smart contract code to understand the implementation details.
Testing and Proving with Risc0: Once the program is coded, it needs to be tested in the Risc0 environment to ensure its functionality and correctness. This may involve running tests and simulations to verify the behavior of the ERC721 tokens management.
Deployment on Hylé: After successful testing and proving, deploy the smart contract on Hylé. This would involve following the deployment guidelines and ensuring all prerequisites are met for deployment.
I am applying to this issue via OnlyDust platform.
I'm Poulav Bhowmick, a software engineer at Invisible Studios with a robust background in TypeScript, Rust, Solidity Cairo, fullstack development and blockchain technology. My experience includes building robust applications, optimizing functionalities and blockchain integration. I have actively participated in events and open source contributions, enhancing my capability to tackle real-world tech challenges. My projects can be viewed on my GitHub Profile and OnlyDust Profile. Plus I´m active member of Starknet community🇷.
Set up Risc0 to generate zero-knowledge proofs for the state transitions of the ERC721 contract. Deploy the Contract on Hylé
Use the Hylé CLI to deploy the ERC721 contract and verify it using the generated proofs.
// Import necessary crates
use risc0_zkp::prove;
use std::collections::HashMap;
// Define the ERC721 token contract structure
#[derive(Debug, Clone)]
struct ERC721 {
owner_of: HashMap<u64, String>, // Token ID to owner address
approved: HashMap<u64, String>, // Token ID to approved address
balances: HashMap<String, u64>, // Owner address to balance
next_token_id: u64, // Counter for token IDs
}
impl ERC721 {
// Create a new ERC721 contract
pub fn new() -> Self {
Self {
owner_of: HashMap::new(),
approved: HashMap::new(),
balances: HashMap::new(),
next_token_id: 1,
}
}
// Mint a new token
pub fn mint(&mut self, to: String) -> u64 {
let token_id = self.next_token_id;
self.owner_of.insert(token_id, to.clone());
*self.balances.entry(to).or_insert(0) += 1;
self.next_token_id += 1;
token_id
}
// Transfer a token
pub fn transfer(&mut self, from: String, to: String, token_id: u64) -> Result<(), &'static str> {
let owner = self.owner_of.get(&token_id).ok_or("Token does not exist")?;
if owner != &from {
return Err("Not the token owner");
}
if let Some(approved) = self.approved.get(&token_id) {
if approved != &from {
return Err("Not approved to transfer");
}
}
self.owner_of.insert(token_id, to.clone());
*self.balances.entry(from).or_insert(0) -= 1;
*self.balances.entry(to).or_insert(0) += 1;
Ok(())
}
// Approve an address for a token
pub fn approve(&mut self, to: String, token_id: u64) -> Result<(), &'static str> {
let owner = self.owner_of.get(&token_id).ok_or("Token does not exist")?;
if owner != &to {
return Err("Not the token owner");
}
self.approved.insert(token_id, to);
Ok(())
}
// Get the approved address for a token
pub fn get_approved(&self, token_id: u64) -> Option<&String> {
self.approved.get(&token_id)
}
// Get the balance of an address
pub fn balance_of(&self, owner: &String) -> u64 {
*self.balances.get(owner).unwrap_or(&0)
}
}
// Example usage and proof generation
fn main() {
let mut contract = ERC721::new();
let token_id = contract.mint("Alice".to_string());
contract.transfer("Alice".to_string(), "Bob".to_string(), token_id).unwrap();
println!("Token ID: {}", token_id);
println!("Alice Balance: {}", contract.balance_of(&"Alice".to_string()));
println!("Bob Balance: {}", contract.balance_of(&"Bob".to_string()));
// Proof generation with Risc0 (pseudo-code)
let proof = prove(&contract, |c| c.mint("Charlie".to_string()));
println!("Generated Proof: {:?}", proof);
}
Deployment on Hylé Install the Hylé CLI Tool
Follow the installation instructions provided in the Hylé documentation. Register the Contract
Use the CLI command to register your ERC721 contract:
hyled tx zktx register default risczero [program_id] erc721 [state_digest]
Deploy and Verify
Compile your contract and generate a proof for it using Risc0.
Deploy the contract with:
hyled tx zktx execute erc721 [proof/receipt]
Verify the contract’s state with:
hyled query zktx contract erc721
I am applying to this issue via OnlyDust platform.
I am a skilled smart contract engineer with expertise in Rust, Solidity, and Cairo, with significant experience in managing ERC721 tokens and zero-knowledge technologies. My recent projects include developing complex ERC721 contracts from scratch, ensuring robust ownership and transfer mechanisms. Additionally, I am proficient with Risc0 for proving computational integrity, making me well-suited for integrating zero-knowledge proofs into Rust-based smart contracts. My experience with multi-chain ecosystems, particularly in deploying on platforms like StarkNet, positions me to effectively manage the deployment on Hylé.
To manage ERC721 tokens in Rust with Risc0 and deploy on Hylé, I would begin by thoroughly reviewing the ERC721 standard, focusing on key functions like ownership, transfer, approval, and metadata management. I would then set up a Rust project, integrating the Risc0 crate to enable zero-knowledge proofs. Core ERC721 functions, including minting, transferring, and burning tokens, would be implemented with Rust’s efficient data structures, ensuring they are provable using Risc0. The project would include robust testing to validate functionality and the correct implementation of proofs. Finally, I would follow Hylé's deployment guidelines to compile and deploy the smart contract, ensuring it meets all platform requirements and integrates seamlessly. My background in Rust, ERC721, and zero-knowledge technologies ensures a secure and efficient solution.
I am applying to this issue via OnlyDust platform.
Hello, I’m Gerson, an active member of the Dojo Coding community. I have contributed to several projects on OnlyDust, such as Madara, Kakarot, Giza, and Cairo Native. My experience with Rust comes from my participation in these projects, and I’ve worked in other personal projects woth Cairo that have allowed me to deepen my knowledge of this programming language. My goal in applying to this issue is not only to contribute my knowledge but also to expand my experience with Rust and explore new areas like integrating with Hylé. You can see more about my work on my OnlyDust profile: https://app.onlydust.com/u/Gerson2102
First, I would focus on reviewing all the resources and documentation provided in the issue to ensure I fully understand the project’s requirements. It’s crucial to understand both the implementation of ERC721 in Rust and the Hylé platform to develop a robust smart contract. After this initial review, I would study examples of ERC721 contracts in Rust and analyze the example of the Cairo ERC20 contract mentioned. This will help me identify patterns and potential challenges.
As I progress, I plan to write code incrementally, If I encounter difficulties or have specific questions, I won’t hesitate to seek guidance in the Telegram groups or directly contact the project leads to ensure the work meets the required standards. My approach is iterative and collaborative, ensuring that each step aligns with the expectations of the team and the community.
I am applying to this issue via OnlyDust platform.
Hi, my name is Bernal. I currently work as a software developer in Costa Rica, i have 4 years working in software development. I’m an enthusiast of Web3 technology, and I would love to contribute to this project.
The first step is to understand the project and how it works. Once I have a good understanding of it, I’ll investigate how to manage ERC721 tokens in Rust and explore integrating Risc0 for proof generation. Then, I’ll think about an optimal solution for deploying the contract on Hylé. After that, I’ll implement the solution and run tests to validate the deployment and proof mechanism.
Hello all, thanks for applying 😄
Assigning this one to @g4titanx For this one, the best starting point is http://github.com/Hyle-org/collatz-conjecture since that's Rust + risc0. Consider looking at our vibe checks contracts as well.
For questions, please join t.me/hyle_org. We try to keep the docs at https://docs.hyle.eu up-to-date but things change quickly.
hey @wraitii im down to work on this one.
Write a program to manage ERC721 tokens in Rust, which can be proved with Risc0, and deploy it on Hylé. Here's the documentation to code your 1st smart contract on Hylé.
Here's an example of the Cairo ERC20 contract used for the vibe check demo.