Skip to content

This repo contains files setup, contracts, storage, scripts, and documentation about mainnet delegate proof of stake.

License

Notifications You must be signed in to change notification settings

avenlabs/dpos-genesis

Repository files navigation

Genesis Contract Delegate Proof Of Stake

This repo hold all the genesis contracts Based BNB Smart chain. More details in doc-site.

Prepare

Install node.js dependency:

npm install
curl -sSL https://install.python-poetry.org | python3 -
poetry install
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
nvm install  12.18.3 && nvm use 12.18.3

Build With JS

forge install --no-git --no-commit foundry-rs/[email protected]
export RPC_BSC=RPC_LINK
forge test

How to generate genesis file

1. Edit `init_holders.js` file to alloc the initial BNB holder.
2. Edit `validators.js` file to alloc the initial validator set.
3. Edit system contracts setting as needed.
4. Run `node scripts/generate-genesis.js -c 69696969 -t genesis-template.json -o genesis-mainnnet.json` will generate genesis-mainnnet.json

How to update contract interface for test

// get metadata
forge build

// generate interface
cast interface ${workspace}/out/{contract_name}.sol/${contract_name}.json -p ^0.8.0 -n ${contract_name} > ${workspace}/test/utils/interface/I${contract_name}.sol

BEP-171 unlock bot

npm install ts-node -g

cp .env.example .env
# set UNLOCK_RECEIVER, OPERATOR_PRIVATE_KEY to .env

ts-node scripts/bep171-unlock-bot.ts 

License

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

About

This repo contains files setup, contracts, storage, scripts, and documentation about mainnet delegate proof of stake.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published