Created
May 31, 2021 13:57
-
-
Save mwaqasaslam/f9b2e749505b5ef40f77ae029c0d8793 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.0+commit.c7dfd78e.js&optimize=true&runs=200&gist=
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
*Submitted for verification at Qourum on 2021-05-31 | |
*/ | |
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.0/contracts/token/ERC20/extensions/ERC20Pausable.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.0/contracts/utils/math/SafeMath.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.0/contracts/token/ERC20/IERC20.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.0/contracts/token/ERC20/ERC20.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.0/contracts/security/Pausable.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.0/contracts/access/Ownable.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.0/contracts/utils/Context.sol"; | |
contract DinisiumToken is ERC20Pausable, Ownable { | |
event MintedTokens(address mintedOn, uint256 mintedTokens, address mintedBy); | |
event BurnedTokens(address burnedBy, uint256 burnedTokens); | |
event PausedContract(address pauseddBy); | |
event UnpausedContract(address unpausedBy); | |
constructor() ERC20("Dinisium", "Dinisium") { | |
} | |
function mintTokens (uint256 newSupply, address account) public onlyOwner returns (bool status) { | |
_mint(account, newSupply); | |
emit MintedTokens(account, newSupply, msg.sender); | |
return true; | |
} | |
function burnTokens (uint256 burnAmount) public whenNotPaused returns (bool status) { | |
_burn(msg.sender, burnAmount); | |
emit BurnedTokens(msg.sender, burnAmount); | |
return true; | |
} | |
function pauseContract () public onlyOwner returns (bool status) { | |
_pause(); | |
emit PausedContract(msg.sender); | |
return true; | |
} | |
function unpauseContract () public onlyOwner returns (bool status) { | |
_unpause(); | |
emit UnpausedContract(msg.sender); | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment