IMultiPool20

Git Source

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

NameTypeDescription
splituint256[]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

NameTypeDescription
amountuint256Amount of shares to add to the exit queue

rate

Returns the share to ETH conversion rate

function rate() external returns (uint256);

Returns

NameTypeDescription
<none>uint256ETH 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

NameTypeDescription
poolIduint256The id of the vPool.
statusboolWhether the users can deposit to the pool.
newPoolPercentagesuint256[]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

NameTypeDescription
fromaddressThe address sending the stake
toaddressThe address receiving the stake
valueuint256The transfer amount

Approval

Emitted when an allowance is created.

event Approval(address indexed owner, address indexed spender, uint256 value);

Parameters

NameTypeDescription
owneraddressThe owner of the shares
spenderaddressThe address that can spend
valueuint256The allowance amount

CommissionSharesSold

Emitted when some integrator shares are sold

event CommissionSharesSold(uint256 pSharesSold, uint256 id, uint256 amountSold);

Parameters

NameTypeDescription
pSharesSolduint256ETH amount of vPool shares sold
iduint256Id of the pool
amountSolduint256ETH amount of shares sold

SetPoolPercentages

Emitted when new split is set.

event SetPoolPercentages(uint256[] split);

Parameters

NameTypeDescription
splituint256[]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

NameTypeDescription
amountuint256The token amount.
balanceuint256The 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);