IMultiPool1155
Author: 0xvv @ Kiln
This contract contains internal functions to stake and track positions in multiple pools. It also exposes supply getters and pool addition.
Functions
totalUnderlyingSupply
Returns the amount of pool shares owned by the users.
function totalUnderlyingSupply(uint256 id) external view returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
id | uint256 | Id of the pool |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | Total amount of shares. |
totalSupply
Returns the total amount of vStakes shares.
function totalSupply(uint256 id) external view returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
id | uint256 | Id of the pool |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | Total amount of shares. |
requestExit
Sends the given number of shares to the exit queue, the user receives the NFT ticket
function requestExit(uint256 id, uint256 amount) external;
Parameters
| Name | Type | Description |
|---|---|---|
id | uint256 | Id of the pool |
amount | uint256 | Amount of shares to add to the exit queue |
batchRequestExit
Batched version of requestExit
function batchRequestExit(uint256[] calldata ids, uint256[] calldata amounts) external;
Parameters
| Name | Type | Description |
|---|---|---|
ids | uint256[] | Ids of the pools |
amounts | uint256[] | Amount of shares to add to the exit queue |
poolRate
Returns the poolShare to ETH conversion rate for the given ID
function poolRate(uint256 id) external returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
id | uint256 | Id of the pool |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | ETH value of a pool share |
setPoolActivation
Allows the integrator to prevent users from depositing to a vPool.
function setPoolActivation(uint256 poolId, bool status) external;
Parameters
| Name | Type | Description |
|---|---|---|
poolId | uint256 | The id of the vPool. |
status | bool | Whether the users can deposit to the pool. |
Events
TransferSingle
Emitted when a transfer occurs.
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
Parameters
| Name | Type | Description |
|---|---|---|
operator | address | The address of the operator. |
from | address | The address of the sender. |
to | address | The address of the recipient. |
id | uint256 | The id of the pool. |
value | uint256 | The amount of staking shares. |
TransferBatch
Emitted when a batch transfer occurs, sending shares of multiple pools to the same recipient.
event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values);
Parameters
| Name | Type | Description |
|---|---|---|
operator | address | The address of the operator. |
from | address | The address of the sender. |
to | address | The address of the recipient. |
ids | uint256[] | The ids of the pools. |
values | uint256[] | The amounts of staking shares. |
CommissionSharesSold
Emitted when some integrator shares are sold
event CommissionSharesSold(uint256 pSharesSold, uint256 id, uint256 amountSold);
Parameters
| Name | Type | Description |
|---|---|---|
pSharesSold | uint256 | ETH amount of vPool shares sold |
id | uint256 | Id of the pool |
amountSold | uint256 | ETH amount of shares sold |
Errors
InsufficientBalance
Emitted when a transfer is attempted but the sender does not have enough balance.
error InsufficientBalance(uint256 id, uint256 amount, uint256 balance);
Parameters
| Name | Type | Description |
|---|---|---|
id | uint256 | The id of the token. |
amount | uint256 | The token amount. |
balance | uint256 | The balance of user. |