Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions contracts/FT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,28 @@
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contractscurity/Pausable.sol";

contract FT is ERC20 {
contract FT is ERC20,Pausable {
address private owner;
constructor(string memory name, string memory symbol) ERC20(name, symbol) {
owner = msg.sender;
}

// TODO 实现mint的权限控制,只有owner可以mint
function mint(address account, uint256 amount) external {

require(msg.sender == owner);
_mint(account,amount);
}

// TODO 用户只能燃烧自己的token
function burn(uint256 amount) external {

require(msg.sender == owner);
_burn(msg.sender,amount);
}

// TODO 加分项:实现transfer可以暂停的逻辑
function transferStop(address account,uint256 amount) public whenNotPaused{
_transfer(msg.sender,account,amount);
}
}