Skip to content

Commit

Permalink
remove approve()
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonhuan committed Dec 2, 2020
1 parent d1cb9a7 commit c476638
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions contracts/Frax/Pools/FraxPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ contract FraxPool is AccessControl {
lastRedeemed[msg.sender] = block.number;

require(COLLATERAL_out_min <= collateral_needed, "Slippage limit reached");

// Move all external functions to the end
FRAX.pool_burn_from(msg.sender, FRAX_amount);
collateral_token.approve(msg.sender, collateral_needed);
}

// Will fail if fully collateralized or algorithmic
Expand Down Expand Up @@ -271,8 +271,6 @@ contract FraxPool is AccessControl {

// Move all external functions to the end
FRAX.pool_burn_from(msg.sender, FRAX_amount);
collateral_token.approve(msg.sender, collateral_amount);
FXS.approve(msg.sender, fxs_amount);
FXS.pool_mint(address(this), fxs_amount);
}

Expand All @@ -293,7 +291,6 @@ contract FraxPool is AccessControl {
require(FXS_out_min <= fxs_amount, "Slippage limit reached");
// Move all external functions to the end
FRAX.pool_burn_from(msg.sender, FRAX_amount);
FXS.approve(msg.sender, fxs_amount);
FXS.pool_mint(address(this), fxs_amount);
}

Expand Down

0 comments on commit c476638

Please sign in to comment.