Skip to content

Instantly share code, notes, and snippets.

@josefrichter
Created September 9, 2021 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josefrichter/112a126a927977feed0d0a6a3bebd9ee to your computer and use it in GitHub Desktop.
Save josefrichter/112a126a927977feed0d0a6a3bebd9ee to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=undefined&optimize=false&runs=200&gist=
pragma solidity >=0.7.0 <0.9.0;
contract ERC20Token {
string public name;
mapping(address => uint256) public balances;
constructor(string memory _name) {
name = _name;
}
function mint() public virtual {
balances[tx.origin] ++;
}
}
contract MyToken is ERC20Token {
string public symbol;
address[] public owners;
uint256 ownerCount;
constructor(
string memory _name,
string memory _symbol
)
ERC20Token(_name)
{
symbol = _symbol;
}
function mint() public override {
super.mint();
ownerCount ++;
owners.push(msg.sender);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment