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

1 stars 0 forks source link

Function can be simplified #254

Closed code423n4 closed 3 years ago

code423n4 commented 3 years ago

Handle

s1m0

Vulnerability details

Impact

The logic of the following functions can be simplified reducing the gas cost.

Proof of Concept

https://github.com/code-423n4/2021-04-vader/blob/main/vader-protocol/contracts/Vader.sol#L163 https://github.com/code-423n4/2021-04-vader/blob/main/vader-protocol/contracts/Vader.sol#L171

Tools Used

Manual analysis

Recommended Mitigation Steps

function flipEmissions() external onlyDAO { emitting = !emitting; }

same thing with flipMinting.

0xBrian commented 3 years ago

https://github.com/vetherasset/vaderprotocol-contracts/commit/b98b6358f1d8b7730d3fe767e01d49ca63d830e9#diff-f5afe9240d284bf89e33b79c68c1ab21a6c18323c11d480d25144c18b8a9373aR176

dmvt commented 3 years ago

duplicate of #197