Closed Marchand-Nicolas closed 1 month ago
Hey @Marchand-Nicolas let me work on this
Hi @martinvibes! Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.
Hi @vickiddev! Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.
I am applying to this issue via OnlyDust platform.
Hello, I am Manuel, a process engineer and web3 developer. I have participated in Starknet Bootcamps and am an Elite winner of Speedrunstark. I have a high capacity to solve problems. I am a member of the DojoCoding community. I hope this issue is assigned to me. I am available to work immediately to achieve what is required in the shortest time possible.
To address the requirements of the issue, I will:
calls
field to QuestTaskDocument
in src\models.rs
, defining it as an array of Call
objects.Call
type with fields: contract
, call_data
, entry_point
, and regex
.verify_contract
route in src\endpoints\quests
, reusing code from verify_balance
.regex
.I am applying to this issue via OnlyDust platform.
I am a Full Stack blockchain Developer with expertise in Next.js, Nest.js, TypeScript, JavaScript, React, Node.js, Three.js, Solidity and rust. My journey with OnlyDust hackathons began at Edition 1, and I've since made 69 contributions across 14 projects. With my extensive experience on the OnlyDust platform (profile: https://app.onlydust.com/u/Ugo-X), I've honed my skills in delivering quality solutions under pressure.
I bring a unique blend of technical proficiency and user-focused design to every project, whether it's crafting immersive 3D experiences or developing smart contracts. My track record shows I can adapt quickly and contribute effectively to diverse challenges.
As we surf through Edition 8, I'm excited to leverage my skills and hackathon experience to push the boundaries of blockchain development. I'm confident in my ability to tackle new challenges and drive innovation in this space.
I will approach this issue in the following manner:
Create a new file verify_contract.rs
in src\endpoints\quests
.
Define a new struct Call
in src\models.rs
with fields: contract
, call_data
, entry_point
, and regex
.
Add a calls
field of type Option<Vec<Call>>
to the QuestTaskDocument
struct.
Implement the verify_contract
route handler:
a. Retrieve the task document from the database.
b. For each Call
in calls
:
Use the Starknet provider to make a contract call with the given parameters.
Parse the call result using the parse_string
function (to be implemented).
Check if the parsed result matches the regex
pattern.
c. If all calls pass their regex checks, mark the task as completed.
d. Otherwise, return an error response.
Reuse error handling and response formatting from the verify_balance
route.
Add appropriate error handling for contract call failures and regex mismatches.
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, Ethereum ecosystem.
I will address this issue by implementing the following steps:
Update QuestTaskDocument Type:
I'll start by adding the calls field to the QuestTaskDocument type in src/models.rs if it doesn't already exist. This field will be an array of Call objects. Each Call will have the properties: contract (string), call_data (string array), entry_point (string), and regex (string). If necessary, I will create a new Call type to maintain clarity and structure. Create verify_contract Route:
I'll implement a new verify_contract route in src/endpoints/quests. This route will loop through each Call in the calls array, interact with the specified smart contract at the given entry_point, and pass the provided call_data. Check Outputs with Regex:
After executing each contract call, I'll validate the output using the corresponding regex field to ensure the results meet the specified criteria. If the regex matches the output, the task will proceed; otherwise, an error will be thrown. Reuse Existing Code:
To ensure consistency and efficiency, I will reuse code from the verify_balance route where applicable, adapting it to handle the advanced contract task logic. I'll make sure to thoroughly test the verify_contract route with different Call configurations and regex patterns to ensure it functions correctly.
ETA - 2 days
I am applying to this issue via OnlyDust platform.
I have experience in Rust programming, particularly in web development or smart contract interactions, this knowledge will be critical in implementing the new route and handling contract calls efficiently. Familiarity with blockchain concepts and contract calls will aid in ensuring that the new route functions as intended and meets user requirements.
Approach to Adding the verify_contract Route Modify QuestTaskDocument:
In src/models.rs, check if the calls field is present in QuestTaskDocument. If not, add it as an array of Call type. Define the Call type if it doesn't exist:
struct Call {
contract: String,
call_data: Vec
In src/endpoints/quests, create a new route for verify_contract. Use existing code from the verify_balance route as a reference for structure and implementation. Implement Call Execution Logic:
Iterate through the calls array, executing each call with the specified entry_point and call_data. Capture the output of each call. Regex Validation:
After executing each call, apply the corresponding regex to validate the output. If the output matches, proceed; otherwise, handle the mismatch accordingly (e.g., log an error or return a failure response). Testing:
Write unit tests for the new route, ensuring it correctly handles various scenarios, including regex matches and mismatches. Documentation:
Update any relevant API documentation to reflect the new verify_contract route and its usage. Create a Pull Request (PR):
Push changes to a new branch and create a PR for review, detailing the implementation and any tests added.
The maintainer Marchand-Nicolas has assigned Ugo-X to this issue via OnlyDust Platform. Good luck!
Thank you ser, will get to it.
Description
Advanced
contract
task type: the aim of this PR is to add a newverify_contract
route insrc\endpoints\quests
.PROPOSED TODO
calls
optional field to theQuestTaskDocument
type insrc\models.rs
if it is not already present. This is an array ofCall
. EachCall
is an object with the following fields:contract
(string),call_data
(string array),entry_point
(string),regex
(string). If it doesn't already exist, I suggest you to create aCall
type that you can then use to type theCalls
field.verify_balance
route.regex
field corresponding to field.