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
  3. ✧ Preparing

Encode ERC1155 Asset

make1155Asset( )

function make1155Asset(address addr, uint120 tokenId, uint120 tokenAmount) external pure returns (struct ISwap.Asset)

Make an {ISwap-Asset} struct to work with token standards.

NOTE Different from the {makeAsset} function, this function is used to encode the token ID and token amount into a single uint256. This is made to work with the ERC1155 standard.

Parameters

Name
Type
Description

addr

address

is the address of the token asset.

tokenId

uint120

is the ID of the ERC1155 token.

tokenAmount

uint120

is the amount of the ERC1155 token.

PreviousEncode configNextMake Swap

Last updated 11 months ago