Remove faucet, update MiniMeToken to MiniMeBase

This commit is contained in:
Ricardo Guilherme Schmidt 2023-10-03 11:46:37 -03:00
parent 34a05aead1
commit 88abe731e1
2 changed files with 2 additions and 34 deletions

View File

@ -1,32 +0,0 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.18;
import "./SNTPlaceHolder.sol";
contract SNTFaucet is SNTPlaceHolder {
bool public open = true;
constructor(address _owner, address payable _snt) SNTPlaceHolder(_owner, _snt) { }
fallback() external {
generateTokens(msg.sender, 1000 * (10 ** uint256(snt.decimals())));
}
function mint(uint256 _amount) external {
require(open);
generateTokens(msg.sender, _amount);
}
function setOpen(bool _open) external onlyOwner {
open = _open;
}
function destroyTokens(address _who, uint256 _amount) public onlyOwner {
snt.destroyTokens(_who, _amount);
}
function generateTokens(address _who, uint256 _amount) public {
require(msg.sender == owner || open);
snt.generateTokens(_who, _amount);
}
}

View File

@ -30,11 +30,11 @@ import "@openzeppelin/contracts/access/Ownable2Step.sol";
/// logic for transferring control of the token to the network when the offering
/// asks it to do so.
contract SNTPlaceHolder is TokenController, Ownable2Step {
MiniMeToken public snt;
MiniMeBase public snt;
constructor(address _owner, address payable _snt) {
owner = _owner;
snt = MiniMeToken(_snt);
snt = MiniMeBase(_snt);
}
/// @notice The owner of this contract can change the controller of the SNT token