-
Notifications
You must be signed in to change notification settings - Fork 0
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
Prevent Duplicate Employee Entries in addemp function #145
Prevent Duplicate Employee Entries in addemp function #145
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Our team will soon review your PR. Thanks @adil-techcode :) |
contracts/Sal.sol
Outdated
@@ -20,17 +21,22 @@ contract allemp{ | |||
function addemp ( | |||
string memory _FirstName, | |||
string memory _LastName, | |||
string memory _wallet_ddress, | |||
string memory _wallet_address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why wallet address is of type String it should be of type address
Eg something like "address _wallet_address" to ensure that only valid Ethereum addresses can be used as employee wallet addresses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I will update to Variable Type String For only Valid Ethereum Address.
Variable Type Updated To Address and in all Wallet Address Variables |
Thank you @adil-techcode for taking out your valuable time in order to contribute to our project. Looking forward for more such amazing contributions :) |
issue #92
I encountered an issue in the addemp function of the allemp contract, where duplicate employee entries are not being prevented. After investigating the code, I found that the function lacks a check for existing employees, resulting in duplicate entries.
To address this issue, I propose implementing a "require" condition in the addemp function. This condition will check if the employee already exists and revert the transaction to prevent duplicate entries. This solution will enhance the efficiency of the contract by avoiding unnecessary gas fees.
#92