Skip to content

Commit

Permalink
don't get address of SoulName in SoulStore deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelcabot committed Apr 5, 2023
1 parent 83d380f commit 439dd36
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions deploy/SoulStore.ts
Expand Up @@ -21,7 +21,20 @@ const func: DeployFunction = async ({
const env = getEnvParams(network.name);

const soulboundIdentityDeployed = await deployments.get("SoulboundIdentity");
const soulNameDeployed = await deployments.get("SoulName");
let soulNameDeployedAddress;
if (
network.name === "mainnet" ||
network.name === "goerli" ||
network.name === "hardhat" ||
network.name === "celo" ||
network.name === "alfajores" ||
network.name === "basegoerli"
) {
const soulNameDeployed = await deployments.get("SoulName");
soulNameDeployedAddress = soulNameDeployed.address;
} else {
soulNameDeployedAddress = ethers.constants.AddressZero;
}

const constructorArguments = [
env.ADMIN || admin.address,
Expand Down Expand Up @@ -79,10 +92,6 @@ const func: DeployFunction = async ({
"SoulboundIdentity",
soulboundIdentityDeployed.address
);
const soulName = await ethers.getContractAt(
"SoulName",
soulNameDeployed.address
);

const signer = env.ADMIN
? new ethers.Wallet(getPrivateKey(network.name), ethers.provider)
Expand Down Expand Up @@ -118,10 +127,17 @@ const func: DeployFunction = async ({
.connect(signer)
.grantRole(IDENTITY_MINTER_ROLE, soulStoreDeploymentResult.address);

const NAME_MINTER_ROLE = await soulName.MINTER_ROLE();
await soulName
.connect(signer)
.grantRole(NAME_MINTER_ROLE, soulStoreDeploymentResult.address);
if (soulNameDeployedAddress !== ethers.constants.AddressZero) {
const soulName = await ethers.getContractAt(
"SoulName",
soulNameDeployedAddress
);

const NAME_MINTER_ROLE = await soulName.MINTER_ROLE();
await soulName
.connect(signer)
.grantRole(NAME_MINTER_ROLE, soulStoreDeploymentResult.address);
}

// we add payment methods
const paymentMethods = env.PAYMENT_METHODS_SOULSTORE.split(" ");
Expand Down

0 comments on commit 439dd36

Please sign in to comment.