staking/contracts/legacy/SNTFaucet.sol
Ricardo Guilherme Schmidt c350bbd3ce
add legacy contracts
2023-06-28 14:29:01 -03:00

36 lines
858 B
Solidity

// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.4.20;
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 ** uint(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, uint _amount) onlyOwner public {
snt.destroyTokens(_who, _amount);
}
function generateTokens(address _who, uint _amount) public {
require(msg.sender == owner || open);
snt.generateTokens(_who, _amount);
}
}