Whitelister
Read Only
isLPWhitelisted
solidity
mapping(address => mapping(address => bool)) public isLPWhitelisted;
2D mapping to store Whitelisted LP for each Pool.
isPoolWhitelisted
solidity
mapping(address => POOL_STATE) public isPoolWhitelisted;
Stores which Pool is Whitelisted. If the Pool is not Whitelisted, any LP can add liquidity.
Write methods
isAllowed
solidity
function isAllowed(
address _recipient,
bytes calldata _data
) external view returns (bool)
Checks if the LP is Whitelisted over the {Whitelisted} pool. If the Pool is not Whitelisted, all LPs are allowed to mint and this function would return true. If the pool is Whitelisted, and the LP is Whitelisted on the pool, function still returns true. However, if the pool is Whitelisted and the LP isn't whitelisted, it returns false.
Parameters
Name | Type | Description |
---|---|---|
_recipient | address | Address of NonFungiblePosManager |
_data | bytes | Abi Encoded data of (PoolKey, LP) |
setContractState
solidity
function setContractState(bool _status) external onlyOwner
The global state is a variable ENABLED
that can be turned off to disable Whitelisting.
Parameters
Name | Type | Description |
---|---|---|
_status | bool | True/False to turn whitelisting On/Off |
setPoolWhitelist
solidity
function setPoolWhitelist(
address _pool,
bool _status
) external onlyOwner
Turns whitelisting On/Off of a specific pool. All pools are Whitelisted by default. This prevents anyone but the Whitelisted LPs to add liquidity.
Parameters
Name | Type | Description |
---|---|---|
_pool | address | Address of Pool |
_status | bool | Status(True/False) for (whitelist/disable-whitelist) |
setLPWhitelist
solidity
function setLPWhitelist(
address _pool,
address _lp,
bool _status
) external onlyOwner
Whitelists a LP in the respective Pool.
Parameters
Name | Type | Description |
---|---|---|
_pool_ | address | Pool Address |
_lp | address | Address of the Liquidity Provider |
_status | bool | Status(True/False) for (whitelist/disable-whitelist) |