This repo holds all the genesis contracts on Core blockchain, which are part of the core implementations of Satoshi Plus consensus. For more information about Core blockchain and Satoshi Plus consensus, please read the technical whitepaper.
- CandidateHub.sol: This contract manages all validator candidates on Core blockchain. It also exposes the method
turnRoundfor the consensus engine to execute theturn roundworkflow. - PledgeAgent.sol: This contract manages user delegate, also known as stake, including both coin delegate and hash delegate.
- SlashIndicator.sol: This contract manages slash/jail operations to validators on Core blockchain.
- SystemReward.sol: This smart contract manages funds for relayers and verifiers.
- ValidatorSet.sol: This contract manages elected validators in each round. All rewards for validators on Core blockchain are minted in genesis block and stored in this contract.
Install dependency:
npm install
npm install -g ganache
pip3 install solc-select
#If not available, add environment variables:export PATH=$PATH:~/.local/bin/
solc-select install 0.8.4
solc-select use 0.8.4
# install test dependency
pip install -r requirements.txt
#If not available, use:
#python -m venv <environment_name>
source myenv/bin/activate
# generate contracts for testing
./generate-test-contracts.sh
# run brownie tests
brownie test -v --stateful false- Edit
init_holders.jsfile to alloc the initial CORE holders. - Edit
validators.jsfile to alloc the initial validator set. - Edit
init_cycle.jsfile to change core blockchain parameters. - Edit
generate-btclightclient.jsfile to changeinitConsensusStateBytes. - Run
node generate-genesis.jsto generate genesis.json.
The library is licensed under the Apache License, Version 2.0, also included in our repository in the LICENSE file.