ваше сообщение коммита
This commit is contained in:
29
backend/contracts/MockToken.sol
Normal file
29
backend/contracts/MockToken.sol
Normal file
@@ -0,0 +1,29 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
||||
|
||||
/**
|
||||
* @title MockToken
|
||||
* @dev Мок-токен для тестирования TreasuryModule
|
||||
*/
|
||||
contract MockToken is ERC20 {
|
||||
address public minter;
|
||||
|
||||
constructor(string memory name, string memory symbol) ERC20(name, symbol) {
|
||||
minter = msg.sender;
|
||||
}
|
||||
|
||||
modifier onlyMinter() {
|
||||
require(msg.sender == minter, "Only minter can call this function");
|
||||
_;
|
||||
}
|
||||
|
||||
function mint(address to, uint256 amount) external onlyMinter {
|
||||
_mint(to, amount);
|
||||
}
|
||||
|
||||
function burn(uint256 amount) external {
|
||||
_burn(msg.sender, amount);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user