Skip to content

atoshi-group/atos-genesis-contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Core Genesis Contracts

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.

List of Contracts

  • CandidateHub.sol: This contract manages all validator candidates on Core blockchain. It also exposes the method turnRound for the consensus engine to execute the turn round workflow.
  • 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.

Prepare

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

Run Tests

# 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

Generate genesis.json

  1. Edit init_holders.js file to alloc the initial CORE holders.
  2. Edit validators.js file to alloc the initial validator set.
  3. Edit init_cycle.js file to change core blockchain parameters.
  4. Edit generate-btclightclient.js file to change initConsensusStateBytes.
  5. Run node generate-genesis.js to generate genesis.json.

License

The library is licensed under the Apache License, Version 2.0, also included in our repository in the LICENSE file.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors