-
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.
Adding local deployment script (#16)
Adding local deployment script the DIDRegistry contract --------- Authored-by: Robert Leonard Reviewed-by: Martin Riedel
- Loading branch information
1 parent
c5b15fe
commit 636fed8
Showing
4 changed files
with
34 additions
and
14 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
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"repository": "[email protected]:identity-com/did-bnb.git", | ||
"license": "MIT", | ||
"scripts": { | ||
"local-deployment": "npx hardhat run --network local scripts/deployLocally.ts", | ||
"testnet-deploy-and-verify-contract": "npx hardhat run --network testnetBnb scripts/deployProxy.ts", | ||
"testnet-upgrade-and-verify-contract": "npx hardhat run --network testnetBnb scripts/upgradeProxyImplementation.ts", | ||
"mainnet-deploy-and-verify-contract": "npx hardhat run --network bnbSmartChain scripts/deployProxy.ts", | ||
|
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,29 @@ | ||
import { ethers } from "hardhat"; | ||
|
||
export const DETERMINISTIC_ADDRESS = "0x0d2026b3EE6eC71FC6746ADb6311F6d3Ba1C000B"; | ||
|
||
async function main() { | ||
//@ts-ignore | ||
|
||
const deployment = await ethers.deployContract("DIDRegistry", []); | ||
|
||
const deployedAddress = await deployment.getAddress(); | ||
|
||
const bytecode = await deployment.getDeployedCode(); | ||
|
||
console.log(`Did Registry deployed at: ${deployedAddress}`); | ||
|
||
await ethers.provider.send('anvil_setCode',[ | ||
DETERMINISTIC_ADDRESS, | ||
bytecode | ||
]) | ||
|
||
console.log(`Did Registry deployed at deterministic address: ${DETERMINISTIC_ADDRESS}`); | ||
|
||
} | ||
|
||
|
||
main().catch((error) => { | ||
console.error(error); | ||
process.exitCode = 1; | ||
}); |