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>
https://github.com/nation3/foundations/blob/main/deployments/sepolia.json
-
citizens/
-
DeveloperSkillLevels.sol
:0x9e18b955D2a0d7eFcf7cd1aEbE4aB949F6af2A91
-
OperatorSkillLevels.sol
:0x2Ea4ECa64479f9E5dCBEF08E1ea9f5E6ddb40072
-
MarketeerSkillLevels.sol
:0x927BD07dC44DAF4cb01DA901008c6088fD8Eaa0b
-
DiscordUsernames
:0xD105f567dA9d3F0c25F4c036c19Cf5E521987bD5
-
DiscourseUsernames
:0xFF260Bc90f94087FCbd4939BD46d743F02B20B82
-
GitHubUsernames
:0x6C31d70a6b20Ccd3DB454aFE1Bc4FB780C380F47
-
-
rewards/
DevGuildRewardsDistributor.sol
:0xEa075d0B268e0BF5DDEF0E72640E4E7101868C14
OpsGuildRewardsDistributor.sol
:0x01155f6475186a14C227E5Ad727F9838094cFb61
-
utils/
PassportUtils.sol
:0x88Ea3A3618A988783E39C2CadFdd77Dc07895b59
-
NationCred.sol
:0x3C38FBe04C455eFaF762d00c400e1A6589f7269A
https://github.com/nation3/foundations/blob/main/deployments/mainnet.json
-
citizens/
-
DeveloperSkillLevels.sol
:0x4E8231B8374DBd70E8BDD7c7779BEa457318a21c
-
OperatorSkillLevels.sol
:0x8100e77899C24b0F7B516153F84868f850C034BF
-
Discord.sol
:0x3415f4ffb9f89fba0ab446da4a78223e4cd73bad
-
Discourse.sol
:0xC396F3536Cc67913bbE1e5E454c10BBA4ae8928F
-
GitHubUsernames.sol
:0xB989C0C17a3Bce679D7586d9e55B6Eab11c18687
-
-
NationCred.sol
:0x7794F0Eb1eA812fBcdaBD559551Fb26A79720925
-
utils/
PassportUtils.sol
:0x23Ca3002706b71a440860E3cf8ff64679A00C9d7
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.