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