DMDcoin / diamond-contracts-core

DMD v4 testnet on-chain logic
Other
7 stars 7 forks source link

HBBFT - POSDAO Smart Contracts

Implementation of the HBBFT-POSDAO consensus algorithm in Solidity.

About

POSDAO is a Proof-of-Stake (POS) algorithm implemented as a decentralized autonomous organization (DAO). It is designed to provide a decentralized, fair, and energy efficient consensus for public chains. The algorithm works as a set of smart contracts written in Solidity. POSDAO can be implemented with any general purpose BFT consensus protocol. In the current version Honeybadger BFT (HBBFT) is chosen, which is leaderless and with instant finality. It incentivizes actors to behave in the best interests of a network.

The algorithm provides a Sybil control mechanism for reporting malicious validators and adjusting their stake, distributing a block reward, and managing a set of validators.

POSDAO Repositories and Resources

Smart Contract Summaries

Note: The following descriptions are for HBBFT contracts only. There is also an AuRa implementation that can be found here. All contracts are located in the contracts directory.

Usage

Install Dependencies

$ npm install

Testing

To run unit tests:

$ npm run test 

Flatten

Flattened contracts can be used to verify the contract code in a block explorer like BlockScout or Etherscan. See https://docs.blockscout.com/for-users/smart-contract-interaction/verifying-a-smart-contract for Blockscout verification instructions.

To prepare flattened version of the contracts:

$ npm run flat

Once flattened, the contracts are available in the flat directory.

Contributing

See the CONTRIBUTING document for contribution, testing and pull request protocol.

License

Licensed under either of:

at your option.