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

Prevent Duplicate Employee Entries in addemp function #145

Closed

Conversation

adil-techcode
Copy link

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

@vercel
Copy link

vercel bot commented May 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sa-l-d-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2023 5:01pm

@github-actions
Copy link

Our team will soon review your PR. Thanks @adil-techcode :)

@@ -20,17 +21,22 @@ contract allemp{
function addemp (
string memory _FirstName,
string memory _LastName,
string memory _wallet_ddress,
string memory _wallet_address,

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.

Copy link
Author

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.

@adil-techcode
Copy link
Author

Variable Type Updated To Address and in all Wallet Address Variables

Copy link

Thank you @adil-techcode for taking out your valuable time in order to contribute to our project. Looking forward for more such amazing contributions :)

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.

3 participants