upgrade dep

main
cyhhao 2 years ago
parent 7b61a0fe08
commit 003b1794dd

155
package-lock.json generated

@ -1,31 +1,31 @@
{
"name": "dgithub",
"name": "git3-contract",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "dgithub",
"name": "git3-contract",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^1.0.5",
"@nomiclabs/hardhat-ethers": "^2.2.1",
"@nomiclabs/hardhat-etherscan": "^3.1.3",
"@openzeppelin/contracts": "^4.8.0",
"@nomiclabs/hardhat-ethers": "^2.2.2",
"@nomiclabs/hardhat-etherscan": "^3.1.5",
"@openzeppelin/contracts": "^4.8.1",
"chai": "^4.3.7",
"typechain": "^8.1.1"
},
"devDependencies": {
"@nomicfoundation/hardhat-toolbox": "^2.0.0",
"@nomicfoundation/hardhat-toolbox": "^2.0.1",
"@typechain/ethers-v5": "^10.2.0",
"@typechain/hardhat": "^6.1.5",
"dotenv": "^16.0.3",
"hardhat": "^2.12.4",
"hardhat": "^2.12.6",
"hardhat-gas-reporter": "^1.0.9",
"prettier": "2.8.1",
"prettier": "2.8.3",
"prettier-check": "^2.0.0",
"prettier-plugin-solidity": "^1.0.0-beta.18",
"prettier-plugin-solidity": "^1.1.1",
"solidity-coverage": "^0.8.2",
"ts-node": "^10.9.1",
"typescript": "^4.9.4"
@ -1288,9 +1288,9 @@
}
},
"node_modules/@nomicfoundation/hardhat-toolbox": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-2.0.0.tgz",
"integrity": "sha512-BoOPbzLQ1GArnBZd4Jz4IU8FY3RY4nUwpXlfymXwxlXNimngkPRJj7ivVNurD7igohEjf90v/Axn2M5WwAdCJQ==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-2.0.1.tgz",
"integrity": "sha512-/pr8m9xlqiNlq6fXv4hEPNwdNwUhysoB2qbDCKqERfPpq34EydUQTC3Vis4aIea8RLwSrU8sDXFdv4TQxYstKw==",
"dev": true,
"peerDependencies": {
"@ethersproject/abi": "^5.4.7",
@ -1302,7 +1302,7 @@
"@typechain/ethers-v5": "^10.1.0",
"@typechain/hardhat": "^6.1.2",
"@types/chai": "^4.2.0",
"@types/mocha": "^9.1.0",
"@types/mocha": ">=9.1.0",
"@types/node": ">=12.0.0",
"chai": "^4.2.0",
"ethers": "^5.4.7",
@ -1365,18 +1365,18 @@
}
},
"node_modules/@nomiclabs/hardhat-ethers": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.1.tgz",
"integrity": "sha512-RHWYwnxryWR8hzRmU4Jm/q4gzvXpetUOJ4OPlwH2YARcDB+j79+yAYCwO0lN1SUOb4++oOTJEe6AWLEc42LIvg==",
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.2.tgz",
"integrity": "sha512-NLDlDFL2us07C0jB/9wzvR0kuLivChJWCXTKcj3yqjZqMoYp7g7wwS157F70VHx/+9gHIBGzak5pKDwG8gEefA==",
"peerDependencies": {
"ethers": "^5.0.0",
"hardhat": "^2.0.0"
}
},
"node_modules/@nomiclabs/hardhat-etherscan": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.1.3.tgz",
"integrity": "sha512-UeNO97j0lwOHqX7mrH6SfQQBdXq1Ng6eFr7uJKuQOrq2UVTWGD70lE5QO4fAFVPz9ao+xlNpMyIqSR7+OaDR+Q==",
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.1.5.tgz",
"integrity": "sha512-PxPX28AGBAlxgXLU27NB3oiMsklxbNhM75SDC4v1QPCyPeAxGm4xV0WpYbR10W7sxY2WF3Ek7u7GhjbQWa2Fcg==",
"dependencies": {
"@ethersproject/abi": "^5.1.2",
"@ethersproject/address": "^5.0.2",
@ -1387,16 +1387,16 @@
"lodash": "^4.17.11",
"semver": "^6.3.0",
"table": "^6.8.0",
"undici": "^5.4.0"
"undici": "^5.14.0"
},
"peerDependencies": {
"hardhat": "^2.0.4"
}
},
"node_modules/@openzeppelin/contracts": {
"version": "4.8.0",
"resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.8.0.tgz",
"integrity": "sha512-AGuwhRRL+NaKx73WKRNzeCxOCOCxpaqF+kp8TJ89QzAipSwZy/NoflkWaL9bywXFRhIzXt8j38sfF7KBKCPWLw=="
"version": "4.8.1",
"resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.8.1.tgz",
"integrity": "sha512-xQ6eUZl+RDyb/FiZe1h+U7qr/f4p/SrTSQcTPH2bjur3C5DbuW/zFgCU/b1P/xcIaEqJep+9ju4xDRi3rmChdQ=="
},
"node_modules/@scure/base": {
"version": "1.1.1",
@ -4309,9 +4309,9 @@
}
},
"node_modules/hardhat": {
"version": "2.12.4",
"resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.12.4.tgz",
"integrity": "sha512-rc9S2U/4M+77LxW1Kg7oqMMmjl81tzn5rNFARhbXKUA1am/nhfMJEujOjuKvt+ZGMiZ11PYSe8gyIpB/aRNDgw==",
"version": "2.12.6",
"resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.12.6.tgz",
"integrity": "sha512-0Ent1O5DsPgvaVb5sxEgsQ3bJRt/Ex92tsoO+xjoNH2Qc4bFmhI5/CHVlFikulalxOPjNmw5XQ2vJFuVQFESAA==",
"dependencies": {
"@ethersproject/abi": "^5.1.2",
"@metamask/eth-sig-util": "^4.0.0",
@ -4360,7 +4360,7 @@
"source-map-support": "^0.5.13",
"stacktrace-parser": "^0.1.10",
"tsort": "0.0.1",
"undici": "^5.4.0",
"undici": "^5.14.0",
"uuid": "^8.3.2",
"ws": "^7.4.6"
},
@ -5963,9 +5963,9 @@
}
},
"node_modules/prettier": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.1.tgz",
"integrity": "sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg==",
"version": "2.8.3",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.3.tgz",
"integrity": "sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==",
"bin": {
"prettier": "bin-prettier.js"
},
@ -5996,42 +5996,20 @@
}
},
"node_modules/prettier-plugin-solidity": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0.tgz",
"integrity": "sha512-gRJCeZ7imbWtNYN2SudjJoPmka5r6jcd2cSTV6FC3pVCtY6LFZbeQQjpKufUEp88hXBAAnkOTOh7TA5xwj9M3A==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.1.1.tgz",
"integrity": "sha512-uD24KO26tAHF+zMN2nt1OUzfknzza5AgxjogQQrMLZc7j8xiQrDoNWNeOlfFC0YLTwo12CLD10b9niLyP6AqXg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@solidity-parser/parser": "^0.14.5",
"emoji-regex": "^10.2.1",
"escape-string-regexp": "^4.0.0",
"semver": "^7.3.8",
"solidity-comments-extractor": "^0.0.7",
"string-width": "^4.2.3"
"solidity-comments-extractor": "^0.0.7"
},
"engines": {
"node": ">=12"
},
"peerDependencies": {
"prettier": "^2.3.0"
}
},
"node_modules/prettier-plugin-solidity/node_modules/emoji-regex": {
"version": "10.2.1",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.2.1.tgz",
"integrity": "sha512-97g6QgOk8zlDRdgq1WxwgTMgEWGVAQvB5Fdpgc1MkNy56la5SKP9GsMXKDOdqwn90/41a8yPwIGk1Y6WVbeMQA==",
"dev": true
},
"node_modules/prettier-plugin-solidity/node_modules/escape-string-regexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
"dev": true,
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
"prettier": ">=2.3.0 || >=3.0.0-alpha.0"
}
},
"node_modules/prettier-plugin-solidity/node_modules/lru-cache": {
@ -9363,9 +9341,9 @@
}
},
"@nomicfoundation/hardhat-toolbox": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-2.0.0.tgz",
"integrity": "sha512-BoOPbzLQ1GArnBZd4Jz4IU8FY3RY4nUwpXlfymXwxlXNimngkPRJj7ivVNurD7igohEjf90v/Axn2M5WwAdCJQ==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-2.0.1.tgz",
"integrity": "sha512-/pr8m9xlqiNlq6fXv4hEPNwdNwUhysoB2qbDCKqERfPpq34EydUQTC3Vis4aIea8RLwSrU8sDXFdv4TQxYstKw==",
"dev": true,
"requires": {}
},
@ -9399,15 +9377,15 @@
"optional": true
},
"@nomiclabs/hardhat-ethers": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.1.tgz",
"integrity": "sha512-RHWYwnxryWR8hzRmU4Jm/q4gzvXpetUOJ4OPlwH2YARcDB+j79+yAYCwO0lN1SUOb4++oOTJEe6AWLEc42LIvg==",
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.2.tgz",
"integrity": "sha512-NLDlDFL2us07C0jB/9wzvR0kuLivChJWCXTKcj3yqjZqMoYp7g7wwS157F70VHx/+9gHIBGzak5pKDwG8gEefA==",
"requires": {}
},
"@nomiclabs/hardhat-etherscan": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.1.3.tgz",
"integrity": "sha512-UeNO97j0lwOHqX7mrH6SfQQBdXq1Ng6eFr7uJKuQOrq2UVTWGD70lE5QO4fAFVPz9ao+xlNpMyIqSR7+OaDR+Q==",
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.1.5.tgz",
"integrity": "sha512-PxPX28AGBAlxgXLU27NB3oiMsklxbNhM75SDC4v1QPCyPeAxGm4xV0WpYbR10W7sxY2WF3Ek7u7GhjbQWa2Fcg==",
"requires": {
"@ethersproject/abi": "^5.1.2",
"@ethersproject/address": "^5.0.2",
@ -9418,13 +9396,13 @@
"lodash": "^4.17.11",
"semver": "^6.3.0",
"table": "^6.8.0",
"undici": "^5.4.0"
"undici": "^5.14.0"
}
},
"@openzeppelin/contracts": {
"version": "4.8.0",
"resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.8.0.tgz",
"integrity": "sha512-AGuwhRRL+NaKx73WKRNzeCxOCOCxpaqF+kp8TJ89QzAipSwZy/NoflkWaL9bywXFRhIzXt8j38sfF7KBKCPWLw=="
"version": "4.8.1",
"resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.8.1.tgz",
"integrity": "sha512-xQ6eUZl+RDyb/FiZe1h+U7qr/f4p/SrTSQcTPH2bjur3C5DbuW/zFgCU/b1P/xcIaEqJep+9ju4xDRi3rmChdQ=="
},
"@scure/base": {
"version": "1.1.1",
@ -11711,9 +11689,9 @@
}
},
"hardhat": {
"version": "2.12.4",
"resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.12.4.tgz",
"integrity": "sha512-rc9S2U/4M+77LxW1Kg7oqMMmjl81tzn5rNFARhbXKUA1am/nhfMJEujOjuKvt+ZGMiZ11PYSe8gyIpB/aRNDgw==",
"version": "2.12.6",
"resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.12.6.tgz",
"integrity": "sha512-0Ent1O5DsPgvaVb5sxEgsQ3bJRt/Ex92tsoO+xjoNH2Qc4bFmhI5/CHVlFikulalxOPjNmw5XQ2vJFuVQFESAA==",
"requires": {
"@ethersproject/abi": "^5.1.2",
"@metamask/eth-sig-util": "^4.0.0",
@ -11762,7 +11740,7 @@
"source-map-support": "^0.5.13",
"stacktrace-parser": "^0.1.10",
"tsort": "0.0.1",
"undici": "^5.4.0",
"undici": "^5.14.0",
"uuid": "^8.3.2",
"ws": "^7.4.6"
}
@ -12918,9 +12896,9 @@
"dev": true
},
"prettier": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.1.tgz",
"integrity": "sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg=="
"version": "2.8.3",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.3.tgz",
"integrity": "sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw=="
},
"prettier-check": {
"version": "2.0.0",
@ -12932,31 +12910,16 @@
}
},
"prettier-plugin-solidity": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0.tgz",
"integrity": "sha512-gRJCeZ7imbWtNYN2SudjJoPmka5r6jcd2cSTV6FC3pVCtY6LFZbeQQjpKufUEp88hXBAAnkOTOh7TA5xwj9M3A==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.1.1.tgz",
"integrity": "sha512-uD24KO26tAHF+zMN2nt1OUzfknzza5AgxjogQQrMLZc7j8xiQrDoNWNeOlfFC0YLTwo12CLD10b9niLyP6AqXg==",
"dev": true,
"requires": {
"@solidity-parser/parser": "^0.14.5",
"emoji-regex": "^10.2.1",
"escape-string-regexp": "^4.0.0",
"semver": "^7.3.8",
"solidity-comments-extractor": "^0.0.7",
"string-width": "^4.2.3"
"solidity-comments-extractor": "^0.0.7"
},
"dependencies": {
"emoji-regex": {
"version": "10.2.1",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.2.1.tgz",
"integrity": "sha512-97g6QgOk8zlDRdgq1WxwgTMgEWGVAQvB5Fdpgc1MkNy56la5SKP9GsMXKDOdqwn90/41a8yPwIGk1Y6WVbeMQA==",
"dev": true
},
"escape-string-regexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
"dev": true
},
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",

@ -1,5 +1,5 @@
{
"name": "dgithub",
"name": "git3-contract",
"version": "1.0.0",
"description": "Dencentralized Github",
"main": "index.js",
@ -8,33 +8,33 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/cyl19970726/dGithub.git"
"url": "git+https://github.com/git3protocol/git3-contract.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/cyl19970726/dGithub/issues"
"url": "https://github.com/git3protocol/git3-contract/issues"
},
"homepage": "https://github.com/cyl19970726/dGithub#readme",
"homepage": "https://github.com/git3protocol/git3-contract#readme",
"devDependencies": {
"@nomicfoundation/hardhat-toolbox": "^2.0.0",
"@nomicfoundation/hardhat-toolbox": "^2.0.1",
"@typechain/ethers-v5": "^10.2.0",
"@typechain/hardhat": "^6.1.5",
"dotenv": "^16.0.3",
"hardhat": "^2.12.4",
"hardhat": "^2.12.6",
"hardhat-gas-reporter": "^1.0.9",
"prettier": "2.8.1",
"prettier": "2.8.3",
"prettier-check": "^2.0.0",
"prettier-plugin-solidity": "^1.0.0-beta.18",
"prettier-plugin-solidity": "^1.1.1",
"solidity-coverage": "^0.8.2",
"ts-node": "^10.9.1",
"typescript": "^4.9.4"
},
"dependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^1.0.5",
"@nomiclabs/hardhat-ethers": "^2.2.1",
"@nomiclabs/hardhat-etherscan": "^3.1.3",
"@openzeppelin/contracts": "^4.8.0",
"@nomiclabs/hardhat-ethers": "^2.2.2",
"@nomiclabs/hardhat-etherscan": "^3.1.5",
"@openzeppelin/contracts": "^4.8.1",
"chai": "^4.3.7",
"typechain": "^8.1.1"
}

@ -8,29 +8,32 @@ async function main() {
const Git3 = await hre.ethers.getContractAt(
"Git3Hub",
"0xcE386Fe1d237e42dd01c130DA19d32B2c3794C06"
"0x608860940b8f3D3247E1B301Cf2fA5690e6504DD"
);
let file = fs.readFileSync("scripts/git3.png");
let rept
let buffer = Array.from(file).slice(0, 24 * 1024 * 5);
let buffer = Array.from(file).slice(0, 24 * 1024 - 300);
let fileSize = buffer.length;
console.log("buffer", buffer.length);
let cost = 0;
if (fileSize > 24 * 1024 - 326) {
cost = Math.floor((fileSize + 326) / 1024 / 24);
}
let repoName = Buffer.from("helloworld")
// rept = await Git3.createRepo(repoName)
// if (fileSize > 24 * 1024 - 326) {
// cost = Math.floor((fileSize + 326) / 1024 / 24);
// }
let repoName = Buffer.from("test123")
// rept = await"test123" Git3.createRepo(repoName)
let key = ethers.utils.toUtf8Bytes("aaa");
// rept = await Git3.upload(repoName, key, buffer, {
// value: ethers.utils.parseEther(cost.toString()),
// gasLimit: 6000000
// });
rept = await Git3.transferOwnership(repoName, "0x1eD9c2F6814eA5225Bb78f2F2CA802Ded120077A")
console.log(await Git3.download(repoName, key));
rept = await Git3.remove(repoName, key)
// rept = await Git3.remove(repoName, key)
console.log("rept", "https://explorer.galileo.web3q.io/tx/" + rept.hash);
}

Loading…
Cancel
Save