forked from scaffold-eth/scaffold-eth-2
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into update-readme
- Loading branch information
Showing
12 changed files
with
156 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"create-eth": patch | ||
--- | ||
|
||
templatise `foundry.toml` file |
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,5 @@ | ||
--- | ||
"create-eth": patch | ||
--- | ||
|
||
validate project name inline with npm name rules |
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 |
---|---|---|
|
@@ -39,6 +39,7 @@ | |
"@types/inquirer": "9.0.3", | ||
"@types/ncp": "2.0.5", | ||
"@types/node": "18.16.0", | ||
"@types/validate-npm-package-name": "4.0.2", | ||
"eslint": "^9.15.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.2.1", | ||
|
@@ -58,7 +59,8 @@ | |
"inquirer": "9.2.0", | ||
"listr2": "^8.2.1", | ||
"merge-packages": "^0.1.6", | ||
"ncp": "2.0.0" | ||
"ncp": "2.0.0", | ||
"validate-npm-package-name": "6.0.0" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
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,22 @@ | ||
import validateProjectName from "validate-npm-package-name"; | ||
|
||
type ValidateNpmNameResult = | ||
| { | ||
valid: true; | ||
} | ||
| { | ||
valid: false; | ||
problems: string[]; | ||
}; | ||
|
||
export function validateNpmName(name: string): ValidateNpmNameResult { | ||
const nameValidation = validateProjectName(name); | ||
if (nameValidation.validForNewPackages) { | ||
return { valid: true }; | ||
} | ||
|
||
return { | ||
valid: false, | ||
problems: [...(nameValidation.errors || []), ...(nameValidation.warnings || [])], | ||
}; | ||
} |
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
42 changes: 0 additions & 42 deletions
42
templates/solidity-frameworks/foundry/packages/foundry/foundry.toml
This file was deleted.
Oops, something went wrong.
64 changes: 64 additions & 0 deletions
64
templates/solidity-frameworks/foundry/packages/foundry/foundry.toml.template.mjs
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,64 @@ | ||
import { withDefaults } from "../../../../utils.js"; | ||
|
||
const content = ({ | ||
extraProfileDefaults, | ||
extraRpcEndpoints, | ||
extraEthercsanConfig, | ||
extraFormattingConfig, | ||
extraConfig, | ||
}) => `[profile.default] | ||
src = 'contracts' | ||
out = 'out' | ||
libs = ['lib'] | ||
fs_permissions = [{ access = "read-write", path = "./"}] | ||
${extraProfileDefaults.filter(Boolean).join("\n")} | ||
[rpc_endpoints] | ||
default_network = "http://127.0.0.1:8545" | ||
localhost = "http://127.0.0.1:8545" | ||
mainnet = "https://eth-mainnet.alchemyapi.io/v2/\${ALCHEMY_API_KEY}" | ||
sepolia = "https://eth-sepolia.g.alchemy.com/v2/\${ALCHEMY_API_KEY}" | ||
arbitrum = "https://arb-mainnet.g.alchemy.com/v2/\${ALCHEMY_API_KEY}" | ||
arbitrumSepolia = "https://arb-sepolia.g.alchemy.com/v2/\${ALCHEMY_API_KEY}" | ||
optimism = "https://opt-mainnet.g.alchemy.com/v2/\${ALCHEMY_API_KEY}" | ||
optimismSepolia = "https://opt-sepolia.g.alchemy.com/v2/\${ALCHEMY_API_KEY}" | ||
polygon = "https://polygon-mainnet.g.alchemy.com/v2/\${ALCHEMY_API_KEY}" | ||
polygonMumbai = "https://polygon-mumbai.g.alchemy.com/v2/\${ALCHEMY_API_KEY}" | ||
polygonZkEvm = "https://zkevm-rpc.com" | ||
polygonZkEvmTestnet = "https://rpc.public.zkevm-test.net" | ||
gnosis = "https://rpc.gnosischain.com" | ||
chiado = "https://rpc.chiadochain.net" | ||
base = "https://mainnet.base.org" | ||
baseSepolia = "https://sepolia.base.org" | ||
scrollSepolia = "https://sepolia-rpc.scroll.io" | ||
scroll = "https://rpc.scroll.io" | ||
pgn = "https://rpc.publicgoods.network" | ||
pgnTestnet = "https://sepolia.publicgoods.network" | ||
${extraRpcEndpoints.filter(Boolean).join("\n")} | ||
[etherscan] | ||
polygonMumbai = { key = "\${ETHERSCAN_API_KEY}" } | ||
sepolia = { key = "\${ETHERSCAN_API_KEY}" } | ||
${extraEthercsanConfig.filter(Boolean).join("\n")} | ||
[fmt] | ||
line_length = 120 | ||
tab_width = 4 | ||
quote_style = "double" | ||
bracket_spacing = true | ||
int_types = "long" | ||
${extraFormattingConfig.filter(Boolean).join("\n")} | ||
${extraConfig.filter(Boolean).join("\n")} | ||
# See more config options https://book.getfoundry.sh/reference/config/overview`; | ||
|
||
export default withDefaults(content, { | ||
extraProfileDefaults: "", | ||
extraRpcEndpoints: "", | ||
extraEthercsanConfig: "", | ||
extraFormattingConfig: "", | ||
extraConfig: "", | ||
}); |
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