Skip to content

Commit

Permalink
ERC20 token example
Browse files Browse the repository at this point in the history
  • Loading branch information
antico5 committed Aug 27, 2021
1 parent da8ec6e commit f5aa79d
Show file tree
Hide file tree
Showing 10 changed files with 28,340 additions and 0 deletions.
2 changes: 2 additions & 0 deletions erc20token/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALCHEMY_API_KEY=
ROPSTEN_PRIVATE_KEY=
6 changes: 6 additions & 0 deletions erc20token/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
.env

#Hardhat files
cache
artifacts
15 changes: 15 additions & 0 deletions erc20token/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Basic Sample Hardhat Project

This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, a sample script that deploys that contract, and an example of a task implementation, which simply lists the available accounts.

Try running some of the following tasks:

```shell
npx hardhat accounts
npx hardhat compile
npx hardhat clean
npx hardhat test
npx hardhat node
node scripts/sample-script.js
npx hardhat help
```
14 changes: 14 additions & 0 deletions erc20token/contracts/ArmanToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

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

contract ArmanToken is ERC20 {
constructor(uint256 initialSupply) ERC20("Gold", "GLD") {
_mint(msg.sender, initialSupply);
}

function _mint(address account, uint256 amount) internal override {
super._mint(account, amount);
}
}
28 changes: 28 additions & 0 deletions erc20token/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { task } from "hardhat/config";
import "@nomiclabs/hardhat-waffle";

import dotenv from 'dotenv'
dotenv.config()

// This is a sample Hardhat task. To learn how to create your own go to
// https://hardhat.org/guides/create-task.html
task("accounts", "Prints the list of accounts", async (args, hre) => {
const accounts = await hre.ethers.getSigners();

for (const account of accounts) {
console.log(await account.address);
}
});

// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more

export default {
solidity: "0.8.7",
networks: {
ropsten: {
url: `https://eth-ropsten.alchemyapi.io/v2/${process.env.ALCHEMY_API_KEY}`,
accounts: [`0x${process.env.ROPSTEN_PRIVATE_KEY}`],
},
},
};
Loading

0 comments on commit f5aa79d

Please sign in to comment.