mirror of
https://github.com/logos-storage/nim-ethers.git
synced 2026-01-12 02:23:06 +00:00
30 lines
672 B
Solidity
30 lines
672 B
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.0;
|
|
|
|
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
|
|
|
contract TestToken is ERC20 {
|
|
constructor() ERC20("TestToken", "TST") {}
|
|
|
|
function decimals() public view virtual override returns (uint8) {
|
|
return 12;
|
|
}
|
|
|
|
function mint(address holder, uint amount) public {
|
|
_mint(holder, amount);
|
|
}
|
|
|
|
function burn(address holder, uint amount) public {
|
|
_burn(holder, amount);
|
|
}
|
|
|
|
function myBalance() public view returns (uint256) {
|
|
return balanceOf(msg.sender);
|
|
}
|
|
|
|
function doRevert(string memory reason) public {
|
|
// Revert every tx with given reason
|
|
require(false, reason);
|
|
}
|
|
}
|