Ethereum smart contracts used during offering discovery and payment processing:
- Privatix token contract (PTC) - holds all PRIX tokens, compliant with ERC20 standard.
- Privatix service contract (PSC) - state channels and offering announcement
Privatix Service Contract (PSC)
PSC contract implements state channels features, service offering discovery, helps to negotiate on service setup, incentivize fair usage and controls supply visibility.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Install prerequisite software:
dapp-smart-contract repository using git:
git clone https://github.com/Privatix/dapp-smart-contract.git cd dapp-smart-contract git checkout master
Install truffle v 5.0.21:
npm install email@example.com -g
Running the tests
npm install -g ganache-cli
Tests are run using the following command:
TARGET=test npm run test
Available targets you can see in targets directory. Setting the environment variable may differ on your system.
rinkeby script to deploy contract to the testnet:
npm run rinkeby
TARGET=dev npm run rinkeby
MNEMONIC="<mnemonic phrase>", where
<mnemonic phrase>is 12 word mnemonic which addresses are created from.
After deploying, abi files are saved to current directory (root of project).
It's necessary to point out which configuration you want to use. Available configurations are:
You can see them in targets directory. Of course, you can add your own configuration.
if you already have
Sale contract deployed you can specify it in the configuration
saleAddress property). In that case deployed contract will be used instead of
deploying new one.
Before deploying make sure you have enough funds on wallet (1 eth will be enough).
You can request ethers for free here:
Example of deploy
mainnet script to deploy contract to the mainnet:
TARGET=mainnet MNEMONIC='your mnemonic' npm run mainnet
get contract info
viewer/main.js script to get contract info:
CONTRACT_ADDRESS="0xa95cC92757b18A5A28d6cf43DF476e13EEb0198A" ABI_PATH='./psc.abi' node viewer/main.js owner: 0xf58E5e4BA1d30ECe58E6aB2c5b65Be9d9239C8f7 popup_period: 500 challenge_period: 5000 remove_period: 100 network_fee: 3000 network_fee_address: 0x4641CD1EB2d538e54e8B29d5dc626889EC5b0A77 channel_deposit_bugbounty_limit: 30000000000
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details.