Overt Tweed Stork
High
In AmirX::_buyBack() incorrect POL amount is passed to aggregator as msg.value.
The root cause of the issue is in AmirX::_buyBack() msg.value of swap() is used as payer source when feeToken is POL.
if (address(feeToken) == POL) {
(bool polSwap, ) = aggregator.call{value: msg.value}(swapData);
But it should use the balance of the AmirX as payer source i.e instead of msg.value it should use address(this).balance.
None.
None.
None.
Incorrect POL amount will be sent to aggregator which result miscalculation in aggregator.
... codes
if (address(feeToken) == POL) {
- (bool polSwap, ) = aggregator.call{value: msg.value}(swapData);
+ (bool polSwap, ) = aggregator.call{value: address(this).balance}(swapData);
... codes