Skip to content

Commit ab61d13

Browse files
committed
add upgrading script for SBTFactory
1 parent 6e2519b commit ab61d13

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

scripts/upgradeSBTFactory.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { ethers, run, upgrades } from 'hardhat'
2+
import type { SBTFactory__factory } from '../typechain-types'
3+
4+
const proxyAddress = '0x362AA10263ba04a54390E544E6Ca8F4aCdE19a44'
5+
6+
async function main() {
7+
console.log('Starting upgradeSBTFactory script on sbt-tokens...')
8+
9+
const [signer] = await ethers.getSigners()
10+
console.log('Signer is: ', signer.address)
11+
console.log()
12+
13+
// >>> Upgrade SBTFactory >>>
14+
console.log('Upgrading SBTFactory...')
15+
const sbtFactoryFactory = (await ethers.getContractFactory(
16+
'SBTFactory'
17+
)) as SBTFactory__factory
18+
const sbtFactoryInstance = await upgrades.upgradeProxy(
19+
proxyAddress,
20+
sbtFactoryFactory
21+
)
22+
23+
const sbtFactoryInstanceDeployTxn = sbtFactoryInstance.deployTransaction
24+
console.log(
25+
` - SBTFactory deploying at txn:${sbtFactoryInstanceDeployTxn.hash}`
26+
)
27+
await sbtFactoryInstance.deployed()
28+
console.log(` - SBTFactory deployed at address:${sbtFactoryInstance.address}`)
29+
await sbtFactoryInstanceDeployTxn.wait(2)
30+
console.log()
31+
32+
// >>> Verify SBTFactory code >>>
33+
console.log('Verifying SBTFactory contract...')
34+
await run(`verify:verify`, {
35+
address: sbtFactoryInstance.address,
36+
constructorArguments: [],
37+
})
38+
console.log()
39+
}
40+
41+
main()
42+
.then(() => process.exit(0))
43+
.catch((error) => {
44+
console.error(error)
45+
process.exit(1)
46+
})

0 commit comments

Comments
 (0)