Created
March 19, 2020 00:13
-
-
Save yurenju/033906d380874e21be47aef960186319 to your computer and use it in GitHub Desktop.
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
import dotenv from "dotenv"; | |
import { getDefaultProvider, Wallet } from "ethers"; | |
import { deployContract } from "ethereum-waffle"; | |
import SKETokenArtifact from "../build/SKEToken.json"; | |
import { SKEToken } from "../types/ethers-contracts/SKEToken"; | |
dotenv.config(); | |
async function deploy() { | |
const mnemonic = process.env["MNEMONIC"] || ""; | |
const provider = getDefaultProvider("ropsten"); | |
const wallet = Wallet.fromMnemonic(mnemonic).connect(provider); | |
const token = (await deployContract(wallet, SKETokenArtifact, [ | |
"100000" | |
])) as SKEToken; | |
console.log("deployed, address: " + token.address); | |
} | |
deploy(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment