Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace safeApprove -> approve #1

Merged
merged 1 commit into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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