✧ Overview
Last updated
Last updated
Follow trhough guide to learn how to run the Swaplace locally
Swaplace provides utility functions to efficiently encode and decode assets and configuration data, optimizing storage and retrieval processes. To encode an asset, it uses the and functions to convert ERC20, ERC721 and ERC1155 token IDs and amounts into a single data unit.
When , the smart contract needs to assemble a Swap struct with detailed parameters including the owner, allowed participants, expiry date, recipient, value, and the assets being offered and requested. This structured approach ensures that all necessary information is included for a successful swap.
Swaplace allows users to or swaps with ease.
To accept a swap, ensure that the allowed address matches the caller's address or is set to zero, and that the expiry date is valid. Once a swap is accepted, its expiry is set to zero to prevent reuse.
If you need to cancel a swap, you can do so by setting its expiry to zero, provided that you are the owner and the expiry date is still valid.