View Source: contracts/core/token/POT.sol
↗ Extends: NPM
POT
POTs can't be used outside of the protocol for example in DEXes. Once NPM token is launched, it will replace POTs. For now, Neptune Mutual team and a few others will have access to POTs. POTs aren't conventional ERC-20 tokens; they can't be transferred freely; they don't have any value, and therefore must not be purchased or sold. Again, POTs are distributed to individuals and companies who particpate in our governance and dispute management portals.
Constants & Variables
contract IStore public s;
mapping(address => bool) public whitelist;
bytes32 public constant NS_MEMBERS;
Events
event WhitelistUpdated(address indexed updatedBy, address[] accounts, bool[] statuses);
- constructor(address timelockOrOwner, IStore store)
- _throwIfNotProtocolMember(address account)
- updateWhitelist(address[] accounts, bool[] statuses)
- _beforeTokenTransfer(address from, address to, uint256 )
function (address timelockOrOwner, IStore store) public nonpayable NPM
Arguments
Name | Type | Description |
---|---|---|
timelockOrOwner | address | |
store | IStore |
Source Code
constructor(address timelockOrOwner, IStore store) NPM(timelockOrOwner, "Neptune Mutual POT", "POT") {
// require(timelockOrOwner != address(0), "Invalid owner"); // Already checked in `NPM`
require(address(store) != address(0), "Invalid store");
s = store;
whitelist[address(this)] = true;
whitelist[timelockOrOwner] = true;
}
function _throwIfNotProtocolMember(address account) private view
Arguments
Name | Type | Description |
---|---|---|
account | address |
Source Code
function _throwIfNotProtocolMember(address account) private view {
bytes32 key = keccak256(abi.encodePacked(NS_MEMBERS, account));
bool isMember = s.getBool(key);
// POTs can only be used within the Neptune Mutual protocol
require(isMember == true, "Access denied");
}
Updates whitelisted addresses. Provide a list of accounts and list of statuses to add or remove from the whitelist.
function updateWhitelist(address[] accounts, bool[] statuses) external nonpayable onlyOwner
Arguments
Name | Type | Description |
---|---|---|
accounts | address[] | |
statuses | bool[] |
Source Code
function updateWhitelist(address[] calldata accounts, bool[] memory statuses) external onlyOwner {
require(accounts.length > 0, "No account");
require(accounts.length == statuses.length, "Invalid args");
for (uint256 i = 0; i < accounts.length; i++) {
whitelist[accounts[i]] = statuses[i];
}
emit WhitelistUpdated(msg.sender, accounts, statuses);
}
function _beforeTokenTransfer(address from, address to, uint256 ) internal view whenNotPaused
Arguments
Name | Type | Description |
---|---|---|
from | address | |
to | address | |
uint256 |
Source Code
function _beforeTokenTransfer(
address from,
address to,
uint256
) internal view override whenNotPaused {
// Token mints
if (from == address(0)) {
// aren't restricted
return;
}
// Someone not whitelisted
// ............................ can still transfer to a whitelisted address
if (whitelist[from] == false && whitelist[to] == false) {
// and to the Neptune Mutual Protocol contracts but nowhere else
_throwIfNotProtocolMember(to);
}
}
- AaveStrategy
- AccessControl
- AccessControlLibV1
- Address
- BaseLibV1
- BokkyPooBahsDateTimeLibrary
- BondPool
- BondPoolBase
- BondPoolLibV1
- CompoundStrategy
- Context
- Cover
- CoverBase
- CoverLibV1
- CoverReassurance
- CoverStake
- CoverUtilV1
- cxToken
- cxTokenFactory
- cxTokenFactoryLibV1
- Delayable
- Destroyable
- ERC165
- ERC20
- FakeAaveLendingPool
- FakeCompoundStablecoinDelegator
- FakePriceOracle
- FakeRecoverable
- FakeStore
- FakeToken
- FakeUniswapPair
- FakeUniswapV2FactoryLike
- FakeUniswapV2PairLike
- FakeUniswapV2RouterLike
- FaultyAaveLendingPool
- FaultyCompoundStablecoinDelegator
- Finalization
- ForceEther
- Governance
- GovernanceUtilV1
- IAaveV2LendingPoolLike
- IAccessControl
- IBondPool
- IClaimsProcessor
- ICompoundERC20DelegatorLike
- ICover
- ICoverReassurance
- ICoverStake
- ICxToken
- ICxTokenFactory
- IERC165
- IERC20
- IERC20Detailed
- IERC20Metadata
- IERC3156FlashBorrower
- IERC3156FlashLender
- IFinalization
- IGovernance
- ILendingStrategy
- ILiquidityEngine
- IMember
- INeptuneRouterV1
- InvalidStrategy
- IPausable
- IPolicy
- IPolicyAdmin
- IPriceOracle
- IProtocol
- IRecoverable
- IReporter
- IResolution
- IResolvable
- IStakingPools
- IStore
- IStoreLike
- IUniswapV2FactoryLike
- IUniswapV2PairLike
- IUniswapV2RouterLike
- IUnstakable
- IVault
- IVaultDelegate
- IVaultFactory
- IWitness
- LiquidityEngine
- MaliciousToken
- MockAccessControlUser
- MockCoverUtilUser
- MockCxToken
- MockCxTokenPolicy
- MockCxTokenStore
- MockFlashBorrower
- MockLiquidityEngineUser
- MockProcessorStore
- MockProcessorStoreLib
- MockProtocol
- MockRegistryClient
- MockStore
- MockStoreKeyUtilUser
- MockValidationLibUser
- MockVault
- MockVaultLibUser
- NeptuneRouterV1
- NPM
- NpmDistributor
- NTransferUtilV2
- NTransferUtilV2Intermediate
- Ownable
- Pausable
- Policy
- PolicyAdmin
- PolicyHelperV1
- PoorMansERC20
- POT
- PriceLibV1
- Processor
- ProtoBase
- Protocol
- ProtoUtilV1
- Recoverable
- ReentrancyGuard
- RegistryLibV1
- Reporter
- Resolution
- Resolvable
- RoutineInvokerLibV1
- SafeERC20
- StakingPoolBase
- StakingPoolCoreLibV1
- StakingPoolInfo
- StakingPoolLibV1
- StakingPoolReward
- StakingPools
- Store
- StoreBase
- StoreKeyUtil
- StrategyLibV1
- Strings
- TimelockController
- Unstakable
- ValidationLibV1
- Vault
- VaultBase
- VaultDelegate
- VaultDelegateBase
- VaultDelegateWithFlashLoan
- VaultFactory
- VaultFactoryLibV1
- VaultLibV1
- VaultLiquidity
- VaultStrategy
- WithFlashLoan
- WithPausability
- WithRecovery
- Witness