Skip to content

Commit

Permalink
Replace safeApprove -> approve
Browse files Browse the repository at this point in the history
  • Loading branch information
JackSparrowYB committed Mar 22, 2022
1 parent 7f82c00 commit 277c5cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions contracts/WarpIn.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions contracts/WarpOut.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand Down

0 comments on commit 277c5cc

Please sign in to comment.