web3-smart-contracts
web3-smart-contracts copied to clipboard
Added modifier to remove duplication
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
Developer's checklist
- [X] My PR follows the style guidelines of this project
- [X] I have performed a self-check
If changes are made in the code:
- [X] I have followed the coding guidelines
- [X] My changes in code generate no new warnings
- [X] I have added relevant screenshots in my PR
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
PR is not linked to any issue, please make the corresponding changes in the body.
PR is not linked to any issue, please make the corresponding changes in the body.