Skip to content

Commit

Permalink
new test file
Browse files Browse the repository at this point in the history
  • Loading branch information
JustAnotherDevv committed Nov 16, 2024
1 parent 37dbe64 commit f6206e1
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions contracts/src/Token.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract MyToken is ERC20, Ownable {
uint256 public constant INITIAL_SUPPLY = 1000000 * 10**18;
uint256 public constant MAX_SUPPLY = 10000000 * 10**18;

constructor() ERC20("ActionToken", "ACT") Ownable(msg.sender) {
_mint(msg.sender, INITIAL_SUPPLY);
}

function mint(address to, uint256 amount) public onlyOwner {
require(totalSupply() + amount <= MAX_SUPPLY, "Exceeds maximum supply");
_mint(to, amount);
}

function burn(uint256 amount) public {
_burn(msg.sender, amount);
}

function decimals() public pure override returns (uint8) {
return 18;
}
}

0 comments on commit f6206e1

Please sign in to comment.