web3wagers / gostarkme

Funds recollection project in Starknet ecosystem
http://web3wagers.github.io/gostarkme/
GNU Affero General Public License v3.0
17 stars 57 forks source link

[test] Test event emit when user withdraw fund's balance #143

Closed adrianvrj closed 2 weeks ago

adrianvrj commented 3 weeks ago

This issue will be part of ODHack9.0, please apply via Onlydust app

Acceptance Criteria

CollinsC1O commented 3 weeks ago

Hello I'm a front-end and a blockchain developer and will love to work on this

Mystic-Nayy commented 3 weeks ago

Hi @adrianvrj I will like to work on this issue.

NueloSE commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

As a skilled solidity and cairo developer with experience in blockchain technologies and contribution to previous testing of smart contracts. Link to previous test: scaffoldstark testing

How I plan on tackling this issue

  1. Implement the Event Emission
    • I'll define the event structure in the fund contract
    • Implement the method that handles withdrawals and emits the event 2 Add a Test I will create a test file for the fund contract. And write a test case to verify the event emission
  2. Verify Implementation I will ensure the event is properly defined and emitted. I will finaly check that the test passes successfully.
Lukman-01 commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello! My name is Lukman, and I am a passionate Smart Contract Developer with two years of experience in writing smart contracts. My hands-on experience spans various blockchain platforms, including Ethereum and Starknet. I’m eager to leverage my skills in developing efficient, secure, and innovative solutions in the blockchain space.

How I plan on tackling this issue

To address this issue, I will first review the relevant event emission logic in the contract to understand its structure and expected values. Next, I will write comprehensive test cases that simulate scenarios in which the event should be emitted, verifying that all expected values are correctly captured. Finally, I will run the tests to ensure they pass successfully, confirming that the event is emitted as intended.

jimenezz22 commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am Luis Jiménez, an active member of the Dojo Coding community in Costa Rica, with experience in Cairo, having built onchain games like ByteBeasts and contributed to open-source projects such as CairoLint, where I implemented tests for Cairo lints. Additionally, I taught Cairo during the Starknet Bootcamp for Dojo Coding. I also have experience with TypeScript, contributing to Starknet Quest and Go Stark Me by developing components like ComboBoxes, among others

How I plan on tackling this issue

  1. I’ll review the related issue #139 to understand how the event was implemented.
  2. I’ll write a test in Cairo to validate that the event is emitted with the correct attributes: fund contract address, owner address, and the amount withdrawn (in STRKs).
  3. I’ll ensure the test passes successfully and covers different scenarios, such as withdrawing varying amounts and testing edge cases.
  4. I’ll run all tests to ensure no conflicts with existing functionality.

Let me know if this approach sounds good, and if I can proceed with working on it.

Estimate time 1-3 days.

martinvibes commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

hello @ i'm an experienced frontend developer and a blockchain developer i would love to work on this issue Pleasee kindly assign :)

How I plan on tackling this issue

i would make sure it is working and test i to make sure it is working

No-bodyq commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, I'm Asher and I'll be working on issue #143.

I estimate this will take less than 2 days to complete.

How I plan on tackling this issue

I will go through the code to get accustomed with its functionality then write tests to assert that the correct event, as well as its expected values are properly emitted when the function is called using the assert_emitted method

bruhhgnik commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, im nik, i want to apply to contribute to this issue

How I plan on tackling this issue

I've goe through the instructions and the codebase, i'll make sure its working. ETA: 1 day

ShantelPeters commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a blockchain developer with vast knowledge in languages as cairo, typescript, javascript, Html, Css , solidity, React etc. My background in smart contract development will help ensure this implementation is efficient and effective.

How I plan on tackling this issue

To address the issue of ensuring that the event is emitted correctly as outlined in issue #139, I would begin by reviewing the specific context provided in that issue to grasp the details of the event being emitted. Next, I would write a focused unit test for the function responsible for emitting this event, confirming that it includes all required attributes and that the emitted values align with the expected results. My approach would include testing various scenarios to ensure robustness and accuracy. Finally, I would run the tests to verify that they pass successfully, confirming the correctness of the event emission process.

