Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 947 Bytes

README.md

File metadata and controls

41 lines (31 loc) · 947 Bytes

EIP712-Readability

The SDK can parse structured data from EIP-712 messages, which ensures that users understand information related to asset security before signing. This includes ERC20 approval, NFT listing, and other relevant details.

Install

yarn add @scamsniffer/eip712-readability

Usage

import { Security, parseRequest } from "@scamsniffer/eip712-readability";

const eip721TypedMessage = ....;
const parsedMessage = parseRequest(eip721TypedMessage);

if (parsedMessage.kind === "nft") {
  // Built-in price-based NFT Listing check
  const hasIssueMesssages = await Security.checkNFTMessages([parsedMessage.detail]);
  if (hasIssueMesssages.length) {
    console.log("Suspicious messages detected")
  }
}

Supported Protocols

Permit

  • Permit2
  • ERC20 Permit
  • Dai Permit

NFT Protocols

  • Seaport
  • Seaport-1.4
  • Blur
  • LooksRare
  • Element
  • ZeroEx-V4