Hi mate , goodday~ but i got some problems from coding~

Hi, guys. I’m new here , just found our community is so good. i tried my best to find out ,but couldn’t.
So here is the problems.
I’m creating a Token with burnning function (Burning rate 5%), I tried so many way and times , it doesn’t work
What should I do ? Or should I put in ?
Here is my code.

pragma solidity ^0.8.0;

import “https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol”;
import “https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/extensions/ERC20Burnable.sol”;

contract TEST is ERC20{
constructor ( uint256 initialSupply) public ERC20 (“TEST” , “TT”){
_mint(msg.sender,initialSupply);
function burn(address to, uint256 amount) public onlyOwner {
_burn(to, amount);
}
}
Pls feel free to contact me ~THX SO MUCH

Hi Gundam Fan, welcome to the forums!

If you are new, please start with OpenZeppelin Upgrades: Step by Step Tutorial for Hardhat

This will get you a great developer environment, and can prove you can deploy contracts.

From there, add in the burn mechanism using ERC20Burnable.sol

3 Likes