{"id":19325939,"url":"https://github.com/alephao/solcery","last_synced_at":"2025-04-22T20:32:06.554Z","repository":{"id":87475986,"uuid":"462853916","full_name":"alephao/solcery","owner":"alephao","description":"Solidity code generation tool","archived":false,"fork":false,"pushed_at":"2024-01-03T02:07:12.000Z","size":9,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-01-04T02:58:34.747Z","etag":null,"topics":["codegen","ethereum","foundry","solidity"],"latest_commit_sha":null,"homepage":"","language":"Python","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/alephao.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}},"created_at":"2022-02-23T18:14:42.000Z","updated_at":"2024-01-04T02:58:34.747Z","dependencies_parsed_at":null,"dependency_job_id":"6973f8b2-a58b-466e-be12-4edd1d9c04fa","html_url":"https://github.com/alephao/solcery","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alephao%2Fsolcery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alephao%2Fsolcery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alephao%2Fsolcery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alephao%2Fsolcery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alephao","download_url":"https://codeload.github.com/alephao/solcery/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223903480,"owners_count":17222551,"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":["codegen","ethereum","foundry","solidity"],"created_at":"2024-11-10T02:11:58.762Z","updated_at":"2024-11-10T02:11:59.400Z","avatar_url":"https://github.com/alephao.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solcery\n\n\u003e WIP!\n\nCodegen tool for Solidity development.\n\n## Installing\n\n```bash\ngit clone https://github.com/alephao/solcery.git\ncd solcery\npip install -r requirements.txt\n\npython main.py \u003ccommand\u003e\n```\n\n## Commands\n\n### `solcery errsig [\u003cpath_to_file\u003e]`\n\nAdd error signature comments on top of each `error` declaration if it contains a `/// @dev 0x` comment on top of it.\n\n**Example:**\n\nGiven the file `MyContract.sol`, running `solcery errsig MyContract.sol` will update the file adding the contents bellow:\n\n```diff\ncontract MyContract {\n-   /// @dev 0x\n+   /// @dev 0xbfb4ebcf\n    error Foo();\n-   /// @dev 0x\n+   /// @dev 0xdd448093\n    error Bar(uint256 a);\n}\n```\n\n### `solcery errgen \u003coutput_path\u003e [\u003cinput_path\u003e]`\n\nGenerates a solidity file containing sugar functions to use when expecting errors.\n\n**Example:**\n\nGiven the file bellow `MyContract.sol` containing some error declarations, running `solcery errgen Errors.sol MyContract.sol` will generate the file `Errors.sol` you can find below.\n\n**MyContract.sol**\n\n```solidity\ncontract MyContract {\n    error Foo();\n    error Bar(uint256 a);\n    // ...\n}\n```\n\n**Errors.sol**\n\n```solidity\n// SPDX-License-Identifier: Unlicense\npragma solidity \u003e=0.8.4;\n\n// The code in this file was generate. Do not modify!\n// solhint-disable const-name-snakecase\nlibrary Errors {\n    function Foo() internal pure returns (bytes memory) { return abi.encodeWithSignature(\"Foo()\"); }\n    function Bar(uint256 a) internal pure returns (bytes memory) { return abi.encodeWithSignature(\"Bar(uint256)\", a); }\n}\n// solhint-enable const-name-snakecase\n```\n\n**Usage in a foundry test file**:\n\n```solidity\ncontract MyTests {\n    function testSomething() public {\n      HEVM.expectRevert(Errors.Bar(123))\n      //...\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falephao%2Fsolcery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falephao%2Fsolcery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falephao%2Fsolcery/lists"}