Hi,
Thanks for OpenZeppelin, looks to be a powerful framework.
I am a relative newbie, but I have done through the documentation and the OpenZeppelin Upgrades: Step by Step Tutorial for Hardhat tutorial.
I have started writing my own token based on ERC20 and hardhat:
//SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
contract DickyCoinV01 is OwnableUpgradeable, ERC20PausableUpgradeable {
function initialize(uint256 _releaseTime) public initializer {
__Context_init_unchained();
__Ownable_init_unchained();
__ERC20_init_unchained("RichTestToken", "RTEST");
__Pausable_init_unchained();
__ERC20Pausable_init_unchained();
_mint(owner(), 2000000 * 10 ** 18);
//TODO: Add Vesting and allocations
}
}
I literally just started but I have a few questions:
Question 1: I am about to write some vesting code to allocate a certain amount of tokens to the developer and also to some pre-sales. How do I go about this? Do I allocate this out of the pre-minted tokens or do I mint more?
Question 2: If I want future offerings, would I need to do an upgrade, e.g. create another contract? Not sure how this works.
Question 3: How does an exchange buy and sell the tokens? E.g. I understand the owner can call the transfer function, but requires owner privileges, how is this done?, or is there a way to have a ‘public’ pool of some sort?
Question 4: How do I (if it is at all possible) set the initial price of the token? and how does this increase and decrease?
Thanks in advance, apologies if these are simple questions, I am having difficulty finding up-to-date documentation.
Regards
Richard