Skip to content

Instantly share code, notes, and snippets.

@taobun
Created August 1, 2019 04:16
Show Gist options
  • Save taobun/8f73ab845d2d073ca16c438507d46027 to your computer and use it in GitHub Desktop.
Save taobun/8f73ab845d2d073ca16c438507d46027 to your computer and use it in GitHub Desktop.
pragma solidity 0.5.10;
contract Token {
string public name;
string public symbol;
mapping(address => uint256) public balances;
constructor(string memory _name, string memory _symbol) public {
name = _name;
symbol = _symbol;
}
}
contract TokenFactory {
event TokenCreated(Token newToken);
function createNewToken(string calldata name, string calldata symbol) external {
Token token = new Token(name, symbol);
emit TokenCreated(token);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment