From 0b0d4282b941ca7231e3f69700fc03f41282290b Mon Sep 17 00:00:00 2001 From: Zero Ekkusu <94782988+ZeroEkkusu@users.noreply.github.com> Date: Thu, 11 Apr 2024 10:10:45 +0200 Subject: [PATCH] fix: add check in --- contracts/staking/stakeManager/StakeManager.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contracts/staking/stakeManager/StakeManager.sol b/contracts/staking/stakeManager/StakeManager.sol index 90d4d851..3ba68b82 100644 --- a/contracts/staking/stakeManager/StakeManager.sol +++ b/contracts/staking/stakeManager/StakeManager.sol @@ -1131,10 +1131,11 @@ contract StakeManager is StakeManagerStorage, Initializable, IStakeManager, Dele } // @note _transferTokenFrom + // Do not use this function to transfer from self. function _transferTokenFrom(address from, address destination, uint256 amount, bool legacy) private { IERC20 token_ = _getToken(legacy); require(token_.transferFrom(from, destination, amount), "transfer from failed"); - if (legacy) _convertMaticToPol(amount); + if (legacy && destination == address(this)) _convertMaticToPol(amount); } // @note