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

Added modifier to remove duplication #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Upendra-Jaiswal
Copy link

@Upendra-Jaiswal Upendra-Jaiswal commented Dec 15, 2022

Description

the hasSufficientFunds modifier is defined at the top of the contract. This modifier checks if the caller has sufficient funds to perform the requested operation, and if not, it will throw an error.

The withdraw and transferAmt functions both use the hasSufficientFunds modifier, which means that they will both check if the caller has sufficient funds before executing any other code in the function. This avoids repeating the same code in multiple places.


Fixes #144

Screenshots of relevant screens

Screenshot 2022-12-15 at 11 09 10 PM

Developer's checklist

  • My PR follows the style guidelines of this project
  • I have performed a self-check

If changes are made in the code:

  • I have followed the coding guidelines
  • My changes in code generate no new warnings
  • I have added relevant screenshots in my PR

@github-actions
Copy link
Contributor

Thank you for opening your first pull request in our repository, one of our maintainers will get in touch with you soon.

DO NOT FORGET TO ADD METAMASK WALLET ADDRESS IN THE AUTH FORM
We at Metafy have some special rewards and swags for the top contributors in general repos and every contributor in web3 repos
For being eligible for that, please authenticate yourself using this link:
https://metafy.social/signup

Rewards : T-shirts & NFT ( for blockchain contributions )

Best of luck on your Contributions
For further queries you can join our discord for support : https://discord.gg/W6PmEjjQsA

@github-actions
Copy link
Contributor

PR is not linked to any issue, please make the corresponding changes in the body.

@github-actions
Copy link
Contributor

PR is not linked to any issue, please make the corresponding changes in the body.

@github-actions github-actions bot added PR:Ready-to-Review hacktoberfest-accepted Hacktoberfest Accepted Pull Requests and removed PR:No-Issue labels Dec 15, 2022
Copy link

@Atharv181 Atharv181 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Hacktoberfest Accepted Pull Requests PR:Ready-to-Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add modifier to BankingSystem.sol
2 participants