Created
August 6, 2022 19:38
-
-
Save devlongs/b6ed7d46232c932db1ea0a509f58da8d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity 0.8.4; | |
| import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol"; | |
| contract Erc20Token is ERC20("fire on", "FIO") { | |
| constructor() { | |
| _mint(address(this), 10000e18); | |
| } | |
| function withdraw(address addr, uint256 amount) public { | |
| uint256 balance = balanceOf(address(this)); | |
| require(addr != address(0), "Cannot send to address zero"); | |
| require(balance >= amount, "No enough token to send"); | |
| _transfer(address(this), addr, amount); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment