File tree Expand file tree Collapse file tree
lib/pages/open_crypto_pay Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -168,6 +168,11 @@ class _OpenCryptoPayConfirmViewState
168168 return null ;
169169 }
170170
171+ bool _matchesQuotedAmount (Decimal amount) {
172+ final quotedAmount = Decimal .tryParse (widget.selectedAsset.amount);
173+ return quotedAmount != null && amount.compareTo (quotedAmount) == 0 ;
174+ }
175+
171176 Future <EthTokenWallet > _loadTokenWallet (EthContract contract) async {
172177 final wallet = ref.read (pWallets).getWallet (widget.walletId);
173178 if (wallet is ! EthereumWallet ) {
@@ -275,6 +280,10 @@ class _OpenCryptoPayConfirmViewState
275280 _warn ("Could not parse payment amount" );
276281 return ;
277282 }
283+ if (! _matchesQuotedAmount (parsed.amount! )) {
284+ _warn ("Payment amount does not match the quoted amount" );
285+ return ;
286+ }
278287 if (parsed.scheme != null &&
279288 parsed.scheme! .isNotEmpty &&
280289 parsed.scheme != widget.coin.uriScheme) {
@@ -354,6 +363,11 @@ class _OpenCryptoPayConfirmViewState
354363 }
355364
356365 final amount = evmUri.amount (fractionDigits: contract.decimals);
366+ if (! _matchesQuotedAmount (amount)) {
367+ _warn ("Payment amount does not match the quoted amount" );
368+ return ;
369+ }
370+
357371 final autoFillData = SendViewAutoFillData (
358372 address: evmUri.recipientAddress! ,
359373 contactLabel: recipient,
You can’t perform that action at this time.
0 commit comments