Skip to content

Commit

Permalink
🍝 refactor: deployment config (#118)
Browse files Browse the repository at this point in the history
close #118
  • Loading branch information
aahna-ashina committed Apr 29, 2024
1 parent a6e471f commit b840ebd
Show file tree
Hide file tree
Showing 13 changed files with 164 additions and 45 deletions.
40 changes: 22 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,45 +112,49 @@ npx hardhat verify --network mainnet <address> <parameters>

https://github.com/nation3/foundations/blob/main/deployments/sepolia.json

[`deployments/sepolia.json`](./deployments/sepolia.json)

- `citizens/`

- `DeveloperSkillLevels.sol`: [`0x9e18b955D2a0d7eFcf7cd1aEbE4aB949F6af2A91`](https://sepolia.etherscan.io/address/0x9e18b955D2a0d7eFcf7cd1aEbE4aB949F6af2A91)
- `OperatorSkillLevels.sol`: [`0x2Ea4ECa64479f9E5dCBEF08E1ea9f5E6ddb40072`](https://sepolia.etherscan.io/address/0x2Ea4ECa64479f9E5dCBEF08E1ea9f5E6ddb40072)
- `MarketeerSkillLevels.sol`: [`0x927BD07dC44DAF4cb01DA901008c6088fD8Eaa0b`](https://sepolia.etherscan.io/address/0x927BD07dC44DAF4cb01DA901008c6088fD8Eaa0b)
- `DeveloperSkillLevels.sol`
- `OperatorSkillLevels.sol`
- `MarketeerSkillLevels.sol`

- `DiscordUsernames`: [`0xD105f567dA9d3F0c25F4c036c19Cf5E521987bD5`](https://sepolia.etherscan.io/address/0xD105f567dA9d3F0c25F4c036c19Cf5E521987bD5)
- `DiscourseUsernames`: [`0xFF260Bc90f94087FCbd4939BD46d743F02B20B82`](https://sepolia.etherscan.io/address/0xFF260Bc90f94087FCbd4939BD46d743F02B20B82)
- `GitHubUsernames`: [`0x6C31d70a6b20Ccd3DB454aFE1Bc4FB780C380F47`](https://sepolia.etherscan.io/address/0x6C31d70a6b20Ccd3DB454aFE1Bc4FB780C380F47)
- `DiscordUsernames`
- `DiscourseUsernames`
- `GitHubUsernames`

- `rewards/`

- `DevGuildRewardsDistributor.sol`: [`0xEa075d0B268e0BF5DDEF0E72640E4E7101868C14`](https://sepolia.etherscan.io/address/0xEa075d0B268e0BF5DDEF0E72640E4E7101868C14)
- `OpsGuildRewardsDistributor.sol`: [`0x01155f6475186a14C227E5Ad727F9838094cFb61`](https://sepolia.etherscan.io/address/0x01155f6475186a14C227E5Ad727F9838094cFb61)
- `DevGuildRewardsDistributor.sol`
- `OpsGuildRewardsDistributor.sol`

- `utils/`

- `PassportUtils.sol`: [`0x88Ea3A3618A988783E39C2CadFdd77Dc07895b59`](https://sepolia.etherscan.io/address/0x88Ea3A3618A988783E39C2CadFdd77Dc07895b59)
- `PassportUtils.sol`

- `NationCred.sol`: [`0x3C38FBe04C455eFaF762d00c400e1A6589f7269A`](https://sepolia.etherscan.io/address/0x3C38FBe04C455eFaF762d00c400e1A6589f7269A)
- `NationCred.sol`

### Mainnet (`v0.7.0`)

https://github.com/nation3/foundations/blob/main/deployments/mainnet.json

- `citizens/`
[`deployments/sepolia.json`](./deployments/sepolia.json)

- `DeveloperSkillLevels.sol`: [`0x4E8231B8374DBd70E8BDD7c7779BEa457318a21c`](https://etherscan.io/address/0x4E8231B8374DBd70E8BDD7c7779BEa457318a21c)
- `OperatorSkillLevels.sol`: [`0x8100e77899C24b0F7B516153F84868f850C034BF`](https://etherscan.io/address/0x8100e77899C24b0F7B516153F84868f850C034BF)
- `citizens/`

- `Discord.sol`: [`0x3415f4ffb9f89fba0ab446da4a78223e4cd73bad`](https://etherscan.io/address/0x3415f4ffb9f89fba0ab446da4a78223e4cd73bad)
- `Discourse.sol`: [`0xC396F3536Cc67913bbE1e5E454c10BBA4ae8928F`](https://etherscan.io/address/0xC396F3536Cc67913bbE1e5E454c10BBA4ae8928F)
- `GitHubUsernames.sol`: [`0xB989C0C17a3Bce679D7586d9e55B6Eab11c18687`](https://etherscan.io/address/0xB989C0C17a3Bce679D7586d9e55B6Eab11c18687)
- `DeveloperSkillLevels.sol`
- `OperatorSkillLevels.sol`

- `NationCred.sol`: [`0x7794F0Eb1eA812fBcdaBD559551Fb26A79720925`](https://etherscan.io/address/0x7794F0Eb1eA812fBcdaBD559551Fb26A79720925)
- `Discord.sol`
- `Discourse.sol`
- `GitHubUsernames.sol`

- `utils/`

- `PassportUtils.sol`: [`0x23Ca3002706b71a440860E3cf8ff64679A00C9d7`](https://etherscan.io/address/0x23Ca3002706b71a440860E3cf8ff64679A00C9d7)
- `PassportUtils.sol`

- `NationCred.sol`

### npm (`v0.7.0`)

Expand Down
9 changes: 9 additions & 0 deletions deployments/mainnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"citizens/DeveloperSkillLevels.sol": "0x4E8231B8374DBd70E8BDD7c7779BEa457318a21c",
"citizens/OperatorSkillLevels.sol": "0x8100e77899C24b0F7B516153F84868f850C034BF",
"citizens/Discord.sol": "0x3415f4ffb9f89fba0ab446da4a78223e4cd73bad",
"citizens/Discourse.sol": "0xC396F3536Cc67913bbE1e5E454c10BBA4ae8928F",
"citizens/GitHubUsernames.sol": "0xB989C0C17a3Bce679D7586d9e55B6Eab11c18687",
"utils/PassportUtils.sol": "0x23Ca3002706b71a440860E3cf8ff64679A00C9d7",
"NationCred.sol": "0x7794F0Eb1eA812fBcdaBD559551Fb26A79720925"
}
12 changes: 12 additions & 0 deletions deployments/sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"citizens/DeveloperSkillLevels.sol": "0x9e18b955D2a0d7eFcf7cd1aEbE4aB949F6af2A91",
"citizens/OperatorSkillLevels.sol": "0x2Ea4ECa64479f9E5dCBEF08E1ea9f5E6ddb40072",
"citizens/MarketeerSkillLevels.sol": "0x927BD07dC44DAF4cb01DA901008c6088fD8Eaa0b",
"citizens/DiscordUsernames.sol": "0xD105f567dA9d3F0c25F4c036c19Cf5E521987bD5",
"citizens/DiscourseUsernames.sol": "0xFF260Bc90f94087FCbd4939BD46d743F02B20B82",
"citizens/GitHubUsernames.sol": "0x6C31d70a6b20Ccd3DB454aFE1Bc4FB780C380F47",
"rewards/DevGuildRewardsDistributor.sol": "0xEa075d0B268e0BF5DDEF0E72640E4E7101868C14",
"rewards/OpsGuildRewardsDistributor.sol": "0x01155f6475186a14C227E5Ad727F9838094cFb61",
"utils/PassportUtils.sol": "0x88Ea3A3618A988783E39C2CadFdd77Dc07895b59",
"NationCred.sol": "0x3C38FBe04C455eFaF762d00c400e1A6589f7269A"
}
13 changes: 11 additions & 2 deletions scripts/citizens/deploy-developer-skill-levels.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import { verifyContract, deployContract } from "../helpers"
import hre from "hardhat"

async function main() {
const contractName = "DeveloperSkillLevels";
const contractPath = "contracts/citizens/DeveloperSkillLevels.sol:DeveloperSkillLevels"

// Load deployment configurations
const networkName = hre.network.name;
console.log('networkName:', networkName);
const deploymentsFilename = (networkName == "mainnet") ? "mainnet.json" : "sepolia.json";
console.log('deploymentsFilename:', deploymentsFilename);

const deploymentsNationCred = require(`../../deployments/${deploymentsFilename}`);
console.log("deploymentsNationCred:", deploymentsNationCred);

// Constructor Args
// const passportUtilsAddress = "0x88Ea3A3618A988783E39C2CadFdd77Dc07895b59"; // Sepolia
const passportUtilsAddress = "0x23Ca3002706b71a440860E3cf8ff64679A00C9d7"; // Mainnet
const passportUtilsAddress = deploymentsNationCred["utils/PassportUtils.sol"];

const args = [passportUtilsAddress];
const contractAddress = await deployContract(contractName, args);
Expand Down
13 changes: 11 additions & 2 deletions scripts/citizens/deploy-discord-usernames.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import { verifyContract, deployContract } from "../helpers"
import hre from "hardhat"

async function main() {
const contractName = "DiscordUsernames";
const contractPath = "contracts/citizens/DiscordUsernames.sol:DiscordUsernames"

// Load deployment configurations
const networkName = hre.network.name;
console.log('networkName:', networkName);
const deploymentsFilename = (networkName == "mainnet") ? "mainnet.json" : "sepolia.json";
console.log('deploymentsFilename:', deploymentsFilename);

const deploymentsNationCred = require(`../../deployments/${deploymentsFilename}`);
console.log("deploymentsNationCred:", deploymentsNationCred);

// Constructor Args
// const passportUtilsAddress = "0x88Ea3A3618A988783E39C2CadFdd77Dc07895b59"; // Sepolia
const passportUtilsAddress = "0x23Ca3002706b71a440860E3cf8ff64679A00C9d7"; // Mainnet
const passportUtilsAddress = deploymentsNationCred["utils/PassportUtils.sol"];

const args = [passportUtilsAddress];
const contractAddress = await deployContract(contractName, args);
Expand Down
14 changes: 11 additions & 3 deletions scripts/citizens/deploy-discourse-usernames.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import { verifyContract, deployContract } from "../helpers"

import hre from "hardhat"

async function main() {
const contractName = "DiscourseUsernames";
const contractPath = "contracts/citizens/DiscourseUsernames.sol:DiscourseUsernames"

// Load deployment configurations
const networkName = hre.network.name;
console.log('networkName:', networkName);
const deploymentsFilename = (networkName == "mainnet") ? "mainnet.json" : "sepolia.json";
console.log('deploymentsFilename:', deploymentsFilename);

const deploymentsNationCred = require(`../../deployments/${deploymentsFilename}`);
console.log("deploymentsNationCred:", deploymentsNationCred);

// Constructor Args
// const passportUtilsAddress = "0x88Ea3A3618A988783E39C2CadFdd77Dc07895b59"; // Sepolia
const passportUtilsAddress = "0x23Ca3002706b71a440860E3cf8ff64679A00C9d7"; // Mainnet
const passportUtilsAddress = deploymentsNationCred["utils/PassportUtils.sol"];

const args = [passportUtilsAddress];
const contractAddress = await deployContract(contractName, args);
Expand Down
13 changes: 11 additions & 2 deletions scripts/citizens/deploy-github-usernames.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import { verifyContract, deployContract } from "../helpers"
import hre from "hardhat"

async function main() {
const contractName = "GitHubUsernames";
const contractPath = "contracts/citizens/GitHubUsernames.sol:GitHubUsernames"

// Load deployment configurations
const networkName = hre.network.name;
console.log('networkName:', networkName);
const deploymentsFilename = (networkName == "mainnet") ? "mainnet.json" : "sepolia.json";
console.log('deploymentsFilename:', deploymentsFilename);

const deploymentsNationCred = require(`../../deployments/${deploymentsFilename}`);
console.log("deploymentsNationCred:", deploymentsNationCred);

// Constructor Args
// const passportUtilsAddress = "0x88Ea3A3618A988783E39C2CadFdd77Dc07895b59"; // Sepolia
const passportUtilsAddress = "0x23Ca3002706b71a440860E3cf8ff64679A00C9d7"; // Mainnet
const passportUtilsAddress = deploymentsNationCred["utils/PassportUtils.sol"];

const args = [passportUtilsAddress];
const contractAddress = await deployContract(contractName, args);
Expand Down
13 changes: 11 additions & 2 deletions scripts/citizens/deploy-marketeer-skill-levels.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import { verifyContract, deployContract } from "../helpers"
import hre from "hardhat"

async function main() {
const contractName = "MarketeerSkillLevels";
const contractPath = "contracts/citizens/MarketeerSkillLevels.sol:MarketeerSkillLevels"

// Load deployment configurations
const networkName = hre.network.name;
console.log('networkName:', networkName);
const deploymentsFilename = (networkName == "mainnet") ? "mainnet.json" : "sepolia.json";
console.log('deploymentsFilename:', deploymentsFilename);

const deploymentsNationCred = require(`../../deployments/${deploymentsFilename}`);
console.log("deploymentsNationCred:", deploymentsNationCred);

// Constructor Args
// const passportUtilsAddress = "0x88Ea3A3618A988783E39C2CadFdd77Dc07895b59"; // Sepolia
const passportUtilsAddress = "0x23Ca3002706b71a440860E3cf8ff64679A00C9d7"; // Mainnet
const passportUtilsAddress = deploymentsNationCred["utils/PassportUtils.sol"];

const args = [passportUtilsAddress];

Expand Down
13 changes: 11 additions & 2 deletions scripts/citizens/deploy-operator-skill-levels.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import { verifyContract, deployContract } from "../helpers"
import hre from "hardhat"

async function main() {
const contractName = "OperatorSkillLevels";
const contractPath = "contracts/citizens/OperatorSkillLevels.sol:OperatorSkillLevels"

// Load deployment configurations
const networkName = hre.network.name;
console.log('networkName:', networkName);
const deploymentsFilename = (networkName == "mainnet") ? "mainnet.json" : "sepolia.json";
console.log('deploymentsFilename:', deploymentsFilename);

const deploymentsNationCred = require(`../../deployments/${deploymentsFilename}`);
console.log("deploymentsNationCred:", deploymentsNationCred);

// Constructor Args
// const passportUtilsAddress = "0x88Ea3A3618A988783E39C2CadFdd77Dc07895b59"; // Sepolia
const passportUtilsAddress = "0x23Ca3002706b71a440860E3cf8ff64679A00C9d7"; // Mainnet
const passportUtilsAddress = deploymentsNationCred["utils/PassportUtils.sol"];

const args = [passportUtilsAddress];

Expand Down
13 changes: 11 additions & 2 deletions scripts/deploy-nationcred.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import { verifyContract, deployContract } from "./helpers"
import hre from "hardhat"

async function main() {
const contractName = "NationCred";
const contractPath = "contracts/NationCred.sol:NationCred"

// Load deployment configurations
const networkName = hre.network.name;
console.log('networkName:', networkName);
const deploymentsFilename = (networkName == "mainnet") ? "mainnet.json" : "sepolia.json";

const deploymentsFoundationsResponse = await fetch(`https://raw.githubusercontent.com/nation3/foundations/main/deployments/${deploymentsFilename}`);
const deploymentsFoundations = JSON.parse(await deploymentsFoundationsResponse.text());
console.log("deploymentsFoundations:", deploymentsFoundations);

// Constructor Args
const passportAddress = "0x11f30642277A70Dab74C6fAF4170a8b340BE2f98"; // Sepolia
// const passportAddress = "0x3337dac9F251d4E403D6030E18e3cfB6a2cb1333"; // Mainnet
const passportAddress = deploymentsFoundations["nationPassportNFT"];

const args = [passportAddress];
const contractAddress = await deployContract(contractName, args);
Expand Down
20 changes: 16 additions & 4 deletions scripts/rewards/deploy-dev-guild-rewards-distributor.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
import { verifyContract, deployContract } from "../helpers"
import hre from "hardhat"

async function main() {
const contractName = "DevGuildRewardsDistributor";
const contractPath = "contracts/rewards/DevGuildRewardsDistributor.sol:DevGuildRewardsDistributor"

// Load deployment configurations
const networkName = hre.network.name;
console.log('networkName:', networkName);
const deploymentsFilename = (networkName == "mainnet") ? "mainnet.json" : "sepolia.json";
console.log('deploymentsFilename:', deploymentsFilename);

const deploymentsNationCred = require(`../../deployments/${deploymentsFilename}`);
console.log("deploymentsNationCred:", deploymentsNationCred);

const deploymentsFoundationsResponse = await fetch(`https://raw.githubusercontent.com/nation3/foundations/main/deployments/${deploymentsFilename}`);
const deploymentsFoundations = JSON.parse(await deploymentsFoundationsResponse.text());
console.log("deploymentsFoundations:", deploymentsFoundations);

// Constructor Args
// const passportUtilsAddress = "0x88Ea3A3618A988783E39C2CadFdd77Dc07895b59"; // Sepolia
// const rewardTokenAddress = "0x23Ca3002706b71a440860E3cf8ff64679A00C9d7"; // Sepolia
const passportUtilsAddress = "0x23Ca3002706b71a440860E3cf8ff64679A00C9d7"; // Mainnet
const rewardTokenAddress = "0x333A4823466879eeF910A04D473505da62142069"; // Mainnet
const passportUtilsAddress = deploymentsNationCred["utils/PassportUtils.sol"];
const rewardTokenAddress = deploymentsFoundations["nationToken"];
const CLIFF_VESTING_DATE = 1735689600; // 2025-01-01

const args = [passportUtilsAddress, rewardTokenAddress, CLIFF_VESTING_DATE];
Expand Down
20 changes: 16 additions & 4 deletions scripts/rewards/deploy-ops-guild-rewards-distributor.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
import { verifyContract, deployContract } from "../helpers"
import hre from "hardhat"

async function main() {
const contractName = "OpsGuildRewardsDistributor";
const contractPath = "contracts/rewards/OpsGuildRewardsDistributor.sol:OpsGuildRewardsDistributor"

// Load deployment configurations
const networkName = hre.network.name;
console.log('networkName:', networkName);
const deploymentsFilename = (networkName == "mainnet") ? "mainnet.json" : "sepolia.json";
console.log('deploymentsFilename:', deploymentsFilename);

const deploymentsNationCred = require(`../../deployments/${deploymentsFilename}`);
console.log("deploymentsNationCred:", deploymentsNationCred);

const deploymentsFoundationsResponse = await fetch(`https://raw.githubusercontent.com/nation3/foundations/main/deployments/${deploymentsFilename}`);
const deploymentsFoundations = JSON.parse(await deploymentsFoundationsResponse.text());
console.log("deploymentsFoundations:", deploymentsFoundations);

// Constructor Args
// const passportUtilsAddress = "0x88Ea3A3618A988783E39C2CadFdd77Dc07895b59"; // Sepolia
// const rewardTokenAddress = "0x23Ca3002706b71a440860E3cf8ff64679A00C9d7"; // Sepolia
const passportUtilsAddress = "0x23Ca3002706b71a440860E3cf8ff64679A00C9d7"; // Mainnet
const rewardTokenAddress = "0x333A4823466879eeF910A04D473505da62142069"; // Mainnet
const passportUtilsAddress = deploymentsNationCred["utils/PassportUtils.sol"];
const rewardTokenAddress = deploymentsFoundations["nationToken"];
const CLIFF_VESTING_DATE = 1735689600; // 2025-01-01

const args = [passportUtilsAddress, rewardTokenAddress, CLIFF_VESTING_DATE];
Expand Down
16 changes: 12 additions & 4 deletions scripts/utils/deploy-passport-utils.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import { verifyContract, deployContract } from "../helpers"
import hre from "hardhat"

async function main() {
const contractName = "PassportUtils";
const contractPath = "contracts/utils/PassportUtils.sol:PassportUtils"

// Load deployment configurations
const networkName = hre.network.name;
console.log('networkName:', networkName);
const deploymentsFilename = (networkName == "mainnet") ? "mainnet.json" : "sepolia.json";

const deploymentsFoundationsResponse = await fetch(`https://raw.githubusercontent.com/nation3/foundations/main/deployments/${deploymentsFilename}`);
const deploymentsFoundations = JSON.parse(await deploymentsFoundationsResponse.text());
console.log("deploymentsFoundations:", deploymentsFoundations);

// Constructor Args
// const passportIssuerAddress = "0xdad32e13E73ce4155a181cA0D350Fee0f2596940"; // Sepolia
// const votingEscrowAddress = "0x8100e77899C24b0F7B516153F84868f850C034BF"; // Sepolia
const passportIssuerAddress = "0x279c0b6bfCBBA977eaF4ad1B2FFe3C208aa068aC"; // Mainnet
const votingEscrowAddress = "0xF7deF1D2FBDA6B74beE7452fdf7894Da9201065d"; // Mainnet
const passportIssuerAddress = deploymentsFoundations["nationPassportNFTIssuer"];
const votingEscrowAddress = deploymentsFoundations["veNationToken"];

const args = [passportIssuerAddress, votingEscrowAddress];
const contractAddress = await deployContract(contractName, args);
Expand Down

0 comments on commit b840ebd

Please sign in to comment.