Skip to content

Commit a63d97f

Browse files
author
Yash Agrawal
committed
feat: add deploy script
1 parent 744104a commit a63d97f

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

scripts/deploy.ts

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
import { ethers } from 'hardhat'
1+
import { ethers, run } from 'hardhat'
22

33
async function main() {
44
console.log('Starting deploy script on sbt-tokens...')
55

66
const [signer] = await ethers.getSigners()
77
console.log('Signer is: ', signer.address)
8+
console.log()
89

10+
// @TODO: modify this when deploying...
11+
const minterUpdater = signer.address
12+
// @TODO: modify this when deploying...
13+
const minters = [signer.address]
914
// @TODO: modify this address when deploying...
1015
const proxyAdmin = '0x2e8fCbd8d3968252f1FC427Ff06928343B650bc3'
1116

@@ -14,6 +19,10 @@ async function main() {
1419
const sbtFactory = await ethers.getContractFactory('SBT')
1520
const sbtImplementation = await sbtFactory.deploy()
1621
await sbtImplementation.deployed()
22+
console.log(
23+
` - SBT implementation deployed at address:${sbtImplementation.address}`
24+
)
25+
console.log()
1726

1827
// >>> Deploy SBTProxy >>>
1928
console.log('Deploying SBT proxy...')
@@ -24,15 +33,29 @@ async function main() {
2433
ethers.utils.arrayify('0x')
2534
)
2635
await sbtProxyInstance.deployed()
36+
console.log(` - SBT proxy deployed at address:${sbtProxyInstance.address}`)
37+
console.log()
2738

2839
// >>> Initialize SBT Proxy >>>
2940
console.log('Initializing SBT proxy...')
3041
const sbtProxy = sbtFactory.attach(sbtProxyInstance.address)
31-
await sbtProxy.functions.initialize(signer.address, [signer.address])
42+
await sbtProxy.functions.initialize(minterUpdater, minters)
43+
44+
// >>> Verify SBTImplementation code >>>
45+
await run(`verify:verify`, {
46+
address: sbtImplementation.address,
47+
constructorArguments: [],
48+
})
3249

33-
console.log('Signer:', signer.address)
34-
console.log('SBTProxy deployed to:', sbtProxyInstance.address)
35-
console.log('SBTImplementation deployed to:', sbtImplementation.address)
50+
// >>> Verify SBTProxy code >>>
51+
await run(`verify:verify`, {
52+
address: sbtProxyInstance.address,
53+
constructorArguments: [
54+
sbtImplementation.address,
55+
proxyAdmin,
56+
ethers.utils.arrayify('0x'),
57+
],
58+
})
3659
}
3760

3861
main()

0 commit comments

Comments
 (0)