ILiquid1155

Git Source

Inherits: IERC165

Author: 0xvv @ Kiln

This contract allows users to stake in any of the vPools with any amount of ETH and track their position. Users are given transferable shares to track their stake, shares of different pools are not equivalent. Users can interact with the contract using the ERC-1155 interface.

Functions

setApprovalForAll

Give the right to an operator to transfer all tokens of the sender.

function setApprovalForAll(address operator, bool approved) external;

Parameters

NameTypeDescription
operatoraddressThe address of the operator.
approvedboolThe status of the operator.

isApprovedForAll

Returns the operator status of an operator for a given owner.

function isApprovedForAll(address account, address operator) external view returns (bool);

Parameters

NameTypeDescription
accountaddressThe address of the owner.
operatoraddressThe address of the operator.

safeTransferFrom

Transfers amount tokens of token type id from from to to with extra data.

The caller must be operator of 'from' or 'from' & 'from' must have a balance of at least amount.

function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;

Parameters

NameTypeDescription
fromaddressThe address of the sender.
toaddressThe address of the receiver.
iduint256The id of the token.
amountuint256The token amount.
databytesThe data passed to the receiver.

safeBatchTransferFrom

Batched version of safeTransferFrom.

function safeBatchTransferFrom(address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data)
    external;

Parameters

NameTypeDescription
fromaddressThe address of the sender.
toaddressThe address of the receiver.
idsuint256[]The ids of the tokens.
amountsuint256[]The token amounts.
databytesThe data passed to the receiver.

Events

ApprovalForAll

Emitted when the status of an operator is changed.

event ApprovalForAll(address indexed account, address indexed operator, bool approved);

Parameters

NameTypeDescription
accountaddressThe account of the owner.
operatoraddressThe operator whose status is being updated.
approvedboolThe new status of the operator.

Errors

ApprovalForSelf

Emitted when a user trier to approve themselves.

error ApprovalForSelf();

ReceiverRejected

Emitted when a the ERC-1155 receiver rejects the transfer.

error ReceiverRejected(address receiver, uint256 id, uint256 amount, bytes data);

Parameters

NameTypeDescription
receiveraddressThe address of the receiver.
iduint256The id of the token.
amountuint256The token amount.
databytesThe data passed to the receiver.

ReceiverRejectedBatch

Emitted when a the ERC-1155 receiver rejects a batch of transfers.

error ReceiverRejectedBatch(address receiver, uint256[] ids, uint256[] amounts, bytes data);

Parameters

NameTypeDescription
receiveraddressThe address of the receiver.
idsuint256[]The ids of the tokens.
amountsuint256[]The token amounts.
databytesThe data passed to the receiver.

NotAnERC1155Receiver

Emitted when a transfer is attempted but the sender is not a receiver.

error NotAnERC1155Receiver(address receiver);

Parameters

NameTypeDescription
receiveraddressThe address of the receiver.