setup stuff
This commit is contained in:
parent
98af8dccad
commit
fa4ede8fbc
|
@ -1,7 +1,8 @@
|
||||||
import { HardhatUserConfig } from "hardhat/config";
|
import { HardhatUserConfig } from "hardhat/config";
|
||||||
import "@nomicfoundation/hardhat-toolbox";
|
import "@nomicfoundation/hardhat-toolbox";
|
||||||
import "hardhat-contract-sizer";
|
import "hardhat-contract-sizer";
|
||||||
import "dotenv/config";
|
import dotenv from "dotenv";
|
||||||
|
dotenv.config({ path: `.env.${process.env.NODE_ENV || "local"}` });
|
||||||
|
|
||||||
const config: HardhatUserConfig = {
|
const config: HardhatUserConfig = {
|
||||||
solidity: {
|
solidity: {
|
||||||
|
|
|
@ -1,21 +1,27 @@
|
||||||
import { ethers } from "hardhat";
|
import { ethers } from "hardhat";
|
||||||
import "dotenv/config";
|
import fs from "fs/promises";
|
||||||
|
import dotenv from "dotenv";
|
||||||
|
const env = process.env.NODE_ENV || "local";
|
||||||
|
dotenv.config({ path: `.env.${env}` });
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
if (!process.env.BRIDGE_ADDRESS) throw "Bridge address not defined";
|
if (!process.env.BASE_BRIDGE_ADDRESS) throw "Bridge address not defined";
|
||||||
if (!process.env.ETH_TOKEN) throw "10grans Ethereum token address not defined";
|
const tenGransAddress = (await fs.readFile(`.10grans-eth-address.${env}`, "utf-8")).trim();
|
||||||
|
|
||||||
const TENGRANS = await ethers.deployContract(
|
const TENGRANS = await ethers.deployContract(
|
||||||
"TenGransBaseToken",
|
"TenGransBaseToken",
|
||||||
[
|
[
|
||||||
process.env.BRIDGE_ADDRESS,
|
process.env.BASE_BRIDGE_ADDRESS,
|
||||||
process.env.ETH_TOKEN
|
tenGransAddress
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
await TENGRANS.waitForDeployment();
|
await TENGRANS.waitForDeployment();
|
||||||
|
const deployedAddress = await TENGRANS.getAddress();
|
||||||
|
|
||||||
|
console.log(`Base 10grans deployed to: ${deployedAddress}`);
|
||||||
|
await fs.writeFile(`.10grans-base-address.${env}`, deployedAddress);
|
||||||
|
|
||||||
console.log(`Base 10grans deployed to: ${TENGRANS.target}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// We recommend this pattern to be able to use async/await everywhere
|
// We recommend this pattern to be able to use async/await everywhere
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
import { ethers } from "hardhat";
|
import { ethers } from "hardhat";
|
||||||
|
import fs from "fs/promises";
|
||||||
|
const env = process.env.NODE_ENV || "local";
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const TENGRANS = await ethers.deployContract("TenGransEthToken");
|
const TENGRANS = await ethers.deployContract("TenGransEthToken");
|
||||||
|
|
||||||
await TENGRANS.waitForDeployment();
|
await TENGRANS.waitForDeployment();
|
||||||
|
const deployedAddress = await TENGRANS.getAddress();
|
||||||
|
|
||||||
console.log(`Ethereum 10grans deployed to: ${TENGRANS.target}`);
|
console.log(`Ethereum 10grans deployed to: ${deployedAddress}`);
|
||||||
|
await fs.writeFile(`.10grans-eth-address.${env}`, deployedAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We recommend this pattern to be able to use async/await everywhere
|
// We recommend this pattern to be able to use async/await everywhere
|
||||||
|
|
Loading…
Reference in New Issue