Liquid1155
Inherits: Native1155, ILiquid1155
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
State Variables
$approvals
Stores the approvals.
Type: mapping(address => mapping(address => bool))
Slot: keccak256(bytes("liquid1155.1.approvals")) - 1
uctypes.OperatorApprovalsMapping internal constant $approvals =
uctypes.OperatorApprovalsMapping.wrap(0xf49f1126f15fa50e7f83c3d26f874246f4209fea59edc2c13d900d8b240b28c5);
Functions
setApprovalForAll
Give the right to an operator to transfer all tokens of the sender.
function setApprovalForAll(address operator, bool approved) external;
Parameters
| Name | Type | Description |
|---|---|---|
operator | address | The address of the operator. |
approved | bool | The status of the operator. |
isApprovedForAll
Returns the operator status of an operator for a given owner.
function isApprovedForAll(address account, address operator) public view returns (bool);
Parameters
| Name | Type | Description |
|---|---|---|
account | address | The address of the owner. |
operator | address | The 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 memory data) public virtual override;
Parameters
| Name | Type | Description |
|---|---|---|
from | address | The address of the sender. |
to | address | The address of the receiver. |
id | uint256 | The id of the token. |
amount | uint256 | The token amount. |
data | bytes | The data passed to the receiver. |
safeBatchTransferFrom
Batched version of safeTransferFrom.
function safeBatchTransferFrom(address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)
public
virtual
override;
Parameters
| Name | Type | Description |
|---|---|---|
from | address | The address of the sender. |
to | address | The address of the receiver. |
ids | uint256[] | The ids of the tokens. |
amounts | uint256[] | The token amounts. |
data | bytes | The data passed to the receiver. |
supportsInterface
function supportsInterface(bytes4 interfaceId) public pure returns (bool);
_safeTransferFrom
Private functions
function _safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes memory data) internal virtual;
_safeBatchTransferFrom
function _safeBatchTransferFrom(address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)
internal
virtual;
_setApprovalForAll
function _setApprovalForAll(address owner, address operator, bool approved) internal virtual;
_doSafeTransferAcceptanceCheck
function _doSafeTransferAcceptanceCheck(address operator, address from, address to, uint256 id, uint256 amount, bytes memory data)
private;
_doSafeBatchTransferAcceptanceCheck
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) private;
_isContract
function _isContract(address account) internal view returns (bool);