Skip to content

Commit

Permalink
fix: add check for ERC721 topic hash length
Browse files Browse the repository at this point in the history
  • Loading branch information
sahar-fehri committed Jun 26, 2024
1 parent bd812d7 commit 3c1c3b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6338,7 +6338,7 @@ export default class MetamaskController extends EventEmitter {
type === TransactionType.contractInteraction && txReceiptLogs;
const isTransferFromTx =
(type === TransactionType.tokenMethodTransferFrom ||
type === TransactionType.tokenMethodSafeTransferFrom) && // TODO add check for tokenMethodSafeTransferFrom
type === TransactionType.tokenMethodSafeTransferFrom) &&
txParams !== undefined;

if (!isContractInteractionTx && !isTransferFromTx) {
Expand Down Expand Up @@ -6381,6 +6381,7 @@ export default class MetamaskController extends EventEmitter {
txReceiptLog.topics[0] === TRANSFER_SINFLE_LOG_TOPIC_HASH;
const isERC721NftTransfer =
txReceiptLog.topics &&
txReceiptLog.topics.length === 2 && // Added this check because TOKEN_TRANSFER_LOG_TOPIC_HASH is the same for ERC20 and ERC721
txReceiptLog.topics[0] === TOKEN_TRANSFER_LOG_TOPIC_HASH;
let isTransferToSelectedAddress;

Expand Down

0 comments on commit 3c1c3b6

Please sign in to comment.