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.
- BTCLightClient.sol: This contract implements a BTC light client on Core blockchain. Relayers store BTC blocks to Core blockchain by calling this contract. This contract calculates powers of BTC miners in each round, which is used to calculate hybrid score and reward distribution.
- Burn.sol: This contract burns CORE tokens up to pre defined CAP.
- CandidateHub.sol: This contract manages all validator candidates on Core blockchain. It also exposes the method
turnRound
for the consensus engine to execute theturn round
workflow. - Foundation.sol: This is the DAO Treasury smart contract. The funds in this contract can only be moved through governance vote.
- GovHub.sol: This is the smart contract to manage governance votes.
- PledgeAgent.sol: This contract manages user delegate, also known as stake, including both coin delegate and hash delegate.
- RelayerHub.sol: This contract manages BTC relayers on Core blockchain.
- 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
# install test dependency
pip install -r requirements.txt
# generate contracts for testing
./generate-test-contracts.sh
# run brownie tests
brownie test -v --stateful false
Flatten all system contracts:
npm run flatten
- Edit
init_holders.js
file to alloc the initial CORE holders. - Edit
validators.js
file to alloc the initial validator set. - Edit
init_cycle.js
file to change core blockchain parameters. - Edit
generate-btclightclient.js
file to changeinitConsensusStateBytes
. - Run
node generate-genesis.js
to generate genesis.json.
The library is licensed under the Apache License, Version 2.0, also included in our repository in the LICENSE file.