Querying and Transferring Stake
The ConditionalTokens contract implements the ERC1155 multitoken interface. In addition to a holder address, each token is indexed by an ID in this standard. In particular, position IDs are used to index conditional tokens. This is reflected in the balance querying function:
function balanceOf (address owner, uint256 positionId) external view returns (uint256)
To transfer conditional tokens, the following functions may be used, as per ERC1155:
function safeTransferFrom (address from, address to, uint256 positionId, uint256 value, bytes data) external function safeBatchTransferFrom (address from, address to, uint256[] positionIds, uint256[] values, bytes data) external
These transfer functions ignore the data
parameter.
Note When sending to contract accounts, transfers will be rejected unless the recipient implements the
ERC1155TokenReceiver
interface and returns the expected magic values. See the ERC1155 multitoken spec for more information.
Approving an operator account to transfer conditional tokens on your behalf may also be done via:
function setApprovalForAll (address operator, bool approved) external
Querying the status of approval can be done with:
function isApprovalForAll (address owner, address operator) external view returns (bool)