Skip to content

Commit

Permalink
convert from stable coin to ETH
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelcabot committed Dec 20, 2022
1 parent 9f062d0 commit 430cb2c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions contracts/tokens/MasaSBTSelfSovereign.sol
Expand Up @@ -135,8 +135,15 @@ abstract contract MasaSBTSelfSovereign is PaymentGateway, MasaSBT, EIP712 {
} else if (
paymentMethod == stableCoin && enabledPaymentMethod[paymentMethod]
) {
// stable coin
return mintPrice;
} else if (
paymentMethod == address(0) && enabledPaymentMethod[paymentMethod]
) {
// ETH
return _convertFromStableCoin(wrappedNativeToken, mintPrice);
} else if (enabledPaymentMethod[paymentMethod]) {
// ERC 20 token
return _convertFromStableCoin(paymentMethod, mintPrice);
} else {
revert InvalidPaymentMethod(paymentMethod);
Expand Down

0 comments on commit 430cb2c

Please sign in to comment.