code-423n4 / 2021-04-vader-findings

1 stars 0 forks source link

Unnecessary logic that will never get triggered in DAO.sol #186

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

0xRajeev

Vulnerability details

Impact

The conditional checking if proposal has quorum in finaliseProposal() is unnecessary and will never be triggered because finalising proposals will always have quorum. Proposal without quorum are not finalised in the voteProposal() function.

Removing this code will reduce contract size and save some gas.

Proof of Concept

https://github.com/code-423n4/2021-04-vader/blob/3041f20c920821b89d01f652867d5207d18c8703/vader-protocol/contracts/DAO.sol#L114-L116

https://github.com/code-423n4/2021-04-vader/blob/3041f20c920821b89d01f652867d5207d18c8703/vader-protocol/contracts/DAO.sol#L82-L90

https://github.com/code-423n4/2021-04-vader/blob/3041f20c920821b89d01f652867d5207d18c8703/vader-protocol/contracts/DAO.sol#L94-L99

Tools Used

Manual Analysis

Recommended Mitigation Steps

Remove code from L114 to L116.

0xBrian commented 3 years ago

https://github.com/vetherasset/vaderprotocol-contracts/commit/f7c7085af0eb871ba80db3932acc703fd6d3623c