Skip to content

Commit

Permalink
rename owner to admin in deployment scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelcabot committed Sep 27, 2022
1 parent 7f56975 commit db67437
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 32 deletions.
6 changes: 3 additions & 3 deletions deploy/CORN.ts
Expand Up @@ -3,7 +3,7 @@ import { getEnvParams } from "../src/utils/EnvParams";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { DeployFunction } from "hardhat-deploy/dist/types";

let owner: SignerWithAddress;
let admin: SignerWithAddress;

const func: DeployFunction = async ({
// @ts-ignore
Expand All @@ -20,7 +20,7 @@ const func: DeployFunction = async ({
// const currentNonce: number = await ethers.provider.getTransactionCount(deployer);
// to solve REPLACEMENT_UNDERPRICED, when needed

[, owner] = await ethers.getSigners();
[, admin] = await ethers.getSigners();
const env = getEnvParams(network.name);

const cornDeploymentResult = await deploy("CORN", {
Expand Down Expand Up @@ -49,7 +49,7 @@ const func: DeployFunction = async ({

const corn = await ethers.getContractAt("CORN", cornDeploymentResult.address);
await corn.transfer(
env.OWNER || owner.address,
env.ADMIN || admin.address,
ethers.utils.parseEther("1000")
);
};
Expand Down
8 changes: 4 additions & 4 deletions deploy/SoulLinker.ts
Expand Up @@ -3,7 +3,7 @@ import { getEnvParams } from "../src/utils/EnvParams";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { DeployFunction } from "hardhat-deploy/dist/types";

let owner: SignerWithAddress;
let admin: SignerWithAddress;

const func: DeployFunction = async ({
// @ts-ignore
Expand All @@ -20,12 +20,12 @@ const func: DeployFunction = async ({
// const currentNonce: number = await ethers.provider.getTransactionCount(deployer);
// to solve REPLACEMENT_UNDERPRICED, when needed

[, owner] = await ethers.getSigners();
[, admin] = await ethers.getSigners();
const env = getEnvParams(network.name);

const soulLinkerDeploymentResult = await deploy("SoulLinker", {
from: deployer,
args: [env.OWNER || owner.address],
args: [env.ADMIN || admin.address],
log: true
// nonce: currentNonce + 1 // to solve REPLACEMENT_UNDERPRICED, when needed
});
Expand All @@ -35,7 +35,7 @@ const func: DeployFunction = async ({
try {
await hre.run("verify:verify", {
address: soulLinkerDeploymentResult.address,
constructorArguments: [env.OWNER || owner.address]
constructorArguments: [env.ADMIN || admin.address]
});
} catch (error) {
if (
Expand Down
12 changes: 6 additions & 6 deletions deploy/SoulName.ts
Expand Up @@ -3,7 +3,7 @@ import { getEnvParams, getPrivateKey } from "../src/utils/EnvParams";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { DeployFunction } from "hardhat-deploy/dist/types";

let owner: SignerWithAddress;
let admin: SignerWithAddress;

const func: DeployFunction = async ({
// @ts-ignore
Expand All @@ -17,7 +17,7 @@ const func: DeployFunction = async ({
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();

[, owner] = await ethers.getSigners();
[, admin] = await ethers.getSigners();
const env = getEnvParams(network.name);
const baseUri = `${env.BASE_URI}/name/`;

Expand All @@ -26,7 +26,7 @@ const func: DeployFunction = async ({
const soulNameDeploymentResult = await deploy("SoulName", {
from: deployer,
args: [
env.OWNER || owner.address,
env.ADMIN || admin.address,
soulboundIdentityDeployed.address,
".soul",
baseUri
Expand All @@ -40,7 +40,7 @@ const func: DeployFunction = async ({
await hre.run("verify:verify", {
address: soulNameDeploymentResult.address,
constructorArguments: [
env.OWNER || owner.address,
env.ADMIN || admin.address,
soulboundIdentityDeployed.address,
".soul",
""
Expand All @@ -66,12 +66,12 @@ const func: DeployFunction = async ({
);

// we set the soulName contract in soulboundIdentity and we add soulboundIdentity as soulName minter
const signer = env.OWNER
const signer = env.ADMIN
? new ethers.Wallet(
getPrivateKey(network.name),
ethers.getDefaultProvider(network.name)
)
: owner;
: admin;

const MINTER_ROLE = await soulName.MINTER_ROLE();
await soulboundIdentity
Expand Down
20 changes: 9 additions & 11 deletions deploy/SoulStore.ts
Expand Up @@ -9,7 +9,7 @@ import {
WETH_GOERLI
} from "../src/constants";

let owner: SignerWithAddress;
let admin: SignerWithAddress;

const func: DeployFunction = async ({
// @ts-ignore
Expand All @@ -23,7 +23,7 @@ const func: DeployFunction = async ({
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();

[, owner] = await ethers.getSigners();
[, admin] = await ethers.getSigners();
const env = getEnvParams(network.name);

const corn = await deployments.get("CORN");
Expand Down Expand Up @@ -61,7 +61,7 @@ const func: DeployFunction = async ({
const soulStoreDeploymentResult = await deploy("SoulStore", {
from: deployer,
args: [
env.OWNER || owner.address,
env.ADMIN || admin.address,
soulboundIdentityDeployed.address,
"10000000", // 10 USDC, with 6 decimals
network.name == "hardhat" || network.name == "goerli"
Expand All @@ -70,7 +70,7 @@ const func: DeployFunction = async ({
stableCoin,
wrappedNativeToken,
swapRouter,
env.OWNER || owner.address
env.ADMIN || admin.address
],
log: true
});
Expand All @@ -81,14 +81,14 @@ const func: DeployFunction = async ({
await hre.run("verify:verify", {
address: soulStoreDeploymentResult.address,
constructorArguments: [
env.OWNER || owner.address,
env.ADMIN || admin.address,
soulboundIdentityDeployed.address,
"10000000", // 10 USDC, with 6 decimals
CORN_GOERLI, // CORN
stableCoin,
wrappedNativeToken,
swapRouter,
env.OWNER || owner.address
env.ADMIN || admin.address
]
});
} catch (error) {
Expand All @@ -110,12 +110,12 @@ const func: DeployFunction = async ({
soulNameDeployed.address
);

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

// we set the registration prices per year and length of name
const soulStore = await ethers.getContractAt(
Expand All @@ -131,9 +131,7 @@ const func: DeployFunction = async ({
await soulStore
.connect(signer)
.setNameRegistrationPricePerYear(3, 1500000000); // 3 length, 1,500 USDC
await soulStore
.connect(signer)
.setNameRegistrationPricePerYear(4, 500000000); // 4 length, 500 USDC
await soulStore.connect(signer).setNameRegistrationPricePerYear(4, 500000000); // 4 length, 500 USDC

// we add soulStore as soulboundIdentity and soulName minter

Expand Down
8 changes: 4 additions & 4 deletions deploy/SoulboundCreditReport.ts
Expand Up @@ -3,7 +3,7 @@ import { getEnvParams } from "../src/utils/EnvParams";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { DeployFunction } from "hardhat-deploy/dist/types";

let owner: SignerWithAddress;
let admin: SignerWithAddress;

const func: DeployFunction = async ({
// @ts-ignore
Expand All @@ -20,7 +20,7 @@ const func: DeployFunction = async ({
// const currentNonce: number = await ethers.provider.getTransactionCount(deployer);
// to solve REPLACEMENT_UNDERPRICED, when needed

[, owner] = await ethers.getSigners();
[, admin] = await ethers.getSigners();
const env = getEnvParams(network.name);
const baseUri = `${env.BASE_URI}/credit-report/`;

Expand All @@ -30,7 +30,7 @@ const func: DeployFunction = async ({
"SoulboundCreditReport",
{
from: deployer,
args: [env.OWNER || owner.address, soulLinker.address, baseUri],
args: [env.ADMIN || admin.address, soulLinker.address, baseUri],
log: true
// nonce: currentNonce + 1 // to solve REPLACEMENT_UNDERPRICED, when needed
}
Expand All @@ -42,7 +42,7 @@ const func: DeployFunction = async ({
await hre.run("verify:verify", {
address: soulboundCreditReportDeploymentResult.address,
constructorArguments: [
env.OWNER || owner.address,
env.ADMIN || admin.address,
soulLinker.address,
baseUri
]
Expand Down
8 changes: 4 additions & 4 deletions deploy/SoulboundIdentity.ts
Expand Up @@ -3,7 +3,7 @@ import { getEnvParams } from "../src/utils/EnvParams";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { DeployFunction } from "hardhat-deploy/dist/types";

let owner: SignerWithAddress;
let admin: SignerWithAddress;

const func: DeployFunction = async ({
// @ts-ignore
Expand All @@ -20,15 +20,15 @@ const func: DeployFunction = async ({
// const currentNonce: number = await ethers.provider.getTransactionCount(deployer);
// to solve REPLACEMENT_UNDERPRICED, when needed

[, owner] = await ethers.getSigners();
[, admin] = await ethers.getSigners();
const env = getEnvParams(network.name);
const baseUri = `${env.BASE_URI}/identity/`;

const soulLinker = await deployments.get("SoulLinker");

const soulboundIdentityDeploymentResult = await deploy("SoulboundIdentity", {
from: deployer,
args: [env.OWNER || owner.address, soulLinker.address, baseUri],
args: [env.ADMIN || admin.address, soulLinker.address, baseUri],
log: true
// nonce: currentNonce + 1 // to solve REPLACEMENT_UNDERPRICED, when needed
});
Expand All @@ -39,7 +39,7 @@ const func: DeployFunction = async ({
await hre.run("verify:verify", {
address: soulboundIdentityDeploymentResult.address,
constructorArguments: [
env.OWNER || owner.address,
env.ADMIN || admin.address,
soulLinker.address,
baseUri
]
Expand Down

0 comments on commit db67437

Please sign in to comment.