2 Star 12 Fork 0

ProjectOpenSea/seaport

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
hardhat.config.ts 3.92 KB
一键复制 编辑 原始数据 按行查看 历史
0age 提交于 2024-03-08 09:17 +08:00 . add gas profile (may be irregularities)
import { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } from "hardhat/builtin-tasks/task-names";
import { subtask, task } from "hardhat/config";
import { compareLastTwoReports } from "./scripts/compare_reports";
import { printLastReport } from "./scripts/print_report";
import { getReportPathForCommit } from "./scripts/utils";
import { writeReports } from "./scripts/write_reports";
import type { HardhatUserConfig } from "hardhat/config";
import "dotenv/config";
import "@nomiclabs/hardhat-ethers";
import "@nomicfoundation/hardhat-chai-matchers";
import "@nomiclabs/hardhat-etherscan";
import "@typechain/hardhat";
import "hardhat-gas-reporter";
import "solidity-coverage";
// Filter Reference Contracts
subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(
async (_, __, runSuper) => {
const paths = await runSuper();
return paths.filter((p: any) => !p.includes("contracts/reference/"));
}
);
task("write-reports", "Write pending gas reports").setAction(
async (taskArgs, hre) => {
writeReports(hre);
}
);
task("compare-reports", "Compare last two gas reports").setAction(
async (taskArgs, hre) => {
compareLastTwoReports(hre);
}
);
task("print-report", "Print the last gas report").setAction(
async (taskArgs, hre) => {
printLastReport(hre);
}
);
const optimizerSettingsNoSpecializer = {
enabled: true,
runs: 4_294_967_295,
details: {
peephole: true,
inliner: true,
jumpdestRemover: true,
orderLiterals: true,
deduplicate: true,
cse: true,
constantOptimizer: true,
yulDetails: {
stackAllocation: true,
optimizerSteps:
"dhfoDgvulfnTUtnIf[xa[r]EscLMcCTUtTOntnfDIulLculVcul [j]Tpeulxa[rul]xa[r]cLgvifCTUca[r]LSsTOtfDnca[r]Iulc]jmul[jul] VcTOcul jmul",
},
},
};
// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.24",
settings: {
evmVersion: "cancun",
viaIR: true,
optimizer: {
...(process.env.NO_SPECIALIZER
? optimizerSettingsNoSpecializer
: { enabled: true, runs: 4_294_967_295 }),
},
metadata: {
bytecodeHash: "none",
},
outputSelection: {
"*": {
"*": ["evm.assembly", "irOptimized", "devdoc"],
},
},
},
},
],
overrides: {
"contracts/conduit/Conduit.sol": {
version: "0.8.14",
settings: {
viaIR: true,
optimizer: {
enabled: true,
runs: 1000000,
},
},
},
"contracts/conduit/ConduitController.sol": {
version: "0.8.14",
settings: {
viaIR: true,
optimizer: {
enabled: true,
runs: 1000000,
},
},
},
"contracts/helpers/TransferHelper.sol": {
version: "0.8.14",
settings: {
viaIR: true,
optimizer: {
enabled: true,
runs: 1000000,
},
},
},
"contracts/helpers/order-validator": {
version: "0.8.17",
settings: {
viaIR: false,
optimizer: {
enabled: true,
runs: 1,
},
},
},
},
},
networks: {
hardhat: {
hardfork: "cancun",
blockGasLimit: 30_000_000,
throwOnCallFailures: false,
allowUnlimitedContractSize: false,
},
verificationNetwork: {
url: process.env.NETWORK_RPC ?? "",
},
},
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
currency: "USD",
outputFile: getReportPathForCommit(),
noColors: true,
},
etherscan: {
apiKey: process.env.EXPLORER_API_KEY,
},
// specify separate cache for hardhat, since it could possibly conflict with foundry's
paths: { cache: "hh-cache" },
};
export default config;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ProjectOpenSea/seaport.git
git@gitee.com:ProjectOpenSea/seaport.git
ProjectOpenSea
seaport
seaport
main

搜索帮助