Lucene search

K
code423n4Code4renaCODE423N4:2021-09-YAXIS-FINDINGS-ISSUES-113
HistorySep 15, 2021 - 12:00 a.m.

YAxisVotePower.balanceOf can be manipulated

2021-09-1500:00:00
Code4rena
github.com
11

Handle

cmichel

Vulnerability details

The YAxisVotePower.balanceOf contract uses the Uniswap pool reserves to compute a _lpStakingYax reward:

(uint256 _yaxReserves,,) = yaxisEthUniswapV2Pair.getReserves();
int256 _lpStakingYax = _yaxReserves
      .mul(_stakeAmount)
      .div(_supply)
      .add(rewardsYaxisEth.earned(_voter));

The pool can be temporarily manipulated to increase the _yaxReserves amount.

Impact

If this voting power is used for governance proposals, an attacker can increase their voting power and pass a proposal.

Recommended Mitigation Steps

One could build a TWAP-style contract that tracks a time-weighted-average reserve amount (instead of the price in traditional TWAPs).
This can then not be manipulated by flashloans.


The text was updated successfully, but these errors were encountered:

All reactions