This project contains the Fractal DID Registry smart contract as well as a simple environment to deploy it to different chains. It contains 2 smart contracts:
- FractalRegistry.sol - This is the DID Registry contract used to deploy on EVM chains.
- SelfServeRegistryOperator.sol - This is "backoffice" control used in the DID Registry demo. You can find the demo here and the code here.
For more information about Fractal's products, go here.
Fractal's DID Registry enables you to verify the credentials associated with a wallet address in your smart contract (on-chain) or in your dApp. The DID Registry is a smart contract that contains two public methods your dApp and smart contract can call to verify a credential. Registries are deployed on Karura, Avalanche, Gnosis (soon), Aurora (soon) and Polygon. Registries will be deployed on other chains on a demand basis.
In order to verify a credential, you call getFractalId()
to get a fractalId
associated with a wallet address. Every fractalId
in the DID Registry corresponds to a unique human. You call isUserInList()
to determine whether a fractalId exists in one of the Registry's maintained lists. Lists are currently maintained for KYC level and FATF list presence.
- Users connect their wallet.
- Look up their KYC status of their address in the DID Registry.
- Your smart contracts can look up the transaction sender in the DID Registry to inform decisions.
For more information about the DID Registry, go here.
A unique human has a unique Fractal ID, each with 1+ addresses and present in 0+ lists.
address [*]---[1] fractalId [*]---[*] listId
bytes32 fractalId = getFractalId(address walletAddress);
bool presence = isUserInList(bytes32 fractaId, string listId);
Copy .env.example
to .env
and change accordingly.
# Compile contracts
yarn compile
# Deploy FractalRegistry
yarn hardhat --network <network> deploy:registry <root_address> [--delegates <comma-separated address list>]
# Deploy PlaygroundRegistry
yarn hardhat --network <network> deploy:playground-registry <root_address> [--delegates <comma-separated address list>]
# Deploy PolytradeProxy
yarn hardhat --network <network> deploy:polytrade
# Add delegates
yarn hardhat --network <network> add-delegates --registry-address <registry address> <comma-separated address list>
hardhat
(default) - starts a sample hardhat network that does not persist datalocalhost
- connect tolocalhost:8545
(useyarn dev
to spin up a local network)mumbai
- Polygon testnet- ...
# Clean artifacts
yarn clean
# Test
yarn test
# Verify contract (requires etherscan configuration)
yarn hardhat --network <network> etherscan-verify
# TODO: figure out gas reporting