0xprivateChaos commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I bring 2 years of hands-on experience in writing and optimizing tests for Solidity smart contracts, which has given me strong foundation in blockchain testing patterns. Recently, I've expanded my expertise into Cairo development, actively writing contracts and their corresponding tests. My combination of established testing experience in Solidity and fresh perspective in Cairo, along with deep theoretical knowledge, positions me well to tackle this testing challenge effectively.

How I plan on tackling this issue

  1. In test, simulate the fund reaching its goal and the owner calling the withdraw function.
  2. Check if the correct event (e.g., Withdraw) is emitted with the expected values (owner address, amount withdrawn, etc.).
  3. Use an assertion to verify that the emitted event matches the expected data structure and values.
aniruddhaaps commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a typescript dev. A new-comer here, willing and ready to contribute to contribute to solve the issue.

BrunoAmbricca commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello guys, I have been working for the past 4 years as a developer with multiple languages such as ts, and for the past 3 months learning and working with cairo on my own projects.

How I plan on tackling this issue

I would look the method that needs to emit an event, follow the contributor guidelines, do the feature and test all it´s cases.

ryzen-xp commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I’m a blockchain developer with expertise in Cairo and Solidity, experienced in writing and testing smart contracts. Recently, I’ve worked on projects like ARK and Worldlines Bridge, focusing on event handling and testing frameworks.

How I plan on tackling this issue

[1]=>review the contract logic to understand the event structure and data emitted when a user withdraws funds. [2]=Write a test case that triggers the withdrawal function and captures the event. {3}=>Validate that the event emits the correct values for all expected fields. [4]=>Run the test and ensure it passes with accurate event data. I’ll ensure the event emits correctly and that all tests pass successfully. Please /assign

mimiprosper commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Am a smart contract developer (solidity & starknet cairo). Am also a smart contract auditor and technical writer. As a smart contract auditor, testing is what i know in-depth and understand. I have audited lots of code bases. I understand how important thorough testing are in the web3 space.

How I plan on tackling this issue

I would follow the guideline in the repo for fork, clone & pull request. I would clone the project on my local machine. I would study the code base (user withdraw fund's balance events). Reading the code base will make me understand what events are expected to be emitted. Then i write test to make sure that what the user withdraw fund's balance events are expected to emit are correctly emitted.

blessingbytes commented 3 weeks ago

I'd like to take this issue.

obacollins-lab commented 3 weeks ago

I’d like to help with this.

GideonBature commented 3 weeks ago

Hi, I'm Gideon Bature, a Software Engineer and I'll be working on issue #143.

I estimate this will take 2 days to complete.

This is how I would tackle this issue:

based on the issue #139 that emits an event when a fund contract receives a new donation in the withdraw method, I am going to do the following:

  1. I will write a test using the spy events method and a mock up event to test and make sure that the event is emitting correctly all the expected values ( the events is going to fund contract address, owner address, STRKs amount that is withdrawn).
  2. I will test using snforge from snfoundry to make sure the test passes successfully.
Akshola00 commented 3 weeks ago

Is it okay if I take this?

DiegoB1911 commented 3 weeks ago

My background and how it can be leveraged I'm a Full Stack Developer with two years of experience. I'm also a member of Dojo Coding, where I'm expanding my expertise in Cairo and Web3 technologies. I'm enthusiastic about learning, and becoming a part of this project.

How I plan on tackling this issue To solve this, I will:

  1. Analyze the contract functionality.
  2. Develop a test to verify that the event is emitted correctly using assert_emitted.
  3. Verify that everything works as expected and document the code. ETA: 2 days
EmmanuelAR commented 2 weeks ago

Hello @DiegoB1911 this ticket is ready to work! Any questions let us know :)

DiegoB1911 commented 2 weeks ago

Thanks! I’ll have the PR ready soon