Skip to content

deepalIGD/Super-PoC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OnchainID Smart Contracts

GitHub GitHub release (latest by date) GitHub Workflow Status (branch) GitHub repo size GitHub Release Date


OnchainID Smart Contracts

Smart Contracts for secure Blockchain Identities, implementation of the ERC734 and ERC735 proposal standards.

Learn more about OnchainID and Blockchain Identities on the official OnchainID website: https://onchainid.com.

Usage

  • Install contracts package to use in your repository yarn add @onchain-id/solidity
  • Require desired contracts in-code (should you need to deploy them):
    const { contracts: { ERC734, Identity } } = require('@onchain-id/solidity');
  • Require desired interfaces in-code (should you need to interact with deployed contracts):
    const { interfaces: { IERC734, IERC735 } } = require('@onchain-id/solidity');
  • Access contract ABI ERC734.abi and ByteCode ERC734.bytecode.

Development

  • Install dev dependencies npm ci
  • Update interfaces and contracts code.
  • Run lint npm run lint
  • Compile code npm run compile

Testing

  • Run npm ci
  • Run npm test
    • Test will be executed against a local Hardhat network.

1) Deploy claim issuer contract:

npx hardhat run scripts/deploy-claim-issuer.ts --network localhost

2) Deploy identity contract (deploy identity contract and add a key if you like to verify isClaimValid):

npx hardhat deploy-identity --from 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 --key 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 --network localhost

3) Add claim key in claim issuer contract:

npx hardhat add-key --identity <claim-issuer-contractAddress> --from 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --key 0x90F79bf6EB2c4f870365E785982E1f101E93b906 --type 1 --purpose 3 --network localhost

4) Create signature:

Edit .\scripts\signature-verify.ts here:

const signer = await ethers.getSigner('<address-of-claim-key>');

Edit .\scripts\signature-verify.ts below:

const message = ethers.utils.arrayify(
      ethers.utils.keccak256(
          ethers.utils.defaultAbiCoder.encode(
              ['address', 'uint256', 'bytes'],
              ['<identity-contract-address>', 1876049749 , '0x8f3e8b45fa62fc6abf12d73c4feef3c54f0404bea83c85f1159df7de9f8f1944']
          )
      )
  );
npx hardhat run .\scripts\signature-verify.ts --network localhost

5) Add claim to identity contract:

npx hardhat add-claim --identity <identity-contract-address> --from <address-of-key-added-to-claim-issuer> --claim '{\"topic\": \"1876049749\", \"scheme\": \"1\", \"issuer\": \"<claim-issuer-contract-address>\", \"data\": \"0x8f3e8b45fa62fc6abf12d73c4feef3c54f0404bea83c85f1159df7de9f8f1944\", \"signature\": \"<input signature here>\", \"uri\": \"https://ipfs.moralis.io:2053/ipfs/QmWTqnY1TvKgmaKCjjaQFNejwfoNJRrYkKt7iaj22SxJNL/hashedEmployeedetails.json\"}' --network localhost

Super PoC

bash runSuper.sh

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published