-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from shobhit9070/shobhitdev
A python program to create your own Cryptocurrency #13 30
- Loading branch information
Showing
7 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.sol linguist-language=Solidity | ||
*.vy linguist-language=Python |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
__pycache__ | ||
.env | ||
.history | ||
.hypothesis/ | ||
build/ | ||
reports/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
dependencies: | ||
- OpenZeppelin/[email protected] | ||
compiler: | ||
solc: | ||
remappings: | ||
- "@openzeppelin=OpenZeppelin/[email protected]" | ||
dotenv: .env | ||
wallets: | ||
from_key: ${PRIVATE_KEY} #enter you own private key |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// contracts/GLDToken.sol | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
|
||
contract OurToken is ERC20 { | ||
constructor(uint256 initialSupply) | ||
ERC20("#NameOFyouToken", "SymbolOfyourToken") | ||
{ | ||
_mint(msg.sender, initialSupply); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from brownie import OurToken | ||
from scripts.helpul_scripts import get_account | ||
from web3 import Web3 | ||
|
||
initial_supply = Web3.toWei(1000, "ether") #enter the inital supply you want for your token | ||
|
||
|
||
def main(): | ||
account = get_account() | ||
our_token = OurToken.deploy(initial_supply, {"from": account}) | ||
print(our_token.name()) |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from brownie import accounts, network, config | ||
|
||
# list of test networks for deploying the token | ||
LOCAL_BLOCKCHAIN_ENVIRONMENTS = [ | ||
"development", | ||
"ganache", | ||
"hardhat", | ||
"local-ganache", | ||
"mainnet-fork", | ||
] | ||
|
||
|
||
def get_account(index=None, id=None): | ||
if index: | ||
return accounts[index] | ||
if network.show_active() in LOCAL_BLOCKCHAIN_ENVIRONMENTS: | ||
print(accounts[0].balance()) | ||
return accounts[0] | ||
if id: | ||
return accounts.load(id) | ||
return accounts.add(config["wallets"]["from_key"]) |