Skip to content
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

Fetch All Closed Events - Cairo Contract #113

Open
mubarak23 opened this issue Jan 27, 2025 · 15 comments · May be fixed by #132
Open

Fetch All Closed Events - Cairo Contract #113

mubarak23 opened this issue Jan 27, 2025 · 15 comments · May be fixed by #132
Assignees
Labels
good first issue Good for newcomers ODBoost

Comments

@mubarak23
Copy link
Owner

Create a Smart Contract function that fetch All Closed Events, the function should return Array of EventDetails

Add the interface function inside IEvent.cairo

fn fetch_all_closed_events(self: @TContractState) -> Array<EventDetails>;

write your function inside chaineventts contract. (event/chaineventts.cairo)

Acceptance criteria

Function return Array containing all closed events.
write test for the function

Duration: 1 Day

@mubarak23 mubarak23 added good first issue Good for newcomers ODBoost labels Jan 27, 2025
@No-bodyq
Copy link

Could I take a shot at this?

@Jagadeeshftw
Copy link

Application for Fetching All Closed Events - Cairo Contract

Hi @mubarak23,

I am interested in implementing this feature to fetch all closed events in the chaineventts.cairo contract. I have experience working with Cairo and Starknet, and I will ensure the function is optimized for efficiency.

Implementation Plan

  1. Define the Interface Function
    • Add the following function inside IEvent.cairo:
      fn fetch_all_closed_events(self: @TContractState) -> Array<EventDetails>;
  2. Implement the Function in chaineventts.cairo
    • Retrieve stored event data and filter out only closed events.
    • Return an array of EventDetails for the closed events.
  3. Write Test Cases
    • Ensure the function correctly returns only closed events.
    • Test edge cases, including scenarios where there are no closed events.

ETA

I estimate completing this within 12 hours, ensuring proper functionality and comprehensive test coverage.

Looking forward to your approval! 🚀

Best,
Jagadeesh B.

@ekumamatthew
Copy link

Can I jump on this task?

@Yunusabdul38
Copy link
Contributor

Is it okay if I tackle this?
ETA 16h

@saimeunt
Copy link

I’d love to work on this task.

@ryzen-xp
Copy link
Contributor

Hi, I am proficient Blockchain developer expert in Cairo , Rust and Solidity and also in web development.
I have contributed many cairo ,rust projects like chainevents , arkprojects sunshine etc .
please /assign this issue .
Thank You

@OWK50GA
Copy link
Contributor

OWK50GA commented Jan 28, 2025

Hi, I'm a Cairo Smart Contract Developer, and I'll love to carry this out

@RareMmemshima
Copy link

May I take this issue on?

@Akshola00
Copy link
Contributor

I'd like to handle this task.
HI Im Akinshola Akinniyi, a fullstack web3 developer, im conversant with creating smart contracts and I'm confident I can handle this task,
I will create the function to fetch all closed events, following the already provided standard by the other functions, create event for it and assert that the function is working as expected, please assign this task to me
eta 1 day

@caxtonacollins
Copy link

Can I jump on this task?

@Joshaw-k
Copy link

I will fetch all closed events

I am from Starknet Winter Hackathon

I have great experience with Cairo, and am familiar with this codebase. I would love to work on this, fetch the closed events and write a detailed test.

ETA: 8 hours prompt.

@7-falseparfait
Copy link
Contributor

Can I take care of this issue?

@ussyalfaks
Copy link

I’d like to create the smart contract function to fetch all closed events, returning an array of EventDetails. This includes adding the interface function to IEvent.cairo, implementing it in chaineventts.cairo, and writing tests to ensure functionality and reliability.

@jaykayudo
Copy link

Can I take care of this issue?

@Cyber-Mitch
Copy link

Hi there! 👋

I’m a software engineer and blockchain developer with experience in Cairo, Solidity, JavaScript, TypeScript, and Rust. I’m excited to make my first contribution on OnlyDust and would love to take on this issue!

My approach

To implement the fetch_all_closed_events function, I will first add the interface function fn fetch_all_closed_events(self: @TContractState) -> Array; to IEvent.cairo to define the expected behavior. Next, I will write the function logic inside the chaineventts.cairo contract. The function will iterate through all events using the event_counts variable, check if each event’s is_closed flag is true, and append closed events to an array to be returned. To ensure correctness, I will write comprehensive tests that cover scenarios such as no closed events, all events closed, and mixed open/closed events. This approach ensures the function meets the acceptance criteria and integrates seamlessly with the existing contract.

This was referenced Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers ODBoost
Projects
None yet