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):
# fetch SHEFT updates into cache
scaffold update
# without `run-hooks` the project will not be properly setup
scaffold new --run-hooks always https://github.com/difof/sheftAnd you will have your new project ready to work with.
Add a new ERC20 token:
task new:erc20 # will prompt for necessary info- Foundry and Hardhat configured to the same
src/contractsandtestlayout - OpenZeppelin and Solady pre-installed
- Ethers v6 with TypeChain output in
typechain/ - Viem support
- Bun for TypeScript runner and package manager
- npm support if you choose it in the prompts
- 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
- Use proper
internaltasks andshexecution for{{.Project}}/Taskfile.yaml - Add ABI JSON export to package, using yaml list in taskfile
- Start empty without airdrop and token
- Add viem
- Smart contract and test templates
- Fixes and improvements
- Check post hook script for some TODOs on more scaffold questions
- FIX task for ts and sol dependency installation
- Add docs for
{{ .Project }}/.templates/soldeploy.hbs - This readme's header need to specify npm and viem support (list just like the prompts)
- Different hardhat and anvil node RPC's and chainIds (hardhat.config.ts, Taskfile.yaml)
- fmt the files because in crosschain escrow the sol's fmt is not fmted
- copy plopfile and interface.hbs from crosschain escrow to here
- Custom cursor rules and commands
- put the .cursor inside {{ .Project }}
- update scaffold.yaml to question whether to add Cursor rules
- taskfile usage
- solidity files
- solidity test
- hardhat test
- typescript test
- plop and templates
- foundry and hardhat configs
- deploy scripts
- audit:
- add slither
- add mythril
- define cursor rules for slither and mythril
- slither
- mythril
- define taskfile tasks for slither and mythril
- slither
- mythril
- Add curl | sh installer script for dependencies
- Dedicated project contribution guideline file
- issue template
- discussion template
- pr template
- Github actions
- sheft docs builder and deployer
- sandbox gen and test
- Dedicated merkle and keccak npm package
- Support Optimism (In Hardhat) and other EVM variants
- mention somewhere in docs that zk based chains need a different set of foundry and hardhat stuff. I may need to setup hardhat configs for zk's but foundry is up to user to install.
MIT