npm install
// for deployment
export PRIVATE_KEY=<private key>
npx hardhat test
with coverage report
npx hardhat coverage
with gas report
REPORT_GAS=1 npx hardhat test
Check
npm run lint
Fix
npm run format
See docs for more information.
Generate docs
npx hardhat markup
The initial deployment of the contracts is done using the create-*
scripts. The upgrade-*
scripts are used to upgrade the contracts.
For convenience, the create-all
script will deploy and verify all contracts.
# add BLOCK_STORAGE_ADDRESS and SFC_LIB_ADDRESS to .env
echo "BLOCK_STORAGE_ADDRESS=0xf7E0CF7453ac619fD64b3D46D7De3638510F15eA" >> .env
echo "SFC_LIB_ADDRESS=0xFC00FACE00000000000000000000000000000000" >> .env
source .env
npx hardhat run scripts/create-all.ts --network x1-testnet
# add the env variables to .env
source .env
npx hardhat verify $VOTE_MANAGER_ADDRESS --network x1-testnet
npx hardhat verify $XENIUM_ADDRESS --network x1-testnet
npx hardhat verify $XUNI_ADDRESS --network x1-testnet
npx hardhat verify $SUPER_BLOCK_ADDRESS --network x1-testnet
npx hardhat verify $TOKEN_REGISTRY_ADDRESS --network x1-testnet
Upgrade vote manager
npx hardhat run scripts/upgrade-vote-manager.ts --network x1-testnet
Upgrade xenium
npx hardhat run scripts/upgrade-xenium.ts --network x1-testnet
Upgrade xuni
npx hardhat run scripts/upgrade-xuni.ts --network x1-testnet
Upgrade Superblock
npx hardhat run scripts/upgrade-super-block.ts --network x1-testnet
Upgrade token registry
npx hardhat run scripts/upgrade-token-registry.ts --network x1-testnet