Smart contracts used by the Nation3 Citizen Directory and Nation3 Basic Income (N3BI).
npm install
npx hardhat clean
npx hardhat compile
Run unit tests:
npx hardhat test
Run code coverage:
npx hardhat coverage
Check if coverage threshold has been met:
npx istanbul check-coverage --lines 90
Run Solhint:
npx solhint 'contracts/*.sol' --fix
Run Prettier:
npx prettier '**/*.{json,sol,md}' --check
npx prettier '**/*.{json,sol,md}' --write
Start a local Ethereum network node:
npx hardhat node
This will start Hardhat Network, and expose it as a JSON-RPC and Websocket server at http://127.0.0.1:8545/.
npx hardhat run scripts/deploy-<contract>.ts
Add an .env
file, and set the variables:
cp .env.example .env
npx hardhat run --network sepolia scripts/deploy-<contract>.ts
npx hardhat verify --network sepolia <address>
Add an .env
file, and set the variables:
cp .env.example .env
npx hardhat run --network mainnet scripts/deploy-<contract>.ts
npx hardhat verify --network mainnet <address> <parameters>
-
citizens/
-
DeveloperSkillLevels.sol
-
OperatorSkillLevels.sol
-
MarketeerSkillLevels.sol
-
DiscordUsernames
-
DiscourseUsernames
-
GitHubUsernames
-
-
rewards/
DevGuildRewardsDistributor.sol
OpsGuildRewardsDistributor.sol
-
utils/
PassportUtils.sol
-
NationCred.sol
-
citizens/
-
DeveloperSkillLevels.sol
-
OperatorSkillLevels.sol
-
Discord.sol
-
Discourse.sol
-
GitHubUsernames.sol
-
-
rewards/
DevGuildRewardsDistributor.sol
OpsGuildRewardsDistributor.sol
-
utils/
PassportUtils.sol
-
NationCred.sol
https://www.npmjs.com/package/@nation3/nationcred-contracts
cd contracts
npm adduser
npm publish --access public
After publishing, bump the version in package.json
and the VERSION
constant in each smart contract.