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

checks added #15

Merged
merged 4 commits into from
Jul 27, 2022
Merged

checks added #15

merged 4 commits into from
Jul 27, 2022

Conversation

yvesbou
Copy link
Owner

@yvesbou yvesbou commented Jul 27, 2022

No description provided.

@yvesbou
Copy link
Owner Author

yvesbou commented Jul 27, 2022

  • state updates
  • make calls if any
  • emit events
  • add tests

@yvesbou yvesbou linked an issue Jul 27, 2022 that may be closed by this pull request
@yvesbou
Copy link
Owner Author

yvesbou commented Jul 27, 2022

Normal Behavior Tested
Add Tests for checks

if (_amount <= 0) {
       revert InsufficientAmount({depositAmount: _amount});
        }

if (!addressToFundingStatus[address(msg.sender)]) {
      // this address has not funded the contract
      revert UserNotAFunder();
      }

if (addressToFunds[address(msg.sender)] < _amount) {
        // the user wanted to withdraw more than deposited
        revert InsufficientBalance({available: addressToFunds[address(msg.sender)], required: _amount});
        }

@yvesbou yvesbou marked this pull request as ready for review July 27, 2022 13:56
Copy link
Owner Author

@yvesbou yvesbou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice :D

@yvesbou yvesbou merged commit 3136d49 into main Jul 27, 2022
@yvesbou yvesbou linked an issue Jul 27, 2022 that may be closed by this pull request
2 tasks
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.

Add Withdraw Function Basic Functionality for Smart Contract
1 participant