From a45daec972fe58aae5ce65f803262922d1487e2d Mon Sep 17 00:00:00 2001 From: Sing <16409791+singyiu@users.noreply.github.com> Date: Mon, 23 Oct 2023 22:41:06 -0700 Subject: [PATCH] feat: hardhat setup --- packages/contracts/hardhat.config.js | 46 + packages/contracts/package.json | 3 + packages/contracts/scripts/deploy.js | 41 + packages/contracts/src/LapuVault.flatten.sol | 2105 ++++++++++++++++ pnpm-lock.yaml | 2336 +++++++++++++++++- 5 files changed, 4445 insertions(+), 86 deletions(-) create mode 100644 packages/contracts/hardhat.config.js create mode 100644 packages/contracts/scripts/deploy.js create mode 100644 packages/contracts/src/LapuVault.flatten.sol diff --git a/packages/contracts/hardhat.config.js b/packages/contracts/hardhat.config.js new file mode 100644 index 0000000..c11fdb1 --- /dev/null +++ b/packages/contracts/hardhat.config.js @@ -0,0 +1,46 @@ +require("@nomicfoundation/hardhat-toolbox"); +//require("@nomiclabs/hardhat-etherscan"); + +/** @type import('hardhat/config').HardhatUserConfig */ +module.exports = { + solidity: { + compilers: [ + { + version: "0.8.21", + settings: { + optimizer: { + enabled: true, + runs: 3000, + }, + }, + }, + ], + }, + networks: { + scrollSepolia: { + url: "https://sepolia-rpc.scroll.io/" || "", + accounts: + process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], + }, + zkEVM_testnet: { + url: "https://rpc.public.zkevm-test.net" || "", + accounts: + process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], + }, + }, + etherscan: { + apiKey: { + scrollSepolia: '2TWMJ1A7DVHAC1TH538S6IWJ5UT5T9VKTP', + }, + customChains: [ + { + network: 'scrollSepolia', + chainId: 534351, + urls: { + apiURL: 'https://sepolia-blockscout.scroll.io/api', + browserURL: 'https://sepolia-blockscout.scroll.io/', + }, + }, + ], + }, +}; diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 029aecd..4db648d 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -25,9 +25,12 @@ "@openzeppelin/contracts": "^5.0.0" }, "devDependencies": { + "@nomicfoundation/hardhat-toolbox": "^3.0.0", + "@nomiclabs/hardhat-etherscan": "^3.1.7", "@types/node": "^18.15.11", "ds-test": "https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0", "forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1", + "hardhat": "^2.18.2", "prettier": "^2.6.2", "prettier-plugin-solidity": "^1.0.0-beta.19", "solhint": "^3.3.7", diff --git a/packages/contracts/scripts/deploy.js b/packages/contracts/scripts/deploy.js new file mode 100644 index 0000000..892570c --- /dev/null +++ b/packages/contracts/scripts/deploy.js @@ -0,0 +1,41 @@ +// We require the Hardhat Runtime Environment explicitly here. This is optional +// but useful for running the script in a standalone fashion through `node