diff --git a/contracts/GitHub.sol b/contracts/GitHubUsernames.sol similarity index 96% rename from contracts/GitHub.sol rename to contracts/GitHubUsernames.sol index fbc581c..ac724ad 100644 --- a/contracts/GitHub.sol +++ b/contracts/GitHubUsernames.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.17; import {IPassportUtils} from "./utils/IPassportUtils.sol"; -contract GitHub { +contract GitHubUsernames { mapping(address => string) public usernames; IPassportUtils public immutable passportUtils; diff --git a/scripts/deploy-github.ts b/scripts/deploy-github-usernames.ts similarity index 78% rename from scripts/deploy-github.ts rename to scripts/deploy-github-usernames.ts index 748462a..9e2d545 100644 --- a/scripts/deploy-github.ts +++ b/scripts/deploy-github-usernames.ts @@ -14,13 +14,13 @@ async function main() { // await hre.run('compile'); // We get the contract to deploy - const GitHub = await ethers.getContractFactory("GitHub"); + const GitHubUsernames = await ethers.getContractFactory("GitHubUsernames"); const veTokenAddress = "0xF7deF1D2FBDA6B74beE7452fdf7894Da9201065d"; - const github = await GitHub.deploy(veTokenAddress); + const githubUsernames = await GitHubUsernames.deploy(veTokenAddress); - await github.deployed(); + await githubUsernames.deployed(); - console.log("GitHub deployed to:", github.address); + console.log("GitHubUsernames deployed to:", githubUsernames.address); } // We recommend this pattern to be able to use async/await everywhere diff --git a/test/GitHub.ts b/test/GitHubUsernames.ts similarity index 50% rename from test/GitHub.ts rename to test/GitHubUsernames.ts index 8d26c5e..ce49cc0 100644 --- a/test/GitHub.ts +++ b/test/GitHubUsernames.ts @@ -1,34 +1,34 @@ import { expect } from "chai"; import { ethers } from "hardhat"; -describe("GitHub", function () { +describe("GitHubUsernames", function () { it("Deploy contract", async function () { - const GitHub = await ethers.getContractFactory("GitHub"); + const GitHubUsernames = await ethers.getContractFactory("GitHubUsernames"); const passportUtilsAddress = ethers.constants.AddressZero; - const gitHub = await GitHub.deploy(passportUtilsAddress); - await gitHub.deployed(); + const githubUsernames = await GitHubUsernames.deploy(passportUtilsAddress); + await githubUsernames.deployed(); const [owner] = await ethers.getSigners(); console.log("owner.address:", owner.address); - const username = await gitHub.usernames(owner.address); + const username = await githubUsernames.usernames(owner.address); console.log("username:", username); expect(username).to.equal(""); }); it("updateUsername", async function () { - const GitHub = await ethers.getContractFactory("GitHub"); + const GitHubUsernames = await ethers.getContractFactory("GitHubUsernames"); const passportUtilsAddress = ethers.constants.AddressZero; - const gitHub = await GitHub.deploy(passportUtilsAddress); - await gitHub.deployed(); + const githubUsernames = await GitHubUsernames.deploy(passportUtilsAddress); + await githubUsernames.deployed(); const [owner] = await ethers.getSigners(); console.log("owner.address:", owner.address); - // await gitHub.updateUsername("test"); - await expect(gitHub.updateUsername("test")).to.be.reverted; + // await githubUsernames.updateUsername("test"); + await expect(githubUsernames.updateUsername("test")).to.be.reverted; - const usernameAfterUpdate = await gitHub.usernames(owner.address); + const usernameAfterUpdate = await githubUsernames.usernames(owner.address); console.log("usernameAfterUpdate:", usernameAfterUpdate); // expect(usernameAfterUpdate).to.equal("test"); expect(usernameAfterUpdate).to.equal("");