From 277c5cc5b1df6fcee9749ab7f5d1c7fd7a47a6c6 Mon Sep 17 00:00:00 2001 From: Jack Sparrow Date: Tue, 22 Mar 2022 10:11:32 +0530 Subject: [PATCH] Replace safeApprove -> approve Refer https://github.com/OpenZeppelin/openzeppelin-contracts/issues/2219 --- contracts/WarpIn.sol | 6 +++--- contracts/WarpOut.sol | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/WarpIn.sol b/contracts/WarpIn.sol index 62d203b..57feddc 100644 --- a/contracts/WarpIn.sol +++ b/contracts/WarpIn.sol @@ -191,8 +191,8 @@ contract WarpInV1 is WarpBaseV1 { uint256 token1Amount ) internal returns (uint256) { // Approve the tokens - token0.safeApprove(address(solarRouter), token0Amount); - token1.safeApprove(address(solarRouter), token1Amount); + token0.approve(address(solarRouter), token0Amount); + token1.approve(address(solarRouter), token1Amount); // Add liquidity to the token0 & token1 pair (uint256 amount0, uint256 amount1, uint256 LPBought) = solarRouter @@ -225,7 +225,7 @@ contract WarpInV1 is WarpBaseV1 { address[] memory path ) internal returns (uint256 amountBought) { // Approve the solarRouter to spend the contract's `from` token. - from.safeApprove(address(solarRouter), amount); + from.approve(address(solarRouter), amount); uint256 lastInPath = path.length - 1; // Swap the tokens through solarRouter amountBought = solarRouter.swapExactTokensForTokens( diff --git a/contracts/WarpOut.sol b/contracts/WarpOut.sol index 331146f..838bc75 100644 --- a/contracts/WarpOut.sol +++ b/contracts/WarpOut.sol @@ -197,7 +197,7 @@ contract WarpOutV1 is WarpBaseV1 { address[] memory path ) internal returns (uint256 movrAmount) { if (address(token) != address(wMOVR)) { - token.safeApprove(address(solarRouter), amount); + token.approve(address(solarRouter), amount); movrAmount = solarRouter.swapExactTokensForETH( amount, @@ -224,7 +224,7 @@ contract WarpOutV1 is WarpBaseV1 { address[] memory path ) internal returns (uint256 amountBought) { // Approve the solarRouter to spend the contract's `from` token. - from.safeApprove(address(solarRouter), amount); + from.approve(address(solarRouter), amount); // Swap the tokens through solarRouter amountBought = solarRouter.swapExactTokensForTokens(