Skip to content

Documentation for adding an ERC20 token to this template? #48

Answered by PaulRBerg
garrettmaring asked this question in Q&A
Discussion options

You must be logged in to vote

Hey Garett! There are multiple ways. Here's the first approach with OpenZeppelin:

yarn add @openzeppelin/contracts
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract MyToken is ERC20 {
    constructor() ERC20("MyToken", "MTK", 18) {}
}

And here's the second approach with my contracts library:

yarn add @paulrberg/contracts
pragma solidity ^0.8.0;

import @paulrberg/contracts/token/erc20/Erc20.sol";

contract MyToken is Erc20 {

    constructor() Erc20("MyToken", "MTK", 18) {}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by garrettmaring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants