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

[CONTRACT] feat: Restrict set_daily_word to One Call Per Day & Update end_of_day_timestamp #235

Open
manlikeHB opened this issue Feb 28, 2025 · 5 comments
Assignees
Labels

Comments

@manlikeHB
Copy link
Collaborator

Description
Currently, set_daily_word can be called multiple times per day, which could lead to inconsistencies. To prevent unintended overwrites, we need to ensure that the function can only be called once per day. Additionally, when setting a new word, the end_of_day_timestamp should automatically update to reflect the next day’s reset time.

Acceptance Criteria

  • set_daily_word cannot be called more than once per day.
  • end_of_day_timestamp updates automatically upon setting a new word.
  • Write unit tests to verify correct behavior.
@anushkasomani
Copy link

Hi @manlikeHB , its Anushka here.
here's how i would approach this issue if i'm given the opportunity
I'll implement this by storing a last_set_timestamp in storage and ensuring that set_daily_word can only be called if the current timestamp has passed end_of_day_timestamp. If it's still within the same day, the function will revert. Once a new word is set, end_of_day_timestamp will automatically update to reflect the next reset time either at midnight UTC or by adding 86400 seconds to the last set timestamp. I'll also write unit tests to verify that the function correctly restricts multiple calls within a day, updates the timestamp properly and handles edge cases like calls near the reset boundary.

@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 starknet ,stellar projects and more .
please /assign Me this issue .
Thank You !!
ETA: 4 hours

@jaiminRaiyani
Copy link

Hey! I'd love to take this on. I'll ensure set_daily_word is restricted to once per day while automatically updating end_of_day_timestamp. I'll also cover it with unit tests for reliability. Assigning this to me!

@manlikeHB manlikeHB removed the ODBUILD label Feb 28, 2025
@od-hunter
Copy link

Hi, please can I be assigned this please? I would love to be the given the opportunity to solve this issue please. I have experience in html, css, JavaScript, TypeScript cairo and Rust.

I’m ready to work, kindly assign.

@FrankiePower
Copy link

Is it okay if I take this?

ETA: 12 HOURS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants