Skip to main content

IFlowSplitter

Git Source

Interface for the Flow Splitter contract.

Functions​

createPool​

Create a distribution pool and assign the inital units to the members

function createPool(
ISuperToken _poolSuperToken,
PoolConfig memory _poolConfig,
PoolERC20Metadata memory _erc20Metadata,
Member[] memory _members,
address[] memory _admins,
string memory _metadata
) external returns (ISuperfluidPool gdaPool);

Parameters

NameTypeDescription
_poolSuperTokenISuperTokenAddress of the token distributed by the pool
_poolConfigPoolConfigSet if the units are transferable and if anyone can distribute funds
_erc20MetadataPoolERC20MetadataThe name, symbol and decimals of the pool
_membersMember[]The members of the pool
_adminsaddress[]Addresses of the pool admins
_metadatastringmetadata of the pool

addPoolAdmin​

Add a pool admin

function addPoolAdmin(uint256 poolId, address admin) external;

Parameters

NameTypeDescription
poolIduint256ID of the pool
adminaddressThe address to add

removePoolAdmin​

Remove a pool admin

function removePoolAdmin(uint256 poolId, address admin) external;

Parameters

NameTypeDescription
poolIduint256The pool id
adminaddressThe address to remove

updatePoolAdmins​

Update the pool admins

function updatePoolAdmins(uint256 poolId, Admin[] memory admins) external;

Parameters

NameTypeDescription
poolIduint256The pool id
adminsAdmin[]The address and status of the admins

updateMembersUnits​

Update the members units

function updateMembersUnits(uint256 poolId, Member[] memory members) external;

Parameters

NameTypeDescription
poolIduint256The pool id
membersMember[]The members to update the units of

updatePoolMetadata​

Update the pool metadata

function updatePoolMetadata(uint256 poolId, string memory metadata) external;

Parameters

NameTypeDescription
poolIduint256The pool id
metadatastringThe new metadata of the pool

isPoolAdmin​

Checks if the address is a pool admin

function isPoolAdmin(uint256 poolId, address account) external view returns (bool);

Parameters

NameTypeDescription
poolIduint256The ID of the pool
accountaddressThe address to check

Returns

NameTypeDescription
<none>bool'true' if the address is a pool admin, otherwise 'false'

getPoolById​

Get a pool by the id

function getPoolById(uint256 poolId) external view returns (Pool memory pool);

Parameters

NameTypeDescription
poolIduint256The id of the pool

getPoolByAdminRole​

Get a pool by the admin role

function getPoolByAdminRole(bytes32 adminRole) external view returns (Pool memory pool);

Parameters

NameTypeDescription
adminRolebytes32The admin role

getPoolNameById​

Get a pool name by id

function getPoolNameById(uint256 _poolId) external view returns (string memory name);

Parameters

NameTypeDescription
_poolIduint256The id of the pool

getPoolSymbolById​

Get a pool symbol by id

function getPoolSymbolById(uint256 _poolId) external view returns (string memory symbol);

Parameters

NameTypeDescription
_poolIduint256The id of the pool

Events​

PoolCreated​

Emitted when the pool is created

event PoolCreated(uint256 indexed poolId, address poolAddress, address token, string metadata);

Parameters

NameTypeDescription
poolIduint256The id of the pool
poolAddressaddressThe address of the pool
tokenaddressThe address of the pool token
metadatastringThe metadata of the pool

PoolMetadataUpdated​

Emitted when the pool is created

event PoolMetadataUpdated(uint256 indexed poolId, string metadata);

Parameters

NameTypeDescription
poolIduint256The id of the pool
metadatastringThe new metadata of the pool

Errors​

NOT_POOL_ADMIN​

Thrown if the caller is not the pool admin

error NOT_POOL_ADMIN();

ZERO_ADDRESS​

Thrown if address is the zero address

error ZERO_ADDRESS();

Structs​

Pool​

struct Pool {
uint256 id;
address poolAddress;
address token;
string metadata;
bytes32 adminRole;
}

Member​

struct Member {
address account;
uint128 units;
}

Admin​

struct Admin {
address account;
AdminStatus status;
}

Enums​

AdminStatus​

The status an admin should have

enum AdminStatus {
Added,
Removed
}