Skip to content

Commit

Permalink
fix: subnetId length
Browse files Browse the repository at this point in the history
Signed-off-by: Jawad Tariq <[email protected]>
  • Loading branch information
JDawg287 committed Dec 28, 2023
1 parent a35e796 commit 5955236
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions scripts/deploy-topos-msg-protocol-dynamic.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getDefaultProvider, isHexString, Wallet } from 'ethers'
import { isHexString, JsonRpcProvider, Wallet } from 'ethers'

import { TokenDeployer__factory } from '../typechain-types/factories/contracts/topos-core/TokenDeployer__factory'
import { ToposCore__factory } from '../typechain-types/factories/contracts/topos-core/ToposCore__factory'
Expand All @@ -8,7 +8,7 @@ import { ToposCore } from '../typechain-types/contracts/topos-core/ToposCore'

const main = async function (...args: string[]) {
const [providerEndpoint, _sequencerPrivateKey] = args
const provider = getDefaultProvider(providerEndpoint)
const provider = new JsonRpcProvider(providerEndpoint)
const toposDeployerPrivateKey = sanitizeHexString(
process.env.PRIVATE_KEY || ''
)
Expand All @@ -26,7 +26,7 @@ const main = async function (...args: string[]) {
}

const sequencerWallet = new Wallet(sequencerPrivateKey, provider)
const sequencerPublicKey = sequencerWallet.signingKey.publicKey
const sequencerPublicKey = sequencerWallet.signingKey.compressedPublicKey

const subnetId = sanitizeHexString(sequencerPublicKey.substring(4))

Expand Down Expand Up @@ -60,12 +60,12 @@ const main = async function (...args: string[]) {
toposDeployerWallet
).deploy(toposCoreAddress, { gasLimit: 5_000_000 })
await ToposCoreProxy.waitForDeployment()
const toposCoreProxyAddress = ToposCoreProxy.getAddress()
const toposCoreProxyAddress = await ToposCoreProxy.getAddress()
console.log(`Topos Core Proxy contract deployed to ${toposCoreProxyAddress}`)

console.info(`Initializing Topos Core Contract`)
const toposCoreConnectedToSequencer = ToposCore__factory.connect(
toposCoreAddress,
toposCoreProxyAddress,
sequencerWallet
)
const adminThreshold = 1
Expand All @@ -81,7 +81,7 @@ const main = async function (...args: string[]) {
).deploy(tokenDeployerAddress, toposCoreProxyAddress, { gasLimit: 5_000_000 })
await ERC20Messaging.waitForDeployment()
const erc20MessagingAddress = await ERC20Messaging.getAddress()
console.log(`ERC20 Messaging contract deployed to ${erc20MessagingAddress}}`)
console.log(`ERC20 Messaging contract deployed to ${erc20MessagingAddress}`)

console.info(`Setting subnetId on ToposCore via proxy`)
await toposCoreConnectedToSequencer
Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy-topos-msg-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const main = async function (...args: string[]) {
}

const sequencerWallet = new Wallet(sequencerPrivateKey, provider)
const sequencerPublicKey = sequencerWallet.signingKey.publicKey
const sequencerPublicKey = sequencerWallet.signingKey.compressedPublicKey

const subnetId = sanitizeHexString(sequencerPublicKey.substring(4))

Expand Down

0 comments on commit 5955236

Please sign in to comment.