Skip to content

Commit

Permalink
remove dependency on envfile
Browse files Browse the repository at this point in the history
  • Loading branch information
talentlessguy committed Jun 13, 2024
1 parent 45254ab commit 71b9885
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"chai": "^5.1.1",
"dotenv": "^16.4.5",
"elliptic-solidity": "^1.0.0",
"envfile": "^6.17.0",
"ethereum-waffle": "^3.3.0",
"ethers": "^5.6.1",
"hardhat": "^2.22.2",
Expand Down
22 changes: 8 additions & 14 deletions tasks/seed.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import fs from 'fs'
import { namehash } from 'viem/ens'
import * as envfile from 'envfile'
import * as dotenv from 'dotenv'
import { task } from 'hardhat/config'

const labelhash = (utils: any, label: string) =>
Expand All @@ -14,18 +13,13 @@ function getOpenSeaUrl(ethers: any, contract: string, namehashedname: string) {
task('seed', 'Creates test subbdomains and wraps them with Namewrapper')
.addPositionalParam('name', 'The ENS label to seed subdomains')
.setAction(async ({ name }, hre) => {
let parsedFile
try {
parsedFile = envfile.parse(fs.readFileSync('./.env', 'utf8'))
} catch (error: any) {
if (error.code !== 'ENOENT') {
throw error
}
console.warn(
'.env file is empty, fill as in README to complete seed action',
)
return
}
const { parsed: parsedFile, error } = dotenv.config({
path: './.env',
encoding: 'utf8',
})

if (error) throw error

const ethers = hre.ethers
const [deployer] = await ethers.getSigners()
const CAN_DO_EVERYTHING = 0
Expand Down

0 comments on commit 71b9885

Please sign in to comment.