Skip to content

Instantly share code, notes, and snippets.

@fassko
Created September 11, 2022 17:20

Revisions

  1. fassko created this gist Sep 11, 2022.
    20 changes: 20 additions & 0 deletions contracts...FungibleToken.sol
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    //SPDX-License-Identifier: Unlicense
    pragma solidity ^0.8.0;

    import "hardhat/console.sol";

    import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/token/ERC20/ERC20.sol";

    contract FungibleToken is ERC20 {
    constructor(uint256 totalSupply) ERC20("MyBestToken", "BTKN") {
    _mint(msg.sender, totalSupply);
    }

    function burn(uint256 burnAmount) external {
    _burn(msg.sender, burnAmount);
    }

    function mint(uint256 amount) external {
    _mint(msg.sender, amount);
    }
    }