Skip to content

Commit

Permalink
fix: safe operations
Browse files Browse the repository at this point in the history
  • Loading branch information
yan-man committed Oct 15, 2024
1 parent 0201eea commit b11bfc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/contracts/facilitators/gsm/converter/GsmConverter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ contract GsmConverter is Ownable, EIP712, IGsmConverter {

(, uint256 ghoAmount, , ) = IGsm(GSM).getGhoAmountForBuyAsset(minAmount);

IGhoToken(GHO_TOKEN).transferFrom(originator, address(this), ghoAmount);
IERC20(GHO_TOKEN).safeTransferFrom(originator, address(this), ghoAmount);
IGhoToken(GHO_TOKEN).approve(address(GSM), ghoAmount);
(uint256 boughtAssetAmount, uint256 ghoSold) = IGsm(GSM).buyAsset(minAmount, address(this));
require(ghoAmount == ghoSold, 'INVALID_GHO_SOLD');
Expand Down Expand Up @@ -231,7 +231,7 @@ contract GsmConverter is Ownable, EIP712, IGsmConverter {
uint256 initialRedeemedAssetBalance = IERC20(REDEEMED_ASSET).balanceOf(address(this));

(uint256 assetAmount, , , ) = IGsm(GSM).getGhoAmountForSellAsset(maxAmount); // asset is BUIDL
IERC20(REDEEMED_ASSET).transferFrom(originator, address(this), assetAmount);
IERC20(REDEEMED_ASSET).safeTransferFrom(originator, address(this), assetAmount);
IERC20(REDEEMED_ASSET).approve(SUBSCRIPTION_CONTRACT, assetAmount);
//TODO: replace with proper issuance implementation later
MockBUIDLSubscription(SUBSCRIPTION_CONTRACT).issuance(assetAmount);
Expand Down

0 comments on commit b11bfc6

Please sign in to comment.