Skip to content

Instantly share code, notes, and snippets.

@yurenju
Created March 19, 2020 00:13
Show Gist options
  • Save yurenju/033906d380874e21be47aef960186319 to your computer and use it in GitHub Desktop.
Save yurenju/033906d380874e21be47aef960186319 to your computer and use it in GitHub Desktop.
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