Swaplace
  • About Swaplace
    • Manifesto
    • Overview
    • Roadmap
    • Tokenomics (🚧)
    • Start swaping with Swaplace
    • Marketplace
    • Call for contributors
      • ✧ How to start
      • ✧ Incentives
    • Community & Links
  • Developers
    • Guides
      • ✧ Overview
      • ✧ Setting up your local environment
      • ✧ Preparing
        • Encode config
        • Encode ERC1155 Asset
        • Make Swap
      • ✧ Creating
        • ERC20/ERC721
        • ERC1155
        • Native Ether
      • ✧ Accepting
      • ✧ Canceling
    • Technical Reference
      • ✧ Overview
      • ✧ Swaplace
      • ✧ SwapFactory
      • ✧ Interfaces
        • ✧ IERC165
        • ✧ IErrors
        • ✧ ISwap
        • ✧ ISwapFactory
        • ✧ ISwaplace
    • Deployments
Powered by GitBook
On this page
  1. Developers
  2. Guides

✧ Accepting

AcceptSwap

function acceptSwap(uint256 swapId, address receiver) external payable returns (bool)

Accepts a Swap. Once the Swap is accepted, the expiry is set to zero to avoid reutilization.

Requirements:

  • allowed must be the zero address or match the caller's address.

  • expiry must be bigger than the timestamp.

  • biding assets must be allowed to transfer.

  • asking assets must be allowed to transfer.

Emits a {SwapAccepted} event.

Parameters

Name
Type
Description

swapId

uint256

is the ID of the Swap to be accepted.

receiver

address

is the address that will receive the trading assets.

Name
Type
Description

swapId

uint256

is the ID of the Swap to be accepted.

receiver

address

is the address that will receive the trading assets.

PreviousNative EtherNext✧ Canceling

Last updated 11 months ago