{"id":13767059,"url":"https://github.com/Philogy/erc721h","last_synced_at":"2025-05-10T22:31:29.992Z","repository":{"id":53255847,"uuid":"521342742","full_name":"Philogy/erc721h","owner":"Philogy","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-19T17:24:31.000Z","size":91,"stargazers_count":46,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-19T18:13:52.181Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Philogy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-08-04T16:42:10.000Z","updated_at":"2025-02-14T15:53:07.000Z","dependencies_parsed_at":"2024-08-03T16:14:59.229Z","dependency_job_id":null,"html_url":"https://github.com/Philogy/erc721h","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Philogy%2Ferc721h","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Philogy%2Ferc721h/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Philogy%2Ferc721h/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Philogy%2Ferc721h/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Philogy","download_url":"https://codeload.github.com/Philogy/erc721h/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253492529,"owners_count":21916959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-08-03T16:01:04.128Z","updated_at":"2025-05-10T22:31:29.570Z","avatar_url":"https://github.com/Philogy.png","language":"Solidity","funding_links":[],"categories":["Huff projects you can learn from and contribute to"],"sub_categories":[],"readme":"# ERC721H\n\nMost optimized batch minting ERC721 implementation in the EVM ecosystem. Rewrite\nof [ERC721A](https://github.com/chiru-labs/ERC721a) in Huff.\n\n\n## Gas Comparison (ERC721H vs ERC721A vs OpenZeppelin's ERC721)\n|                      Tests|    Huff|   Azuki|Azuki (delta vs. Huff)|        OZ| OZ (delta vs. Huff)|\n|---------------------------|--------|--------|-------------|----------|-----------|\n|                   Mint 200| 437,232| 447,020|       -9,788| 4,999,553| -4,562,321|\n|                    Mint 50| 149,382| 152,120|       -2,738| 1,273,403| -1,124,021|\n|  Safe Transfer To Receiver|  63,550|  65,436|       -1,886|    66,160|     -2,610|\n|           Simple Burn 1 In|  60,503|  82,611|      -22,108|    38,893|    +21,610|\n|                Simple Burn|  38,342|  60,214|      -21,872|    38,893|       -551|\n|Simple Safe Transfer To EOA|  62,379|  63,364|         -985|    64,151|     -1,772|\n|       Simple Transfer 1 In|  81,987|  82,958|         -971|    61,271|    +20,716|\n|      Simple Transfer 20 In| 115,306| 119,835|       -4,529|    61,271|    +54,035|\n|            Simple Transfer|  59,817|  60,561|         -744|    61,271|     -1,454|\n\n### Gas Comparison - Methodology\n**General Approach:**\n\n1. Create minimal reference implementations using the ERC721A and OpenZeppelin libraries respectively, viewable under [`src/refs/`](src/refs)\n2. Created comparison test contract with identical tests for all 3 versions [`test/CompareERC721.t.sol`](test/CompareERC721.t.sol)\n3. Wrote and ran script that extracts the gas use of the actual main call in each test and adds the 21k base transaction stipend to the total cost of all calls\n\n**Table Generation:**\n\nTo generate the above table run the following commands\n```bash\nforge build # necessary to ensure no warnings in `forge test` output\nforge test --match-contract CompareERC721Test --ffi -vvvv \u003e gas-compare.txt\npython script/extract_gas_cost_comparison.py\n```\n\n## Using ERC721H\n### Using ERC721H - Security Considerations\n- Excessively large, arbitrary `ERC721H__START_TOKEN_ID` values may lead to\n  owner data storage slots colliding with other variables, leading to a suite of\n  bugs / vulnerabilities\n\n## Naming Convention\n- prefix all macros / constants / labels with `{FileName}__` e.g. `ERC721H__MY_MACRO`\n- exceptions to above rule\n  - prefix storage slot constants with `{FileName}_SLOT__`\n  - name the constructor and selector switch `{FileName}_CONSTRUCTOR` / `{FileName}_SELECTOR_SWITCH` respectively\n  - function signature constants do not require a prefix\n- prefix macros / labels / constants that are only meant for internal use (quasi\n  private) with a double underscore e.g. `__ERC721H__selectorSwitchEnd`\n- use camel case for labels / custom function signatures\n- use snake case for macros / constants\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPhilogy%2Ferc721h","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPhilogy%2Ferc721h","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPhilogy%2Ferc721h/lists"}