Skip to content

Instantly share code, notes, and snippets.

@ArslanKathia
Created February 22, 2023 17:57
Show Gist options
  • Save ArslanKathia/d69bbad12fe66889323a3a939d822540 to your computer and use it in GitHub Desktop.
Save ArslanKathia/d69bbad12fe66889323a3a939d822540 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.17+commit.8df45f5f.js&optimize=false&runs=200&gist=
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Capped.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/// @custom:security contact [email protected]
contract ShaniToken is ERC20,Ownable{
/**
Fixed Supply
**/
// constructor() ERC20("SCoin","SCO"){
// _mint(msg.sender,1000*10**18);
// }
/**
Uncapped lazy supply
**/
constructor() ERC20("SCoin","SCO"){}
function issueToken() public onlyOwner{
_mint(msg.sender,1000*10**18);
}
function issueToken(address receiver,uint256 amount) public onlyOwner{
_mint(receiver,amount*10**decimals());
}
}
/**
capped modular supply
**/
contract ShaniToken1 is ERC20Capped,Ownable{
constructor(uint256 cap) ERC20("SCoin","SCO") ERC20Capped(cap){
}
function issueToken() public onlyOwner{
_mint(msg.sender,100*10**decimals());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment