{% hint style="success" %} You can configure your pool as Public or Private on creation. However, pool owners can change this status easily. {% endhint %}
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 %}
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 %}
Portal.setPoolVisibility(id, false);
Portal.setPoolVisibility(id, true);
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);
}
}