IMultiPool20
Author: 0xvv @ Kiln
This contract contains the internal logic for an ERC-20 token based on one or multiple pools.
Functions
setPoolPercentages
Set the percentage of new stakes to route to each pool
If a pool is disabled it needs to be set to 0 in the array
function setPoolPercentages(uint256[] calldata split) external;
Parameters
| Name | Type | Description |
|---|---|---|
split | uint256[] | Array of values in basis points to route to each pool |
requestExit
Burns the sender's shares and sends the exitQueue tickets to the caller.
function requestExit(uint256 amount) external;
Parameters
| Name | Type | Description |
|---|---|---|
amount | uint256 | Amount of shares to add to the exit queue |
rate
Returns the share to ETH conversion rate
function rate() external returns (uint256);
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | ETH value of a share |
setPoolActivation
Allows the integrator to prevent users from depositing to a vPool.
function setPoolActivation(uint256 poolId, bool status, uint256[] calldata newPoolPercentages) external;
Parameters
| Name | Type | Description |
|---|---|---|
poolId | uint256 | The id of the vPool. |
status | bool | Whether the users can deposit to the pool. |
newPoolPercentages | uint256[] | Array of value in basis points to route to each pool after the change |
Events
Transfer
Emitted when a stake is transferred.
event Transfer(address indexed from, address indexed to, uint256 value);
Parameters
| Name | Type | Description |
|---|---|---|
from | address | The address sending the stake |
to | address | The address receiving the stake |
value | uint256 | The transfer amount |
Approval
Emitted when an allowance is created.
event Approval(address indexed owner, address indexed spender, uint256 value);
Parameters
| Name | Type | Description |
|---|---|---|
owner | address | The owner of the shares |
spender | address | The address that can spend |
value | uint256 | The allowance amount |
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 |
SetPoolPercentages
Emitted when new split is set.
event SetPoolPercentages(uint256[] split);
Parameters
| Name | Type | Description |
|---|---|---|
split | uint256[] | Array of value in basis points to route to each pool |
Errors
InsufficientBalance
Thrown when a transfer is attempted but the sender does not have enough balance.
error InsufficientBalance(uint256 amount, uint256 balance);
Parameters
| Name | Type | Description |
|---|---|---|
amount | uint256 | The token amount. |
balance | uint256 | The balance of user. |
InsufficientAllowance
Thrown when a transferFrom is attempted but the spender does not have enough allowance.
error InsufficientAllowance(uint256 amount, uint256 allowance);
NonZeroPercentageOnDeactivatedPool
Thrown when trying to set a pool percentage != 0 to a deactivated pool
error NonZeroPercentageOnDeactivatedPool(uint256 id);