With the standard open zeppelin ERC20 contracts, a fixed supply can be created by minting all of the new tokens to the contract creator. But this does not 'look good' and has the risk of the contract creator taking all the available balance. Is there a way to have a neutral address generated by the contract to hold the unallocated tokens? With functions then distributing the tokens as they are earned?
What is best practice for handling the risk of owner holding all the funds on contract initiation? Is it to create a fixed supply limit in the contract and _mint tokens within functions until that max level is hit? Or is there a better way to do it?
constructor(uint256 initialSupply) public ERC20("SimpleToken", "SIM") {
_mint(msg.sender, initialSupply);
}
owner = address(0);
at the end of the constructor.approve
andtransferFrom
have nothing to do with ownership.