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

[WIP]: GDA Super Example #60

Merged
merged 26 commits into from
Dec 17, 2023
Merged

[WIP]: GDA Super Example #60

merged 26 commits into from
Dec 17, 2023

Conversation

youssefea
Copy link
Contributor

Creating a GDA Super Example as detailed in the following issue:

#58

@youssefea youssefea marked this pull request as draft November 15, 2023 00:17
@youssefea youssefea changed the title GDA Super Example [WIP]: GDA Super Example Nov 15, 2023
@youssefea youssefea marked this pull request as ready for review December 17, 2023 14:17
@youssefea
Copy link
Contributor Author

The GDA Super Example as detailed in this issue has been written. Moreover, foundry tests have been written under the folder "foundry-tests". They test for the following scenarios:

  1. Test Initial Setup

    • Validates the initial state of the blockchain fork, ensuring it's the selected fork.
    • Checks if the accepted token in AdSpotContract is DAIX.
    • Verifies that the initial contract owner is correctly set to the test contract itself.
    • Ensures the initial highest bidder is set to address zero, indicating no bids yet.
  2. Test Flow Creation

    • Simulates the creation of a money flow (bid) from account1 to AdSpotContract using DAIX.
    • Confirms that account1 becomes the highest bidder with the specified flow rate.
  3. Test Flow Update

    • Initially, a flow is created similar to the previous test.
    • The test then updates this flow rate and verifies if the AdSpotContract correctly reflects the new flow rate.
  4. Test Flow Deletion

    • After creating a flow from account1, this test deletes it.
    • It checks whether the highest bidder and flow rate in AdSpotContract are reset to their initial states.
  5. Test Higher Bid

    • This test compares the effects of higher bids from different accounts.
    • After account1 sets a flow, account2 creates a higher flow to become the new highest bidder.
    • The test ensures that the highest bid and bidder details are updated accordingly.
  6. Test NFT Setting

    • Verifies the functionality of setting an NFT to showcase in AdSpotContract.
    • After account1 sets a flow, it attempts to set an NFT for showcasing.
    • The test validates if the NFT address and token ID are correctly updated in the contract.
  7. Test Owner Units First Time

    • Focuses on the distribution of owner shares upon the first flow creation.
    • It ensures that the owner's share count is correctly initialized after the first flow is set up.
  8. Test Members Units

    • Assesses how shares are distributed among members when multiple flows are created.
    • Verifies that the owner's shares are correctly updated when a second account creates a flow.
  9. Test Advanced Members Units

    • This test is an advanced version of the previous one, assessing share distribution with multiple flows.
    • It particularly checks the share allocation when flows are updated to higher rates.

@youssefea youssefea merged commit 794adf5 into main Dec 17, 2023
0 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants