This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ws endpoint to SubnetRegistrator.sol
Signed-off-by: Jawad Tariq <[email protected]>
- Loading branch information
Showing
3 changed files
with
64 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { ContractFactory, Wallet, providers } from 'ethers' | ||
|
||
import ConstAddressDeployerJSON from '../../artifacts/contracts/topos-core/ConstAddressDeployer.sol/ConstAddressDeployer.json' | ||
|
||
/// function to deploy the constant address deployer | ||
const main = async function (...args: string[]) { | ||
const [providerEndpoint, privateKey] = args | ||
const provider = new providers.JsonRpcProvider(providerEndpoint) | ||
const toposDeployerPrivateKey = sanitizeHexString(privateKey || '') | ||
|
||
// deploy the constant address deployer | ||
const wallet = new Wallet(toposDeployerPrivateKey, provider) | ||
const ConstAddressDeployerFactory = new ContractFactory( | ||
ConstAddressDeployerJSON.abi, | ||
ConstAddressDeployerJSON.bytecode, | ||
wallet | ||
) | ||
const ConstAddressDeployer = await ConstAddressDeployerFactory.deploy({ | ||
gasLimit: 5_000_000, | ||
}) | ||
await ConstAddressDeployer.deployed() | ||
console.log('ConstAddressDeployer deployed to:', ConstAddressDeployer.address) | ||
} | ||
|
||
const sanitizeHexString = function (hexString: string) { | ||
return hexString.startsWith('0x') ? hexString : `0x${hexString}` | ||
} | ||
|
||
const args = process.argv.slice(2) | ||
main(...args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters