From 7b61a0fe08b3d98e41c3a33571b9878ab15d18ed Mon Sep 17 00:00:00 2001 From: cyhhao Date: Sun, 18 Dec 2022 12:25:42 +0800 Subject: [PATCH] add event --- contracts/Git3Hub.sol | 10 +++------- scripts/create-repo.ts | 8 ++++---- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/contracts/Git3Hub.sol b/contracts/Git3Hub.sol index a83fe41..2107900 100644 --- a/contracts/Git3Hub.sol +++ b/contracts/Git3Hub.sol @@ -16,13 +16,9 @@ contract Git3Hub is LargeStorageManagerV2 { bytes name; } - event RepoCreated(bytes indexed repoName, address owner); - event RepoOwnerTransfer( - bytes indexed repoName, - address oldOwner, - address newOwner - ); - event PushRef(bytes indexed repoName, bytes ref); + event RepoCreated(bytes repoName, address owner); + event RepoOwnerTransfer(bytes repoName, address oldOwner, address newOwner); + event PushRef(bytes repoName, bytes ref); mapping(bytes => address) public repoNameToOwner; mapping(bytes => refInfo) public nameToRefInfo; // dev => {hash: 0x1234..., index: 1 } diff --git a/scripts/create-repo.ts b/scripts/create-repo.ts index 55fe327..e20bc7e 100644 --- a/scripts/create-repo.ts +++ b/scripts/create-repo.ts @@ -8,13 +8,13 @@ async function main() { const Git3 = await hre.ethers.getContractAt( "Git3Hub", - "0x0068bD3ec8D16402690C1Eddff06ACb913A209ef" + "0xee2879cd03A3D82C0Ffb648AA5773bcEBb0d5741" ); let rept - let owner = await Git3.repoNameToOwner(Buffer.from("helloworld1")) - console.log(owner) + // let owner = await Git3.repoNameToOwner(Buffer.from("helloworld1")) + // console.log(owner) // return - rept = await Git3.createRepo(Buffer.from("helloworld1")) + rept = await Git3.createRepo(Buffer.from("helloworld")) console.log("rept", "https://explorer.galileo.web3q.io/tx/" + rept.hash); // rept = await Git3.transferOwnership(Buffer.from("helloworld"), "0x1eD9c2F6814eA5225Bb78f2F2CA802Ded120077A")