Collection of Secret Store permissioning contracts, service contracts and related tooling.
Purpose: To have a central collection of aforementioned contracts, and have a command line tool that makes deployment/checking of these contracts easy.
Disclaimer: The contracts are not audited yet, thus they are not recommended to be relied on in a production environment.
If you wonder how to set up a Secret Store cluster, check out the official config guide and peek into our other repo.
Primary: Adam Nagy (@ngyam)
npm install -g secretstore-contracts
Then:
secretstore-contracts <command> [options]
git clone https://github.com/energywebfoundation/secretstore-contracts.git
cd secretstore-contracts
npm install
Then:
node index.js <command> [options]
Or
npm start <command> [options]
# Deploys a fire and forget permissioning contract and returns its address
secretstore-contracts deploypermission --contract FireAndForget --docid 0xfefefefe --accounts 0x3144de21da6de18061f818836fa3db8f3d6b6989
#>> PermissionerFireAndForget deployed at: 0x05EF6cF073Ca90F9CC936F049934B27F75D7ea89
secretstore-contracts checkpermissions --address 0x05EF6cF073Ca90F9CC936F049934B27F75D7ea89 --docid 0xfefefefe --accounts 0x3144de21da6de18061f818836fa3db8f3d6b6989
#>> 0x3144de21da6de18061f818836fa3db8f3d6b6989: true
To show help and available commands/flags just type
secretstore-contracts --help
# or
secretstore-contracts <command> --help
They can be found in the contracts folder.
-
Permissioning contract interface
-
Simple permissioning contracts
- Static: contract with burned-in addresses and doc-key
- FireAndForget: one shot contract to only permisison one doc key with accounts. Can be set only in the constructor.
- NoDoc: contract that allows access to all the given addresses irrespective of the document key
- Dynamic: registry type contract to add an arbitrary number of doc keys and accounts
-
Nodes-set contract with migration support: Taken from here and described here.
-
Registry: a proper permissining registry contract implementation with ownership/admin support
-
Relay: a permissioning relay contract for upgradeability
-
ERC165Query and interface. Contract that can query which interface other contracts implement according to ERC165.
Please read contributing and our code of conduct for details.
- node, npm, truffle
git clone https://github.com/energywebfoundation/secretstore-contracts.git
cd secretstore-contracts
npm install -D
ACHTUNG: make sure to start an Ethereum node first.
Then simply:
npm run test
If you want to compile the contracts, use Truffle
truffle compile
To deploy simple contracts, use the deployer cl tool. The relay/registry contract is not supported by the tool yet. To deploy those, just simply run
truffle migrate
We use SemVer for versioning. Version number is bumped with bumpversion
tool.
This project is licensed under GPLv3 - see the LICENSE file for details.
- Special thanks to Parity