{"id":51151309,"url":"https://github.com/humanbased-ai/erc20-gasless-adapter","last_synced_at":"2026-06-26T06:04:18.595Z","repository":{"id":337035155,"uuid":"1134959115","full_name":"humanbased-ai/erc20-gasless-adapter","owner":"humanbased-ai","description":"Gasless payment adapter layer for XNY token","archived":false,"fork":false,"pushed_at":"2026-02-27T09:46:06.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-01T04:29:34.437Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/humanbased-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-15T12:56:09.000Z","updated_at":"2026-02-27T09:46:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/humanbased-ai/erc20-gasless-adapter","commit_stats":null,"previous_names":["codatta/erc20-gasless-adapter","humanbased-ai/erc20-gasless-adapter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/humanbased-ai/erc20-gasless-adapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanbased-ai%2Ferc20-gasless-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanbased-ai%2Ferc20-gasless-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanbased-ai%2Ferc20-gasless-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanbased-ai%2Ferc20-gasless-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/humanbased-ai","download_url":"https://codeload.github.com/humanbased-ai/erc20-gasless-adapter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanbased-ai%2Ferc20-gasless-adapter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34805109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-26T02:00:06.560Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-26T06:04:17.751Z","updated_at":"2026-06-26T06:04:18.568Z","avatar_url":"https://github.com/humanbased-ai.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Gasless Adapter for Any ERC20\n\nThis repository provides a **generic Gasless Adapter module** that adds\nERC2612 (`permit`) and ERC3009 (gasless transfers) support to any\nstandard ERC20 token.\n\n- **Core base contract**: `GaslessAdapterBase`\n- **Standard adapter implementation**: `StandardGaslessAdapter` (deployed via factory)\n- **Factory contract**: `GaslessAdapterFactory` (deploys adapters)\n- **Standalone extensions**: `ERC2612`, `ERC3009`\n\nThe design follows EIP-712 and exposes a full ERC20 interface plus:\n\n- **ERC2612**: `permit`, `nonces`, `DOMAIN_SEPARATOR`\n- **ERC3009**: `transferWithAuthorization`, `receiveWithAuthorization`,\n  `cancelAuthorization`, `authorizationState`\n\n## Quick Start: Deploy via Factory\n\nDeploy a gasless adapter for your ERC20 using the provided Foundry scripts.\n\n### Supported Networks\n\nCurrently the repository ships with a pre-deployed factory on:\n\n- **Base Sepolia**\n  - **Chain ID**: `84532`\n  - **Factory address**: `0x5e5E52fb594e5F98BD582b309d16FAE02D1e9032`\n\nYou can deploy additional factories on other networks if needed.\n\n### 1. Deploy an Adapter via Factory (Foundry)\n\nUse the `DeployAdapterViaFactory` script. Required environment variables:\n\n- `PRIVATE_KEY`: Deployer private key\n- `RPC_URL`: RPC endpoint for the target network\n- `FACTORY_ADDRESS`: Factory contract address (see above)\n- `UNDERLYING_TOKEN`: Underlying ERC20 token address\n- `TOKEN_NAME`: EIP712 domain name\n- `TOKEN_VERSION`: EIP712 domain version\n- `OWNER`: Owner address for the adapter\n\nExample (Base Sepolia):\n\n```shell\nexport PRIVATE_KEY=your-private-key\nexport RPC_URL=https://sepolia.base.org\nexport FACTORY_ADDRESS=0x5e5E52fb594e5F98BD582b309d16FAE02D1e9032\nexport UNDERLYING_TOKEN=0x...        # your ERC20 token\nexport TOKEN_NAME=\"MyToken Adapter\"\nexport TOKEN_VERSION=\"1\"\nexport OWNER=0x...                   # adapter owner\n\nforge script script/DeployAdapterViaFactory.s.sol:DeployAdapterViaFactory \\\n  --rpc-url $RPC_URL \\\n  --broadcast\n```\n\nThe script will print the deployed adapter address to the console.\n\nIf you prefer to deploy the factory yourself on another network, use:\n\n```shell\nexport PRIVATE_KEY=your-private-key\nexport RPC_URL=\u003cyour-rpc-url\u003e\n\nforge script script/GaslessAdapterFactory.s.sol:GaslessAdapterFactoryDeploy \\\n  --rpc-url $RPC_URL \\\n  --broadcast\n```\n\nThen pass the new factory address as `FACTORY_ADDRESS` when running `DeployAdapterViaFactory`.\n\n## Integrating Your ERC20 with the Adapter\n\nYou can integrate in two ways:\n\n1. **Use Factory + SDK** - Deploy via factory.\n2. **Write your own adapter contract that inherits `GaslessAdapterBase`** - For custom logic.\n\n### 1. Writing Your Own Adapter on `GaslessAdapterBase`\n\nIf you need custom logic, inherit `GaslessAdapterBase` directly:\n\n- Implement `_getUnderlyingToken()` to return the underlying ERC20 address.\n- Optionally:\n  - inherit `Pausable` and override `_requireNotPaused()` to enforce pause,\n  - inherit `Ownable` or `AccessControl` to restrict admin operations.\n\nThe signature verification and allowance handling for ERC2612/3009 are already\nimplemented in `GaslessAdapterBase`, `ERC2612`, and `ERC3009`.\n\n## EIP-712 Configuration\n\nThe EIP-712 domain is configured through the `GaslessAdapterBase` constructor:\n\n- `tokenName`: used as the domain `name`.\n- `tokenVersion`: used as the domain `version`.\n\nFrontends and wallets must use these values when constructing EIP-712 payloads\nfor:\n\n- ERC2612 `Permit`:\n  - Type hash:\n    `Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)`\n- ERC3009 transfers:\n  - `TransferWithAuthorization`\n  - `ReceiveWithAuthorization`\n  - `CancelAuthorization`\n\nUse the adapter’s `DOMAIN_SEPARATOR()` and `nonces(owner)` view functions when\nbuilding client-side signing payloads.\n\n## Foundry Commands\n\nThis repository uses Foundry for building and testing.\n\n- **Build**\n\n```shell\nforge build\n```\n\n- **Test**\n\n```shell\nforge test\n```\n\n- **Format**\n\n```shell\nforge fmt\n```\n\n- **Gas Snapshots**\n\n```shell\nforge snapshot\n```\n\n- **Anvil**\n\n```shell\nanvil\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumanbased-ai%2Ferc20-gasless-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhumanbased-ai%2Ferc20-gasless-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumanbased-ai%2Ferc20-gasless-adapter/lists"}