Skip to content

Commit

Permalink
Merge pull request #82 from onchain-id/features/deploy-id-task
Browse files Browse the repository at this point in the history
Features/deploy id task
  • Loading branch information
Nakasar authored Mar 23, 2023
2 parents f5855a2 + d985e50 commit 782fb92
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
7 changes: 7 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ import "@nomiclabs/hardhat-solhint";

import "./tasks/add-claim.task";
import "./tasks/add-key.task";
import "./tasks/deploy-identity.task";
import "./tasks/deploy-proxy.task";
import "./tasks/remove-claim.task";
import "./tasks/remove-key.task";
import "./tasks/revoke.task";

const config: HardhatUserConfig = {
solidity: "0.8.17",
networks: {
mumbai: {
url: 'https://rpc-mumbai.maticvigil.com/v1/9cd3d6ce21f0a25bb8f33504a1820d616f700d24',
accounts: ["1d79b7c95d2456a55f55a0e17f856412637fa6b3c332fa557ce2c8a89139ec74"],
}
}
};

export default config;
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onchain-id/solidity",
"version": "2.0.0-beta-2",
"version": "2.0.0-beta-3",
"description": "Ethereum solidity smart contracts for Blockchain OnchainID identities.",
"files": [
"artifacts",
Expand Down
17 changes: 17 additions & 0 deletions tasks/deploy-identity.task.ts
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}`);
});

0 comments on commit 782fb92

Please sign in to comment.