Skip to content

Commit

Permalink
Added SoulName contract
Browse files Browse the repository at this point in the history
  • Loading branch information
H34D committed Sep 1, 2022
1 parent 6336a03 commit b1d2abf
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/common/helpers/contracts/index.ts
@@ -1,11 +1,13 @@
import {
SoulboundCreditReport__factory,
SoulboundIdentity__factory,
SoulboundCreditReport__factory,
SoulName__factory,
} from '@masa-finance/masa-contracts-identity';
import { ethers } from 'ethers';

import SoulboundIdentity from '@masa-finance/masa-contracts-identity/deployments/alfajores/SoulboundIdentity.json';
import SoulboundCreditReport from '@masa-finance/masa-contracts-identity/deployments/alfajores/SoulboundCreditReport.json';
import SoulName from '@masa-finance/masa-contracts-identity/deployments/alfajores/SoulName.json';

export const loadContracts = async (provider?: any) => {
const p =
Expand All @@ -17,37 +19,36 @@ export const loadContracts = async (provider?: any) => {
window.ethereum
);

const WEB3_IDENTITY_CONTRACT_ADDRESS = SoulboundIdentity.address;

const SoulboundIdentityContract = SoulboundIdentity__factory.connect(
WEB3_IDENTITY_CONTRACT_ADDRESS,
SoulboundIdentity.address,
p
);

console.log(
'Total supply of SoulboundIdentity at',
WEB3_IDENTITY_CONTRACT_ADDRESS,
SoulboundIdentity.address,
'is',
(await SoulboundIdentityContract.totalSupply()).toString()
);

const WEB3_CREDIT_REPORT_CONTRACT_ADDRESS = SoulboundCreditReport.address;

const SoulboundCreditReportContract = SoulboundCreditReport__factory.connect(
WEB3_CREDIT_REPORT_CONTRACT_ADDRESS,
SoulboundCreditReport.address,
p
);

console.log(
'Total supply of SoulboundCreditReport at',
WEB3_CREDIT_REPORT_CONTRACT_ADDRESS,
SoulboundCreditReport.address,
'is',
(await SoulboundCreditReportContract.totalSupply()).toString()
);

const SoulNameContract = SoulName__factory.connect(SoulName.address, p);

return {
SoulboundIdentityContract,
SoulboundCreditReportContract,
SoulNameContract,
};
};

Expand Down

0 comments on commit b1d2abf

Please sign in to comment.