Skip to content

Latest commit

 

History

History
91 lines (64 loc) · 2.56 KB

private-pools-and-whitelisting.md

File metadata and controls

91 lines (64 loc) · 2.56 KB

Private Pools and Whitelisting

{% hint style="success" %} You can configure your pool as Public or Private on creation. However, pool owners can change this status easily. {% endhint %}

Public Pools can be used by anyone

If you are a service provider willing to manage anyone's Ether, create a Public Pool.

{% hint style="success" %} Public Pools will show up within on Geode's App. {% endhint %}

Private Pools can only be used by whitelisted addresses

If you are using a personal staking pool, or worried about KYC/AML, create a Private Pool.

{% hint style="success" %} Private Pools do not show up on Geode's App. {% endhint %}

Making Your Pool Public

Portal.setPoolVisibility(id, false);

Making Your Pool Private

Portal.setPoolVisibility(id, true);

Whitelisting

You can use a whitelist to manage staker addresses on Private Pools

But you don't need to.

{% hint style="success" %} A Pool Owner is able to use their private Pool without being whitelisted. {% endhint %}

This whitelist should be a contract that has implemented isAllowed() function:

{% code title="IWhiteList.sol" %}

interface IWhiteList {
  // @notice returns true if the address is allowed
  function isAllowed(address) external view returns (bool);
}

{% endcode %}

After making your pool private and creating your whitelisting contract with required functionality, simply notify Portal:

Porta.setWhitelist(id, contract_address);

Here is an unupgradable ,unaudited, untested, simple Whitelist contract for you 💕

pragma solidity =0.8.7;

import "@openzeppelin/contracts/access/Ownable.sol";

interface IWhiteList {
  // @notice returns true if the address is allowed
  function isAllowed(address) external view returns (bool);
}

contract Whitelist is IWhitelist, Ownable {
  event Listed(address indexed account, bool isWhitelisted);

  mapping(address => bool) private whitelist;

  function isAllowed(
    address _address
  ) external view virtual override returns (bool) {
    return whitelist[_address];
  }

  function setAddress(address _address, bool allow) external virtual onlyOwner {
    require(whitelist[_address] != allow);
    whitelist[_address] = allow;
    emit Listed(_address, allow);
  }
}