change name

main
cyhhao 2 years ago
parent 494c06a8fa
commit 555887511a

@ -6,7 +6,7 @@ import "./IFileOperator.sol";
import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/access/Ownable.sol";
import "git3-evm-large-storage/contracts/v2/LargeStorageManagerV2.sol"; import "git3-evm-large-storage/contracts/v2/LargeStorageManagerV2.sol";
contract Git3 is LargeStorageManagerV2 { contract Git3Hub is LargeStorageManagerV2 {
struct refInfo { struct refInfo {
bytes20 hash; bytes20 hash;
uint96 index; uint96 index;
@ -59,10 +59,10 @@ contract Git3 is LargeStorageManagerV2 {
repoNameToOwner[repoName] = msg.sender; repoNameToOwner[repoName] = msg.sender;
} }
function transferOwnership(bytes memory repoName, address newOwner) function transferOwnership(
external bytes memory repoName,
onlyOwner(repoName) address newOwner
{ ) external onlyOwner(repoName) {
require(newOwner != address(0), "newOwner must not be zero address"); require(newOwner != address(0), "newOwner must not be zero address");
repoNameToOwner[repoName] = newOwner; repoNameToOwner[repoName] = newOwner;
} }

@ -7,7 +7,7 @@ async function main() {
console.log(accounts[0].address); console.log(accounts[0].address);
const Git3 = await hre.ethers.getContractAt( const Git3 = await hre.ethers.getContractAt(
"Git3", "Git3Hub",
"0x0068bD3ec8D16402690C1Eddff06ACb913A209ef" "0x0068bD3ec8D16402690C1Eddff06ACb913A209ef"
); );
let rept let rept

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 185 KiB

@ -7,7 +7,7 @@ async function main() {
console.log(accounts[0].address); console.log(accounts[0].address);
const Git3 = await hre.ethers.getContractAt( const Git3 = await hre.ethers.getContractAt(
"Git3", "Git3Hub",
"0xa709975Bc01e745432f8898499E7b9a60f420117" "0xa709975Bc01e745432f8898499E7b9a60f420117"
); );

@ -9,7 +9,7 @@ let ETH = ethers.BigNumber.from(10).pow(18);
describe("Git3 Test", function () { describe("Git3 Test", function () {
it("upload/download/remove", async function () { it("upload/download/remove", async function () {
const Git3 = await ethers.getContractFactory("Git3"); const Git3 = await ethers.getContractFactory("Git3Hub");
const git3 = await Git3.deploy(); const git3 = await Git3.deploy();
await git3.deployed(); await git3.deployed();
@ -42,7 +42,7 @@ describe("Git3 Test", function () {
}); });
it("upload/download/remove chunks", async function () { it("upload/download/remove chunks", async function () {
const Git3 = await ethers.getContractFactory("Git3"); const Git3 = await ethers.getContractFactory("Git3Hub");
const git3 = await Git3.deploy(); const git3 = await Git3.deploy();
await git3.deployed(); await git3.deployed();
@ -76,7 +76,7 @@ describe("Git3 Test", function () {
}); });
it("set/update/list/remove Reference", async function () { it("set/update/list/remove Reference", async function () {
const Git3 = await ethers.getContractFactory("Git3"); const Git3 = await ethers.getContractFactory("Git3Hub");
const git3 = await Git3.deploy(); const git3 = await Git3.deploy();
await git3.deployed(); await git3.deployed();
@ -125,7 +125,7 @@ describe("Git3 Test", function () {
}); });
it("Access Control", async function () { it("Access Control", async function () {
const Git3 = await ethers.getContractFactory("Git3"); const Git3 = await ethers.getContractFactory("Git3Hub");
const git3 = await Git3.deploy(); const git3 = await Git3.deploy();
await git3.deployed(); await git3.deployed();
@ -174,7 +174,7 @@ describe("Git3 Test", function () {
}); });
it("RepoName Check", async function () { it("RepoName Check", async function () {
const Git3 = await ethers.getContractFactory("Git3"); const Git3 = await ethers.getContractFactory("Git3Hub");
const git3 = await Git3.deploy(); const git3 = await Git3.deploy();
await git3.deployed(); await git3.deployed();
@ -194,7 +194,7 @@ describe("Git3 Test", function () {
}); });
it("Get the stake number of chunks", async function () { it("Get the stake number of chunks", async function () {
const Git3 = await ethers.getContractFactory("Git3"); const Git3 = await ethers.getContractFactory("Git3Hub");
const git3 = await Git3.deploy(); const git3 = await Git3.deploy();
await git3.deployed(); await git3.deployed();
@ -247,7 +247,7 @@ describe("Git3 Test", function () {
}); });
it("Refund to user directly after removing chunk", async function () { it("Refund to user directly after removing chunk", async function () {
const Git3 = await ethers.getContractFactory("Git3"); const Git3 = await ethers.getContractFactory("Git3Hub");
const git3 = await Git3.deploy(); const git3 = await Git3.deploy();
await git3.deployed(); await git3.deployed();

Loading…
Cancel
Save