Skip to content

Commit

Permalink
fix: add check in _transferToken
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroEkkusu committed Apr 11, 2024
1 parent 344af89 commit e763e11
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contracts/staking/stakeManager/StakeManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e763e11

Please sign in to comment.