A collection of smart contracts for various types of on-chain registries.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install hubflow
If you are on Linux
git clone https://github.com/datasift/gitflow
cd gitflow
sudo ./install.sh
npm install -g truffle solhint
git clone [email protected]:luciditytech/digivice.git
npm install
git hf init
truffle compile
truffle migrate
Be sure compiled contracts are latest before testing
npm run lint
npm run test
- With code coverage:
npm run coverage
solhint "contracts/**/*.sol"
- deploy both:
VerifierRegistryStorage.sol
VerifierRegistry.sol
- validate code for both contracts, use
truffle-flattener
to help:truffle-flattener ./contracts/VerifierRegistryStorage.sol > all_storage.sol
truffle-flattener ./contracts/VerifierRegistry.sol > all.sol
- connect storage:
- go to storage contract and call
initStorageOwner()
- to verify that you connected storage properly, go to registry contract and call any read method - if its throw, means you failed with initiation of storage.
- go to storage contract and call
- add it to the
ContractRegistry
:- call
ContractRegistry.add()
providing your contract address. - verify process by calling
ContractRegistry.contractByName()
to see if contract is registered.
- call
Example:
const ContractRegistry = artifacts.require('ContractRegistry');
const contractRegistry = await ContractRegistry.at(config.ContractRegistry.address);
await contractRegistry.add(VerifierRegistry.address);
- development: 0xc1dd0e2ad3e65359541673545ce87964eaf708a9
- staging: 0x4e7f37c962bf4fb8aa1c7de57a6b33dd0a6a2e53
- development: 0x0e27485ea11bbc86be07263d32894e1a720067cd
- staging: 0xe9774a4088b04312fec19c245a778cc6d406ef4e