Open code423n4 opened 2 years ago
0x0x0x
There is no need to cache calculation steps between the return values. L98-L122 is as follows:
L98-L122
uint256 _endingBalance = _token.balanceOf(_recipient); uint256 _withdrawnAmount = _token.balanceOf(_recipient).sub(_startingBalance); uint256 _endingTotalValue = _self.totalValue(); uint256 _decreasedValue = _startingTotalValue.sub(_endingTotalValue);
Which can be replaced by following code to save gas:
uint256 _withdrawnAmount = _token.balanceOf(_recipient).sub(_startingBalance); uint256 _decreasedValue = _startingTotalValue.sub(_self.totalValue());
Manual analysis
Handle
0x0x0x
Vulnerability details
Proof of Concept
There is no need to cache calculation steps between the return values.
L98-L122
is as follows:Which can be replaced by following code to save gas:
Tools Used
Manual analysis