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

[feat] Add new asserts to set_name #252

Closed
EmmanuelAR opened this issue Nov 21, 2024 · 18 comments · Fixed by #260
Closed

[feat] Add new asserts to set_name #252

EmmanuelAR opened this issue Nov 21, 2024 · 18 comments · Fixed by #260
Assignees
Labels

Comments

@EmmanuelAR
Copy link
Collaborator

EmmanuelAR commented Nov 21, 2024

This issue will be part of ODHack10, please apply via Onlydust app

  • Add new assert that validate that the caller should be the admins in set_name method in contracts/src/fund.cairo
  • The admins are two (VALID_ADDRESS_1,VALID_ADDRESS_2) constants located in contracts/src/constants/funds/fund_manager_constants.cairo
  • Please read contributors guide before asking for an issue.
@vestor-dev
Copy link

Hi, I'm martin and I'll be working on issue #252.

I estimate this will take 48hrs to complete.

This is how I would tackle this issue:

  1. Locate set_name: Find the method in contracts/src/fund.cairo.
  2. Access Admin Constants: Use VALID_ADDRESS_1 and VALID_ADDRESS_2 from fund_manager_constants.cairo.
  3. Add Admin Check: Add an assert to verify the caller's address matches one of the admin constants.

it will be my first time on this repo

@GoSTEAN
Copy link

GoSTEAN commented Nov 21, 2024

Can I work on issue #252

Background

I am a smart contract developer with hands-on experience in writing and deploying decentralized applications (dApps). I specialize in using Cairo, the programming language for StarkNet, to develop scalable and efficient smart contracts.

Steps to solve it

  1. Understand the Contributor's Guide

    Read the guide carefully to ensure compliance with project standards for contributions, coding style, and testing requirements.

  2. Locate Relevant Files and Constants
    Navigate to contracts/src/fund.cairo to find the set_name method.
    Identify the constants VALID_ADDRESS_1 and VALID_ADDRESS_2 in contracts/src/constants/funds/fund_manager_constants.cairo.

  3. Modify the set_name Method
    Add an assert statement in the set_name method to check if the caller's address matches either VALID_ADDRESS_1 or VALID_ADDRESS_2.
    Use Cairo’s syntax for assertions, ensuring it aligns with existing patterns in the codebase.

  4. Write Tests for Validation
    Implement test cases to verify that the set_name method only allows calls from the valid admin addresses.
    Include negative tests to ensure unauthorized addresses are blocked.

  5. Submit and Verify
    Test the changes locally, ensuring compliance with the contributor's guide.

@BrunoAmbricca
Copy link
Contributor

I would like to work on this issue

@martinvibes
Copy link

Can I try solving this issue?
i would love to work on this issue kindly assign :)

@Emmanex01
Copy link

Could I take over this issue?

@GideonBature
Copy link

I’d like to work on this.

My name is Gideon Bature, a Software Engineer with experience building Starknet based smart contracts, using Cairo. If given this issue, I should be able to send my first PR within 48 hrs.

Thank you!

@ryzen-xp
Copy link

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

@jsanchez556
Copy link
Contributor

Hi, my name is José Mario from Costa Rica, a Full stack developer with more than 15 years in development and a focus in TypeScript, JavaScript, Nodejs and React. Open Source projects are something I enjoy, and I am now learning on Rust, and Cairo, I recently contribute to some Rust projects. About my learning and growth in the industry, I started doing ODHacks as early as version 7.0 due to my work with Dojo Coding. I am excited to utilize my wealth of experience and experience to new technologies to meet new challenges and deliver results.

How to tackle this feature:
Locate set_name function in contracts/src/fund.cairo and add a new validation to ensure the caller is either VALID_ADDRESS_1 or VALID_ADDRESS_2, then add proper test to verify that set_name works for VALID_ADDRESS_1 or VALID_ADDRESS_2.

@petersdt
Copy link

Can I take this issue?

i am a frontend developer with experience in writing and testing smart contract kindly assign me this issue ETA <= 24hrs

@ShantelPeters
Copy link
Contributor

May I try my hand at this?

@josephpdf
Copy link
Contributor

Hi! @EmmanuelAR
I'm Joseph Poveda, I'm a member of the Dojo Coding community.
A bit about my background is that I'm just starting out with Only Dust and I want to contribute as much as I can to the project. My knowledge of different programming languages ​​will allow me to better solve problems.
To solve this issue I will:

  1. Understand the Requirements:
  • Review the set_name method in contracts/src/fund.cairo.
  • Identify where to add the new assert statement.
  1. Locate Admin Constants:
  • Find the admin constants VALID_ADDRESS_1 and VALID_ADDRESS_2 in contracts/src/constants/funds/fund_manager_constants.cairo.
  1. Implement the Assert Statement:
  • Add an assert statement in the set_name method to validate that the caller is one of the admin addresses:
    assert caller_address == VALID_ADDRESS_1 or caller_address == VALID_ADDRESS_2, "Caller is not an admin"
  1. Test the Changes:
  • Write tests to ensure the assert statement works correctly and only allows admin addresses to call the set_name method.
  1. Follow Contribution Guidelines:
  • Read the contributors guide before starting the implementation.

@SoarinSkySagar
Copy link

May I work on this issue @EmmanuelAR?

I am an experienced cairo dev and a regular contributor at @keep-starknet-strange.

eta: 3 days

@Kom02
Copy link

Kom02 commented Nov 21, 2024

Hi, My name is Kevin Obando, a full stack junior developer with 2 years of experience from Costa Rica. I am starting in this community and I want to help in this project.

@akintewe
Copy link

Hi, I'm akintewe and I'll be working on issue
I have experience in cairo and typescript

I estimate this will take 24hrs to complete.

I would tackle this issue with these steps:

i will first locate set_name: Find the method in contracts/src/fund.cairo.
Access Admin Constants: Use VALID_ADDRESS_1 and VALID_ADDRESS_2 from fund_manager_constants.cairo.
I will also dd Admin Check: Add an assert to verify the caller's address matches one of the admin constants.
I am a new contributor, happy to help :)

@Supa-mega
Copy link

Can I be assigned to this?

@ikezuby2012
Copy link

hello, can i be assigned this issue?

my name is nnubia nzube, i'm a software developer with experience in writing smart contract using cairo, my ETA is within 24 hours.

@saimeunt
Copy link
Contributor

Hey, I'm a returning contributor having previously worked on testing gostarkme, I think this can be completed in half a day.

@jsanchez556
Copy link
Contributor

Hi, @EmmanuelAR:

Please check the PR: #260

@adrianvrj adrianvrj linked a pull request Nov 22, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.