Skip to content

Latest commit

 

History

History
358 lines (306 loc) · 9.83 KB

NPM.md

File metadata and controls

358 lines (306 loc) · 9.83 KB

NPM.sol

View Source: contracts/core/token/NPM.sol

↗ Extends: WithPausability, WithRecovery, ERC20

NPM

Contract Members

Constants & Variables

uint256 private constant _CAP;
uint256 private _issued;

Events

event Minted(bytes32 indexed key, address indexed account, uint256  amount);

Functions

function (address timelockOrOwner) public nonpayable Ownable Pausable ERC20 

Arguments

Name Type Description
timelockOrOwner address
Source Code
constructor(address timelockOrOwner) Ownable() Pausable() ERC20("Neptune Mutual Token", "NPM") {
    super._transferOwnership(timelockOrOwner);
  }

_beforeTokenTransfer

function _beforeTokenTransfer(address , address , uint256 ) internal view whenNotPaused 

Arguments

Name Type Description
address
address
uint256
Source Code
function _beforeTokenTransfer(
    address,
    address,
    uint256
  ) internal view override whenNotPaused {
    // solhint-disable-previous-line
  }

issue

function issue(bytes32 key, address mintTo, uint256 amount) external nonpayable onlyOwner whenNotPaused 

Arguments

Name Type Description
key bytes32
mintTo address
amount uint256
Source Code
function issue(
    bytes32 key,
    address mintTo,
    uint256 amount
  ) external onlyOwner whenNotPaused {
    _issue(key, mintTo, amount);
  }

issueMany

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[] memory receivers,
    uint256[] memory 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++) {
      _issue(key, receivers[i], amounts[i]);
    }
  }

transferMany

function transferMany(address[] receivers, uint256[] amounts) external nonpayable onlyOwner whenNotPaused 

Arguments

Name Type Description
receivers address[]
amounts uint256[]
Source Code
function transferMany(address[] memory receivers, uint256[] memory 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]);
    }
  }

_issue

function _issue(bytes32 key, address mintTo, uint256 amount) private nonpayable

Arguments

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);
    _issued += amount;

    require(_issued <= _CAP, "Cap exceeded");
    emit Minted(key, mintTo, amount);
  }

Contracts