pragma solidity ^0.8.0; // Importing OpenZeppelin's ERC20 contract import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract RCSHares is ERC20 { // Contract constructor, sets initial token supply and gives all tokens to deployer constructor(uint256 initialSupply) ERC20("RC Shares", "$SHARES") { _mint(msg.sender, initialSupply); } // Only the deployer can transfer tokens function _beforeTokenTransfer(address from, address to, uint256 amount) internal override { require(from == owner(), "Only the deployer can transfer tokens"); super._beforeTokenTransfer(from, to, amount); } // Function to mint tokens for giveaways function mintForGiveaways(uint256 amount) external { _mint(msg.sender, amount); } }
0.4.18