Skip to content

Commit

Permalink
Fix contract file name
Browse files Browse the repository at this point in the history
  • Loading branch information
mzxyz committed Dec 19, 2023
1 parent ba64ac3 commit ff8b31c
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions contracts/root/VTSQToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright (C) 2020-2023 SubQuery Pte Ltd authors & contributors
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.8.15;

import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol';
import '@openzeppelin/contracts/access/Ownable.sol';

contract VTSQToken is ERC20, Ownable, ERC20Burnable {
using SafeERC20 for IERC20;
address public minter;

modifier isMinter() {
require(minter == msg.sender, 'Not minter');
_;
}

constructor(address _minter, uint256 totalSupply) ERC20('VTSubQueryToken', 'vtSQT') Ownable() {
minter = _minter;
_mint(msg.sender, totalSupply);
}

function mint(address destination, uint256 amount) external isMinter {
_mint(destination, amount);
}

/// #if_succeeds {:msg "minter should be set"} minter == _minter;
/// #if_succeeds {:msg "owner functionality"} old(msg.sender == address(owner));
function setMinter(address _minter) external onlyOwner {
minter = _minter;
}

function getMinter() external view returns (address) {
return minter;
}
}

0 comments on commit ff8b31c

Please sign in to comment.