View Source: contracts/core/token/NPM.sol
↗ Extends: WithPausability, WithRecovery, ERC20 ↘ Derived Contracts: POT
NPM
Constants & Variables
uint256 private constant _CAP;
uint256 private _issued;Events
event Minted(bytes32 indexed key, address indexed account, uint256 amount);- constructor(address timelockOrOwner, string tokenName, string tokenSymbol)
- _beforeTokenTransfer(address , address , uint256 )
- issueMany(bytes32 key, address[] receivers, uint256[] amounts)
- transferMany(address[] receivers, uint256[] amounts)
- _issue(bytes32 key, address mintTo, uint256 amount)
- _sumOf(uint256[] amounts)
function (address timelockOrOwner, string tokenName, string tokenSymbol) public nonpayable Ownable Pausable ERC20 Arguments
| Name | Type | Description |
|---|---|---|
| timelockOrOwner | address | |
| tokenName | string | |
| tokenSymbol | string |
Source Code
constructor(
address timelockOrOwner,
string memory tokenName,
string memory tokenSymbol
) Ownable() Pausable() ERC20(tokenName, tokenSymbol) {
require(timelockOrOwner != address(0), "Invalid owner");
require(bytes(tokenName).length > 0, "Invalid token name");
require(bytes(tokenSymbol).length > 0, "Invalid token symbol");
super._transferOwnership(timelockOrOwner);
}function _beforeTokenTransfer(address , address , uint256 ) internal view whenNotPaused Arguments
| Name | Type | Description |
|---|---|---|
| address | ||
| address | ||
| uint256 |
Source Code
function _beforeTokenTransfer(
address,
address,
uint256
) internal view virtual override whenNotPaused {}function issueMany(bytes32 key, address[] receivers, uint256[] amounts) external nonpayable onlyOwner whenNotPaused Arguments
| Name | Type | Description |
|---|---|---|
| key | bytes32 | |
| receivers | address[] | |
| amounts | uint256[] |
Source Code
function issueMany(
bytes32 key,
address[] calldata receivers,
uint256[] calldata amounts
) external onlyOwner whenNotPaused {
require(receivers.length > 0, "No receiver");
require(receivers.length == amounts.length, "Invalid args");
_issued += _sumOf(amounts);
require(_issued <= _CAP, "Cap exceeded");
for (uint256 i = 0; i < receivers.length; i++) {
_issue(key, receivers[i], amounts[i]);
}
}function transferMany(address[] receivers, uint256[] amounts) external nonpayable onlyOwner whenNotPaused Arguments
| Name | Type | Description |
|---|---|---|
| receivers | address[] | |
| amounts | uint256[] |
Source Code
function transferMany(address[] calldata receivers, uint256[] calldata amounts) external onlyOwner whenNotPaused {
require(receivers.length > 0, "No receiver");
require(receivers.length == amounts.length, "Invalid args");
for (uint256 i = 0; i < receivers.length; i++) {
super.transfer(receivers[i], amounts[i]);
}
}function _issue(bytes32 key, address mintTo, uint256 amount) private nonpayableArguments
| Name | Type | Description |
|---|---|---|
| key | bytes32 | |
| mintTo | address | |
| amount | uint256 |
Source Code
function _issue(
bytes32 key,
address mintTo,
uint256 amount
) private {
require(amount > 0, "Invalid amount");
super._mint(mintTo, amount);
emit Minted(key, mintTo, amount);
}function _sumOf(uint256[] amounts) private pure
returns(total uint256)Arguments
| Name | Type | Description |
|---|---|---|
| amounts | uint256[] |
Source Code
function _sumOf(uint256[] calldata amounts) private pure returns (uint256 total) {
for (uint256 i = 0; i < amounts.length; i++) {
total += amounts[i];
}
}- 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