sherlock-audit / 2024-10-ethos-network-judging

0 stars 0 forks source link

Acrobatic Burlap Lizard - Hardcoded values could lead to errors #329

Closed sherlock-admin3 closed 2 weeks ago

sherlock-admin3 commented 2 weeks ago

Acrobatic Burlap Lizard

Low/Info

Hardcoded values could lead to errors

Summary

Hardcoded values could lead to unexpected behaviours when code before or after change. Avoiding it by using dynamic values is always preferred.

Root Cause

In EthosProfile there are two hardcoded at lines #137 #139

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

No response

PoC

No response

Mitigation

Substitute lines 136-139 with the following:

uint256 ownerprofileId = _createProfile(owner);
profiles[ownerprofileId].inviteInfo.available = 10;
profiles[ownerprofileId].inviteInfo.invitedBy = 1;