Seer documentation
  • Overview
    • 📘 What is Seer?
    • 📚 Glossary
  • Getting Started
    • 💡 Wallet and network
    • 💰 Deposit tokens
      • On Ethereum
        • Deposit DAI
        • Deposit sDAI
      • On Gnosis
        • Deposit xDAI
        • Deposit wxDAI or sDAI
    • 🧭 Navigate Our Site
      • Create a market
      • Verify market
      • Mint, merge, redeem outcome tokens
      • Buy, sell outcome tokens
      • Report answer
      • Raise a dispute
      • Resolve market
      • Provide Liquidity
      • Conditional Markets
      • Futarchy Markets
  • Developers
    • 📝 Intro
    • 🔄 Diagrams
      • Seer overall interaction
      • Create Market
      • Split, Merge, Redeem
      • Question and Resolve
    • 🔗 Interact with Seer
      • Create a market
      • Resolve a market
      • Split, Merge and Redeem
      • Market example
      • Conditional market
      • Futarchy market
    • 📜 Contracts
      • Core
        • MarketFactory
        • Market
        • MarketView
        • Router
        • GnosisRouter
        • MainnetRouter
        • RealityProxy
        • Interfaces
      • Futarchy (test)
        • FutarchyFactory
        • FutarchyProposal
        • FutarchyRouter
        • FutarchyRealityProxy
      • Token
        • Seer
      • Interaction
        • 1155-to-20
          • Wrapped1155Factory
        • conditional-tokens
          • ERC1155
            • ERC1155
            • ERC1155TokenReceiver
            • IERC1155
            • IERC1155TokenReceiver
          • ConditionalTokens
          • CTHelpers
        • cross-chain-realitio-proxy
          • dependencies
            • IAMB
            • RealitioInterface
          • ArbitrationProxyInterfaces
          • RealitioForeignArbitrationProxyWithAppeals
          • RealitioHomeArbitrationProxy
        • reality
          • RealityETH-3.0
        • sDAI-on-Gnosis
          • interfaces
            • IBridgeInterestReceiver
            • IWXDAI
          • periphery
            • SavingsXDaiAdapter
          • SavingsXDai
      • Deployed contracts
    • 🌐 Subgraph
      • Query Examples
      • GraphQl Query
        • Market
        • Swapr
        • Curate
      • GraphQL Schema
      • Subgraph ID
  • OTHER
    • 🔍 Audit Reports
Powered by GitBook
On this page
  • Functions
  • onERC1155Received
  • onERC1155BatchReceived
  1. Developers
  2. 📜 Contracts
  3. Interaction
  4. conditional-tokens
  5. ERC1155

ERC1155TokenReceiver

Functions

onERC1155Received

function onERC1155Received(address operator, address from, uint256 id, uint256 value, bytes data) external returns (bytes4)

Handles the receipt of a single ERC1155 token type. This function is called at the end of a safeTransferFrom after the balance has been updated. To accept the transfer, this must return bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")) (i.e. 0xf23a6e61, or its own function selector).

Parameters

Name
Type
Description

operator

address

The address which initiated the transfer (i.e. msg.sender)

from

address

The address which previously owned the token

id

uint256

The ID of the token being transferred

value

uint256

The amount of tokens being transferred

data

bytes

Additional data with no specified format

Return Values

Name
Type
Description

[0]

bytes4

bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")) if transfer is allowed

onERC1155BatchReceived

function onERC1155BatchReceived(address operator, address from, uint256[] ids, uint256[] values, bytes data) external returns (bytes4)

Handles the receipt of a multiple ERC1155 token types. This function is called at the end of a safeBatchTransferFrom after the balances have been updated. To accept the transfer(s), this must return bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)")) (i.e. 0xbc197c81, or its own function selector).

Parameters

Name
Type
Description

operator

address

The address which initiated the batch transfer (i.e. msg.sender)

from

address

The address which previously owned the token

ids

uint256[]

An array containing ids of each token being transferred (order and length must match values array)

values

uint256[]

An array containing amounts of each token being transferred (order and length must match ids array)

data

bytes

Additional data with no specified format

Return Values

Name
Type
Description

[0]

bytes4

bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)")) if transfer is allowed

PreviousERC1155NextIERC1155

Last updated 8 months ago