Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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=
/**
*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