Plato Farm
  • Welcome
  • Introduction
    • Gallery
    • Change announcement
    • Announcement
    • The game announcement
    • News report
  • Play to Earn
    • The Global Flash Sale of Plato Farm Mystery Boxes will be launched soon!
    • The initial price of NFT props in Palto Farm Mystery Box Rewards.
    • How to Download Plato Farm App form Wallet
    • Public Beta Pre-Play-to-Earn Campaign
      • Announcement
    • Community Recruitment Plan
    • Online activities
    • Offline Event
  • Roadmap
    • Plato Farm public test starts now!
    • Plato Farm’s first phase of award-winning public beta activity.
    • We will airdrop our precious token — Mark to our early community members.
      • Announcement
    • Plato Farm’s official website opens the trading function of NFT market.
    • MARK Token Issuance Restriction Plan
      • The code of MARK token issuance restriction contract
  • PlatoFarm — — NDO Scheme
    • Call for all MARK holders to vote for the NDO!
    • Voting of NDO scheme has been passed
  • Collabration
    • Plato Farm Launched on HECO Smart Chain
    • With Huobi Wallet
    • With Bitkeep Wallet
    • With ONTO Wallet
    • With Coin98
    • With Hyperpay
  • Contact us
  • Official Website
  • Twitter
  • Medium
  • Github
  • Telegram
  • Youtube
  • Discord
Powered by GitBook
On this page

Was this helpful?

  1. Roadmap
  2. MARK Token Issuance Restriction Plan

The code of MARK token issuance restriction contract

PreviousMARK Token Issuance Restriction PlanNextPlatoFarm — — NDO Scheme

Last updated 3 years ago

Was this helpful?

Below is the code of MARK token issuance restriction contract

contract address:0x6d37b10922ccfbcdd71273cebfb47ddba32bb376

// SPDX-License-Identifier: MIT pragma solidity ^0.8.0;

/** * Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; }

function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }/* */

/** * Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner;

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

/** * Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); }

/** * Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; }

/** * Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), “Ownable: caller is not the owner”); _; }

/** * Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); }

/** * Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), “Ownable: new owner is the zero address”); _setOwner(newOwner); }

function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }

/** * Wrappers over Solidity’s arithmetic operations with added overflow checks. * Arithmetic operations in Solidity wrap on overflow. This can easily result in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. `SafeMath` restores this intuition by reverting the transaction when an operation overflows. * Using this library instead of the unchecked operations eliminates an entire class of bugs, so it’s recommended to use it always. */ library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, “SafeMath: addition overflow”);

return c; }

function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, “SafeMath: subtraction overflow”); }

function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a — b;

return c; }

function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; }

uint256 c = a * b; require(c / a == b, “SafeMath: multiplication overflow”);

return c; }

function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, “SafeMath: division by zero”); }

function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b;

return c; }

function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, “SafeMath: modulo by zero”); }

function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }

contract Minter is Ownable {

bool public activate; // Is it activated uint256 public startBlockNumber; // Starting block number

address public mark; constructor(address _mark) { mark = _mark; }

function mint(address account, uint256 amount) public onlyOwner { require(activate, “Not initiated”); require(block.number >= startBlockNumber, “Starting block number not reached”);

uint256 limitMintable = getLimitMintable(); require(amount <= limitMintable, “Minting exceeds the limit”); IMark(mark).mint(account, amount); mintedAmount = mintedAmount.add(amount); }

uint256 _mintable = block.number.sub(startBlockNumber) .div(BLOCKPERIOD) .add(1) .mul(DAYLIMIT);

if (_mintable <= mintedAmount) { return 0; } if (_mintable >= MAXSUPPLY) { return MAXSUPPLY.sub(mintedAmount); }

return _mintable.sub(mintedAmount); }

}

interface IMark { /** * Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256);

/** * Mint mark to the account. */ function mint(address account, uint256 amount) external;

/** * Mint mark. */ function burn(uint256 amount) external; }

using SafeMath for uint256; /** * After 28800 blocknumber * (HECO chain is an average of one block every 3 seconds, 3x28800=86400, that is, 1 day), * 1 billion additional blocks can be issued; */ uint256 public constant BLOCKPERIOD = 28800; // Block period uint256 public constant MAXSUPPLY = 1095000000000 * 1e18; // Maximum supply uint256 public constant DAYLIMIT = 1000000000 * 1e18; // Daily minting limit uint256 public mintedAmount = 5000000000 * 1e18; // Total number of minted uint256 public burnAmount; // Total number of burned

/** * Get the current block number */ function getBlockNumber() public view returns(uint256) { return block.number; }

/** * Get the current total supply */ function totalSupply() public view returns(uint256) { return IMark(mark).totalSupply(); }

/** * Get the total amount of coins that can be minted by MARK */ function getTotalMintable() public view returns(uint256) { return MAXSUPPLY.sub(mintedAmount); }

/** * Get the current limit of mintable coins */ function getLimitMintable() public view returns(uint256) { if (!activate || block.number <= startBlockNumber) { return 0; }

/** * Burn operation can only be performed by the administrator */ function burn(uint256 amount) public onlyOwner { IMark(mark).burn(amount); burnAmount = burnAmount.add(amount); }

/** * Can only be started once */ function startUp(uint256 _startBlockNumber) public onlyOwner { require(!activate, “Activated”); require( _startBlockNumber > block.number, “The start block number should be greater than the current block number” ); activate = true; startBlockNumber = _startBlockNumber; }

@dev
@dev
@dev
@dev
@dev
@dev
@dev
@dev
@dev
@dev
@dev
@dev
@dev
@dev
@dev
@dev
@dev
@dev