EthosVote does not implement targetExistsAndAllowedForId() function
Summary
All Ethos contracts but EthosVote implement the targetExistsAndAllowedForId() function. This function is used to check if an id exists for a contract. Specifically, if this is not implemented, users cannot add a reply, or vote for an EthosVote entity.
Root Cause
In EthosDiscussion#addReply and EthosVote#voteFor functions, the ITargetStatus(targetContract).targetExistsAndAllowedForId(targetId) is always checked. Since EthosVote doesn't implement this, this means users can't add a reply or vote for an EthosVote entity.
pkqs90
Medium
EthosVote does not implement
targetExistsAndAllowedForId()
functionSummary
All Ethos contracts but EthosVote implement the
targetExistsAndAllowedForId()
function. This function is used to check if an id exists for a contract. Specifically, if this is not implemented, users cannot add a reply, or vote for an EthosVote entity.Root Cause
In EthosDiscussion#addReply and EthosVote#voteFor functions, the
ITargetStatus(targetContract).targetExistsAndAllowedForId(targetId)
is always checked. Since EthosVote doesn't implement this, this means users can't add a reply or vote for an EthosVote entity.https://github.com/sherlock-audit/2024-10-ethos-network/blob/main/ethos/packages/contracts/contracts/EthosDiscussion.sol#L300
https://github.com/sherlock-audit/2024-10-ethos-network/blob/main/ethos/packages/contracts/contracts/EthosVote.sol#L142
Internal pre-conditions
N/A
External pre-conditions
N/A
Attack Path
N/A
Impact
Users can't add a reply or vote for an EthosVote entity.
PoC
N/A
Mitigation
Implement the
targetExistsAndAllowedForId()
function for EthosVote.