Skip to content

Commit ceaff48

Browse files
committed
using hardhat-upgrades
1 parent 66cbf19 commit ceaff48

File tree

6 files changed

+870
-35
lines changed

6 files changed

+870
-35
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"overrides": [
2323
{
24-
"files": ["test/**/*.ts"],
24+
"files": ["test/**/*.ts", "scripts/**/*.ts"],
2525
"rules": {
2626
"@typescript-eslint/no-unsafe-call": "off",
2727
"@typescript-eslint/no-unsafe-assignment": "off"

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ cache
33
artifacts/
44
typechain-types/
55
cache/
6+
.openzeppelin/

hardhat.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import '@typechain/hardhat'
22
import * as dotenv from 'dotenv'
33
import '@nomiclabs/hardhat-ethers'
44
import '@nomiclabs/hardhat-waffle'
5-
import '@nomiclabs/hardhat-etherscan'
5+
import '@nomicfoundation/hardhat-verify'
6+
import '@openzeppelin/hardhat-upgrades'
67
import type { HardhatUserConfig } from 'hardhat/config'
78

89
dotenv.config()

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222
"license": "MPL-2.0",
2323
"devDependencies": {
2424
"@devprotocol/util-contracts": "^3.3.0",
25+
"@nomicfoundation/hardhat-verify": "^2.0.5",
2526
"@nomiclabs/hardhat-ethers": "2.2.3",
26-
"@nomiclabs/hardhat-etherscan": "3.1.8",
2727
"@nomiclabs/hardhat-waffle": "2.0.6",
2828
"@openzeppelin/contracts": "4.8.2",
29+
"@openzeppelin/hardhat-upgrades": "1.28.0",
2930
"@types/chai": "4.3.11",
3031
"@types/dotenv": "8.2.0",
3132
"@types/mocha": "10.0.6",

scripts/deploySBTFactory.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { ethers, run } from 'hardhat'
1+
import { ethers, run, upgrades } from 'hardhat'
2+
import type { SBTFactory__factory } from '../typechain-types'
23

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

1011
// >>> Deploy SBTFactory >>>
1112
console.log('Deploying SBTFactory...')
12-
const sbtFactoryFactory = await ethers.getContractFactory('SBTFactory')
13-
const sbtFactoryInstance = await sbtFactoryFactory.deploy()
13+
const sbtFactoryFactory = (await ethers.getContractFactory(
14+
'SBTFactory'
15+
)) as SBTFactory__factory
16+
const sbtFactoryInstance = await upgrades.deployProxy(sbtFactoryFactory, [])
17+
1418
const sbtFactoryInstanceDeployTxn = sbtFactoryInstance.deployTransaction
1519
console.log(
1620
` - SBTFactory deploying at txn:${sbtFactoryInstanceDeployTxn.hash}`

0 commit comments

Comments
 (0)