Created
October 15, 2022 13:18
-
-
Save dobestan/bb62ce4a123238a4560baa3d2af8c689 to your computer and use it in GitHub Desktop.
Decipher Solidity #20221015
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity >= 0.8.0; | |
import "./Token.sol"; // Token Contract | |
contract Factory { | |
function createTokenContract( | |
string memory _name, | |
string memory _symbol | |
) public returns (address) { | |
Token token = new Token(_name, _symbol); | |
return address(token); // 0xD3e2008b4Da2cD6DEAF73471590fF30C86778A48 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity >= 0.8.0; | |
// import "./DAO.sol"; | |
// import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol"; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
contract Token is ERC20 { | |
constructor(string memory _name, string memory _symbol) ERC20(_name, _symbol) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment