Gnosis Developer Portal Conditional Tokens

Gnosis Developer Portal Conditional Tokens

  • Introduction
  • Use Case
  • Documentation
  • Tutorials
  • Support

›Conditional Tokes Tutorial

Conditional Tokes Tutorial

  • Introduction
  • Setup
  • Conditions
  • Bit Arrays
  • Basic Outcome Collections
  • Positions
  • Splitting From Collateral
  • Splitting Unions
  • Combining Outcome Collections
  • Splitting to Deeper Positions
  • Merging Positions
  • Transferring to EOA addresses
  • Transferring to Contract Addresses
  • Reporting Payouts
  • Basic Redemption
  • Deeper Redemptions
  • Reporting Scalar markets
  • Scalar Redemptions

Transferring to EOA addresses


As conditional tokens follow the ERC-1155 standard, they can be transferred between accounts using the safeTranserferFrom() and safeBatchTransferFrom() functions.

Let's first start with the case where we're transferring to an externally owned account. Call balanceOfBatch() again to check your balances in the different positions you have created and pick one to transfer to a different account.

Then call safeTranserferFrom() with the following parameters:

  • from: your addresses
  • to: the address you want to send to
  • id: the position ID of the position you would like to transfer
  • amount: the amount of the position you would like to transfer
  • data: ignore this for now and just specify empty bytes 0x

Now call balanceOfBatch() with the address you used for the to parameter in your last transaction as the address and you should see the balance of this addresses positions have changed to reflect the transfer.

It is also woth noting that you can approve other addresses to transfer your ERC1155 tokens from your address by calling the setApprovalForAll().


Next we'll talk about transferring to contract accounts.

← Merging PositionsTransferring to Contract Addresses →
Gnosis Ltd.
ImprintCopyright
© 2020 Gnosis LTD
Privacy Policy
Copyright © 2025 Gnosis LTD