Skip to content

Commit

Permalink
Merge pull request #21 from dev-protocol/hardhat-upgrades
Browse files Browse the repository at this point in the history
Using hardhat-upgrades
  • Loading branch information
aggre authored Mar 27, 2024
2 parents 66cbf19 + ceaff48 commit 7163544
Show file tree
Hide file tree
Showing 6 changed files with 870 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"overrides": [
{
"files": ["test/**/*.ts"],
"files": ["test/**/*.ts", "scripts/**/*.ts"],
"rules": {
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-assignment": "off"
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ cache
artifacts/
typechain-types/
cache/
.openzeppelin/
3 changes: 2 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import '@typechain/hardhat'
import * as dotenv from 'dotenv'
import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-waffle'
import '@nomiclabs/hardhat-etherscan'
import '@nomicfoundation/hardhat-verify'
import '@openzeppelin/hardhat-upgrades'
import type { HardhatUserConfig } from 'hardhat/config'

dotenv.config()
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
"license": "MPL-2.0",
"devDependencies": {
"@devprotocol/util-contracts": "^3.3.0",
"@nomicfoundation/hardhat-verify": "^2.0.5",
"@nomiclabs/hardhat-ethers": "2.2.3",
"@nomiclabs/hardhat-etherscan": "3.1.8",
"@nomiclabs/hardhat-waffle": "2.0.6",
"@openzeppelin/contracts": "4.8.2",
"@openzeppelin/hardhat-upgrades": "1.28.0",
"@types/chai": "4.3.11",
"@types/dotenv": "8.2.0",
"@types/mocha": "10.0.6",
Expand Down
10 changes: 7 additions & 3 deletions scripts/deploySBTFactory.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ethers, run } from 'hardhat'
import { ethers, run, upgrades } from 'hardhat'
import type { SBTFactory__factory } from '../typechain-types'

async function main() {
console.log('Starting deploySBTFactory script on sbt-tokens...')
Expand All @@ -9,8 +10,11 @@ async function main() {

// >>> Deploy SBTFactory >>>
console.log('Deploying SBTFactory...')
const sbtFactoryFactory = await ethers.getContractFactory('SBTFactory')
const sbtFactoryInstance = await sbtFactoryFactory.deploy()
const sbtFactoryFactory = (await ethers.getContractFactory(
'SBTFactory'
)) as SBTFactory__factory
const sbtFactoryInstance = await upgrades.deployProxy(sbtFactoryFactory, [])

const sbtFactoryInstanceDeployTxn = sbtFactoryInstance.deployTransaction
console.log(
` - SBTFactory deploying at txn:${sbtFactoryInstanceDeployTxn.hash}`
Expand Down
Loading

0 comments on commit 7163544

Please sign in to comment.