Answer the question
In order to leave comments, you need to log in
Is it possible to release a certain amount after the release of tokens?
For example: someone buys our tokens and the total number of tokens increases.
Answer the question
In order to leave comments, you need to log in
Alternatively, you could use something like this:
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract YourContractName is ERC20{
address owner;
constructor() ERC20("Your token name", "YourSymbol") {
// запоминаем кошелёк, который загружал токен, чтобы только он мог допечатывать деньги
owner = msg.sender;
}
function printCoins(uint256 amount) public {
require(msg.sender == owner, "Forbidden");
_mint(owner, amount); // зачисляем деньги на кошелёк владельца контракта
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question