-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from onchain-id/features/deploy-id-task
Features/deploy id task
- Loading branch information
Showing
4 changed files
with
27 additions
and
3 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,17 @@ | ||
import {task} from "hardhat/config"; | ||
import {TaskArguments} from "hardhat/types"; | ||
|
||
task("deploy-identity", "Deploy an identity as a standalone contract") | ||
.addParam("from", "Will pay the gas for the transaction") | ||
.addParam("key", "The ethereum address that will own the identity (as a MANAGEMENT key)") | ||
.setAction(async (args: TaskArguments, hre) => { | ||
const signer = await hre.ethers.getSigner(args.from); | ||
|
||
const identity = await hre.ethers.deployContract('Identity', [args.key, false], signer); | ||
|
||
console.log(`Deploy a new identity at ${identity.address} . tx: ${identity.deployTransaction.hash}`); | ||
|
||
await identity.deployed(); | ||
|
||
console.log(`Deployed a new identity at ${identity.address} . tx: ${identity.deployTransaction.hash}`); | ||
}); |