Skip to content

Commit

Permalink
call addAuthority() in self-sovereign SBTs deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelcabot committed Dec 9, 2022
1 parent 13fc38b commit 98b654e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
19 changes: 18 additions & 1 deletion deploy/Soulbound2FA.ts
@@ -1,5 +1,5 @@
import hre from "hardhat";
import { getEnvParams } from "../src/utils/EnvParams";
import { getEnvParams, getPrivateKey } from "../src/utils/EnvParams";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { DeployFunction } from "hardhat-deploy/dist/types";
import {
Expand Down Expand Up @@ -103,6 +103,23 @@ const func: DeployFunction = async ({
}
}
}

const signer = env.ADMIN
? new ethers.Wallet(
getPrivateKey(network.name),
ethers.getDefaultProvider(network.name)
)
: admin;

const soulbound2FA = await ethers.getContractAt(
"Soulbound2FA",
soulbound2FADeploymentResult.address
);

// add authority to soulbound2FA
await soulbound2FA
.connect(signer)
.addAuthority(env.AUTHORITY_WALLET || admin.address);
};

func.tags = ["Soulbound2FA"];
Expand Down
19 changes: 18 additions & 1 deletion deploy/SoulboundCreditReport.ts
@@ -1,5 +1,5 @@
import hre from "hardhat";
import { getEnvParams } from "../src/utils/EnvParams";
import { getEnvParams, getPrivateKey } from "../src/utils/EnvParams";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { DeployFunction } from "hardhat-deploy/dist/types";
import {
Expand Down Expand Up @@ -106,6 +106,23 @@ const func: DeployFunction = async ({
}
}
}

const signer = env.ADMIN
? new ethers.Wallet(
getPrivateKey(network.name),
ethers.getDefaultProvider(network.name)
)
: admin;

const soulboundCreditScore = await ethers.getContractAt(
"SoulboundCreditScore",
soulboundCreditScoreDeploymentResult.address
);

// add authority to soulboundCreditScore
await soulboundCreditScore
.connect(signer)
.addAuthority(env.AUTHORITY_WALLET || admin.address);
};

func.tags = ["SoulboundCreditScore"];
Expand Down

0 comments on commit 98b654e

Please sign in to comment.