I am trying to use this guide to create a solidity contract on remix.ethereum however I get the following error when trying to compile:
DeclarationError: Identifier not found or not unique.
--> ACToken.sol:13:19:
|
13 | function burn(unint amount) external {
| ^^^^
this is my code:
pragma solidity ^0.8.3;
import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol';
contract ACoolToken is ERC20 {
address public admin;
constructor() ERC20('ACoolToken', 'ACT') {
_mint(msg.sender, 1000000 * 10 ** 18);
admin = msg.sender;
}
function burn(unint amount) external {
_burn(msg.sender, amount);
}
function mint(address account, uint256 amount) external {
require(msg.sender == admin, 'only admin');
_mint(to, amount);
}
}
I have tried renaming burn to _burn or BurnToken but I get the same error either way. If I swap the order with mint, I get the error on the mint function too.