-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat/vaults
# Conflicts: # .env.example # hardhat.config.ts
- Loading branch information
Showing
6 changed files
with
61 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { existsSync, readFileSync } from "node:fs"; | ||
|
||
/* Determines the forking configuration for Hardhat */ | ||
export function getHardhatForkingConfig() { | ||
const forkingUrl = process.env.HARDHAT_FORKING_URL || ""; | ||
|
||
if (!forkingUrl) { | ||
// Scratch deploy, need to disable CSM | ||
process.env.INTEGRATION_ON_SCRATCH = "on"; | ||
process.env.INTEGRATION_WITH_CSM = "off"; | ||
return undefined; | ||
} | ||
|
||
return { url: forkingUrl }; | ||
} | ||
|
||
// TODO: this plaintext accounts.json private keys management is a subject | ||
// of rework to a solution with the keys stored encrypted | ||
export function loadAccounts(networkName: string) { | ||
const accountsPath = "./accounts.json"; | ||
|
||
if (!existsSync(accountsPath)) { | ||
return []; | ||
} | ||
|
||
const content = JSON.parse(readFileSync(accountsPath, "utf-8")); | ||
if (!content.eth) { | ||
return []; | ||
} | ||
|
||
return content.eth[networkName] || []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from "./verify-contracts"; | ||
export * from "./extract-abis"; | ||
export * from "./solidity-get-source"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import path from "node:path"; | ||
|
||
import { globSync } from "glob"; | ||
import { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } from "hardhat/builtin-tasks/task-names"; | ||
import { subtask } from "hardhat/config"; | ||
|
||
// a workaround for having an additional source directory for compilation | ||
// see, https://github.com/NomicFoundation/hardhat/issues/776#issuecomment-1713584386 | ||
|
||
subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(async (_, hre, runSuper) => { | ||
const paths = await runSuper(); | ||
|
||
const otherDirectoryGlob = path.join(hre.config.paths.root, "test", "**", "*.sol"); | ||
// Don't need to compile test, helper and script files that are not part of the contracts for Hardhat. | ||
const otherPaths = globSync(otherDirectoryGlob).filter((x) => !/\.([ths]\.sol)$/.test(x)); | ||
|
||
return [...paths, ...otherPaths]; | ||
}); |