LogoLogo
  • Introduction
  • Network
    • SXP
    • Staking
    • Governance
    • API
  • Swap
    • Smart Contract
      • Implement a Swap
      • Providing Liquidity
      • Building an Oracle
      • Flash Swaps
      • Pair Addresses
      • Supporting meta transactions
    • Subgraph API
      • Exchange
        • Entities
        • Queries
      • MasterChef
        • Entities
        • Queries
    • Reference
      • Smart Contracts
  • Swipechain
    • Introduction
    • Swipe Nodes
      • Churn
      • Bitfrost
      • Transactions
      • Continuous Liquidity Pools
      • Incentivizes
      • Governance
    • Run SwipeChain
      • Build on Source Code
      • Build with Script
    • Developers
      • How to contribute
      • Connecting to SwipeNode
  • Staking
  • Staking Details
    • Swipe Network
    • SXP Bonding
    • Unbond SXP
  • Metamask
    • Add Swipe Token
    • Deposit SXP
    • Connect MetaMask
    • Stake SXP
  • Trust Wallet
    • Add Swipe Token
    • Deposit SXP
    • Connect Trust Wallet
    • Stake SXP
  • Ledger
    • Connect Ledger
    • Add Swipe Token
    • Deposit SXP
    • Connect to Swipe
    • Stake SXP
  • View your Rewards
  • Claim Your Rewards
  • Governance
    • Vote
    • Proposals
  • FAQ
    • Frequently Asked Questions
Powered by GitBook
On this page
  • ERC-712
  • Domain Separator

Was this helpful?

  1. Swap
  2. Smart Contract

Supporting meta transactions

PreviousPair AddressesNextSubgraph API

Last updated 4 years ago

Was this helpful?

All Swipeswap pool tokens support meta-transaction approvals via the permit function. This obviates the need for a blocking approve transaction before programmatic interactions with pool tokens can occur.

ERC-712

In vanilla ERC-20 token contracts, owners may only register approvals by directly calling a function which uses msg.sender to permission itself. With meta-approvals, ownership and permissioning are derived from a signature passed into the function by the caller (sometimes referred to as the relayer). Because signing data with Ethereum private keys can be a tricky endeavor, Swipeswap relies on , a signature standard with widespread community support, to ensure user safety and wallet compatibility.

Domain Separator

keccak256(
  abi.encode(
    keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),
    keccak256(bytes(name)),
    keccak256(bytes('1')),
    chainId,
    address(this)
  )
);
  • name is always Uniswap V2.

  • chainId is determined from the chainid opcode.

  • address(this) is the address of the pair, see .

keccak256('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)');`
ERC-712
ERC-1344
Pair Addresses