This is a scaffold template for initializing a SHEFT (Solidity + Hardhat + Ethers v6 + Foundry + Taskfile) stack.
There is an article on SHEFT stack here which explains the why's and what's.
Make sure you have the following installed:
Scaffold a new project (you will be prompted):
scaffold new --run-hooks always https://github.com/difof/sheftAnd you will have your new project ready to work with.
- Foundry and Hardhat configured to the same
src/contractsandtestlayout - OpenZeppelin and Solady pre-installed
- Ethers v6 with TypeChain output in
typechain/ - Bun for TypeScript runner and package manager
- ESLint + Prettier (TS), Forge lint/fmt (Solidity)
- Conventional Commits via commitlint (optional)
- Taskfile-powered workflows for build/test/deploy/verify/docs
- Optional
package/sub-package exporting TypeChain + TS utils - Example ERC20 and Merkle airdrop contracts with full coverage
<project>/
foundry.toml
hardhat.config.ts
remappings.txt
Taskfile.yaml
src/
contracts/
ts/
script/
foundry/
deploy/
test/
foundry/
hardhat/
ts/
package/
lib/
If enabled, package/ re-exports typechain and utilities from src/ts and builds an ESM bundle via esbuild.
We follow Conventional Commits style. Note that commitlint is NOT used in this template repository; it is only included in projects generated from this template (when selected during scaffolding). Please format commits accordingly.
- Types:
feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert - Examples:
feat(token): add permit supportfix(airdrop): prevent double-claim
Since this is a template project, apply changes directly to the templates under {{ .Project }} and validate them by generating a sandbox project.
- Edit templates in
{{ .Project }}/.... - From repo root, generate the default sandbox project under
sandbox/:
task clean:sandbox
task sandbox # generates sandbox/
cd sandbox- Run checks inside the sandbox (the generated project):
task fmt && task lint && task test:allIterate: adjust files in {{ .Project }}, re-run task sandbox, and repeat checks in sandbox/.
Tips:
- Use
task sandbox:promptto run the scaffold with prompts when you need non-default answers. - Use
task clean:sandboxto remove thesandbox/directory.
- Keep templates DRY: avoid duplicating large snippets across files; prefer central helpers where possible.
- Validate output early and often: regenerate the sandbox frequently after small edits.
- Rely on the sandbox for IDE support: use IntelliSense, lint, and format in
sandbox/, not in the template files. - Prefer simple, explicit placeholders over clever generation logic; favor readability of the produced code.
- Make changes composable and incremental; avoid sweeping refactors without a sandbox build in between.
- Add and run tests in the generated project (
test/) to guard template changes. - Keep formatting consistent by letting the generated project’s linters/formatters rewrite files.
-
src/tsdocs - move inline JS from taskfile:wallet:import:mnemonic to dedicated file in
src/ts - FIX: .env with RPC_URL, passed to commands
- add
0xprefix to keccak hash ofsrc/ts/keccak.ts - Allow usage of either node/npm or bun, instead of just bun
- Add viem
- Start empty without airdrop and token
- Use proper
internaltasks andshexecution for{{.Project}}/Taskfile.yaml - Document the utility tasks such as
ensure-var - Proper empty string defaults for internal utility tasks such as
ensure-var - Required vars for
ensure-var - Custom cursor rules and commands
- Support Optimism (In Hardhat) and other EVM variants
- Github actions
- Dedicated project contribution guideline file
- Smart contract and test templates
MIT