Idea: Gasless membership club: each member gets a smart account (account abstraction) and mints a membership NFT without holding ETH; the club sponsors gas with a paymaster and an admin role manages who is allowed.
This repository was composed automatically by Blockchain Lab Forge. Forge parsed the idea into capabilities (account-abstraction, nft, access-control), retrieved matching components from the Blockchains fork index, pinned them to release tags, copied their exact source files (with full import closure) from the Blockchains forks, and added glue code, tests, a deploy script and a web front end.
MembershipNFT(glue, MIT). One membership pass per approved account. AnAPPROVER_ROLEmanages the allowlist. Passes are non-transferable by default, and an admin can enable transfers.ClubPaymaster(glue, GPL-3.0, extends eth-infinitismBasePaymasterv0.9.0). It sponsors gas for exactly one operation: an approved account that is not yet a member callingMembershipNFT.join()through its smart account.- Members use eth-infinitism
SimpleAccountsmart accounts, deployed counterfactually bySimpleAccountFactoryin the same UserOperation that mints the pass. They need no ETH at any point.
git clone --recursive https://github.com/Blockchains/forge-example-gasless-membership && cd forge-example-gasless-membership
forge test -vv # 5 local tests on the real v0.9.0 EntryPoint + 1 Sepolia fork test on the canonical EntryPoint 0x4337...D009
cd web && npm ci && npm run dev # front end: live Sepolia reads + one-click wallet deployment
forge script script/Deploy.s.sol --rpc-url $SEPOLIA_RPC_URL --account deployer --broadcastLive front end: https://blockchains.github.io/forge-example-gasless-membership/
src/MembershipNFT.sol, src/ClubPaymaster.sol glue code
test/GaslessMembership.t.sol local + Sepolia-fork tests
script/Deploy.s.sol deploy factory, club, paymaster (+ deposit)
lib/account-abstraction/... lib/openzeppelin-contracts/... copied sources (pinned tags v0.9.0, v5.7.0)
lib/forge-std submodule (Blockchains/forge-std)
web/ Vite + viem front end (GitHub Pages)
component-map.json, plan.json, NOTICE provenance
Copied sources (unmodified, under lib/<project>/, listed file by file in NOTICE):
| Fork | Pinned | Files |
|---|---|---|
| Blockchains/openzeppelin-contracts | v5.7.0 | 42 |
| Blockchains/account-abstraction | v0.9.0 | 23 |
Machine-readable: component-map.json · plan: plan.json
For AI agents and builders: read
AGENTS.md(setup, commands, structure, rules),llms.txt(doc map) and the machine-readableblocks.json(schema). How all Blockchains blocks fit together: Build with Blocks · org catalogue: https://blockchains.github.io/blocks.json.
What it exports
| Export | Type | Install / access |
|---|---|---|
MembershipNFT |
solidity | forge install Blockchains/forge-example-gasless-membership |
ClubPaymaster |
solidity | forge install Blockchains/forge-example-gasless-membership |
script/Deploy.s.sol |
file | forge script script/Deploy.s.sol --rpc-url $SEPOLIA_RPC_URL --account <keystore> --broadcast |
component-map.json, plan.json |
file | provenance: capability → component → pinned fork commit |
web/ |
web | cd web && npm ci && npm run dev |
Minimal example (from the repo README; CI runs the same)
git clone --recursive https://github.com/Blockchains/forge-example-gasless-membership && cd forge-example-gasless-membership
forge test -vv # local tests on the real v0.9.0 EntryPoint + Sepolia fork test (canonical EntryPoint 0x4337…D009)
cd web && npm ci && npm run dev # live Sepolia reads + one-click smart-account deploymentInputs → outputs
- In:
constructor args(Solidity) MembershipNFT(admin, baseURI); ClubPaymaster(IEntryPoint ep, MembershipNFT club, uint256 maxCost, address owner) - Out:
deployed contracts(EVM);events/errors(ABI) see src/
Composes with
- Blockchains/blockchainlab-index: the composer that generated this repo
- Blockchains/blockchainlab-index: components were retrieved from the index
- Blockchains/blockchainlab-starters: erc4337-smart-account starter
- Blockchains/blockchainlab-sdk: RPC health for the front end
Versioning & stability: reference. Reference output of an automated composer; copied components are pinned to fork release tags (see NOTICE / component-map.json). Not audited. Treat as a starting point and review before deploying with value.
GPL-3.0-or-later. Includes strong-copyleft files (GPL-3.0); the composed project is distributed under GPL terms. Every copied file keeps its original SPDX header. Attribution is in NOTICE.
Not audited. Review the code yourself before you put real value on mainnet.
Issues and pull requests are welcome. Please read the contributing guide, code of conduct and security policy first.
Built by Blockchain Lab — blockchainlab.com