{"id":19903193,"url":"https://github.com/nethereum/abi-code-gen","last_synced_at":"2025-05-03T00:30:36.279Z","repository":{"id":57171960,"uuid":"74402606","full_name":"Nethereum/abi-code-gen","owner":"Nethereum","description":"Generic code generator from abi","archived":false,"fork":false,"pushed_at":"2021-12-16T22:57:41.000Z","size":26,"stargazers_count":22,"open_issues_count":3,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-10T06:34:37.299Z","etag":null,"topics":["abi","code-generator","engine","ethereum"],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/Nethereum.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}},"created_at":"2016-11-21T20:23:20.000Z","updated_at":"2023-09-03T00:59:24.000Z","dependencies_parsed_at":"2022-08-24T14:40:54.299Z","dependency_job_id":null,"html_url":"https://github.com/Nethereum/abi-code-gen","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/Nethereum%2Fabi-code-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nethereum%2Fabi-code-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nethereum%2Fabi-code-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nethereum%2Fabi-code-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nethereum","download_url":"https://codeload.github.com/Nethereum/abi-code-gen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224342737,"owners_count":17295523,"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":["abi","code-generator","engine","ethereum"],"created_at":"2024-11-12T20:22:25.876Z","updated_at":"2024-11-12T20:22:26.517Z","avatar_url":"https://github.com/Nethereum.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# abi-code-gen\n\nThis project ideal is to create a generic code generator using as an input the compilation output of solc, for usage with the solidity extension of vs-code or as an standalone utility.\n\nThis way everyone can simply create templates that are easily pluggable without the need to create new parsers.\n\nCurrently includes the C# template for a generic service, function output and event dtos for usage with Nethereum.\n\n##Usage\n\nThe input expected is a json file as per solc.js compilation output, depending of the code generator template most or noned of the properties will be used.\nBut as a minimum we need the \"abi\" as this is parsed by the engine.\n\n```javascript\n{\n    \"abi\": \"[{\\\"constant\\\":false,\\\"inputs\\\":[{\\\"name\\\":\\\"a\\\",\\\"type\\\":\\\"int256\\\"}],\\\"name\\\":\\\"multiply\\\",\\\"outputs\\\":[{\\\"name\\\":\\\"r\\\",\\\"type\\\":\\\"int256\\\"}],\\\"payable\\\":false,\\\"type\\\":\\\"function\\\"},{\\\"inputs\\\":[{\\\"name\\\":\\\"multiplier\\\",\\\"type\\\":\\\"int256\\\"}],\\\"type\\\":\\\"constructor\\\"},{\\\"anonymous\\\":false,\\\"inputs\\\":[{\\\"indexed\\\":true,\\\"name\\\":\\\"a\\\",\\\"type\\\":\\\"int256\\\"},{\\\"indexed\\\":true,\\\"name\\\":\\\"sender\\\",\\\"type\\\":\\\"address\\\"},{\\\"indexed\\\":false,\\\"name\\\":\\\"result\\\",\\\"type\\\":\\\"int256\\\"}],\\\"name\\\":\\\"Multiplied\\\",\\\"type\\\":\\\"event\\\"}]\\n\",\n    \"bytecode\": \"60606040526040516020...\",\n...\n}\n\n```\n\nIf there are any other extra settings the code generator template needs, a file matching both the compilation output and the template used can be placed alongside.\n\nFor example, if we have \"Multiplication.json\" compilation output, we can put next to it \"Multiplication-cs-service.json\" where \"cs-service\" is our template.\n\nThis can include specific attributes like 'namespace' or overriding the 'contractName'.\n\n```javascript\n{\n \"namespace\": \"Tutorials\"\n \"contractName\": \"MyMultiplicationContract\"\n}\n``` \n\nTo execute the code generation, we just need to pass the path of our file and the template.\n\n```javascript\nabigen.generateCode(path.join(__dirname, 'Multiplication.json'), 'cs-service');\n\n```\n\n## Templates\n\nThe template engine used is ejs as it allows complex parsing and the same time be fully decoupled from the \"engine\" itself.\n\nTo get a better understanding have a look at the templates directory or the examples.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnethereum%2Fabi-code-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnethereum%2Fabi-code-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnethereum%2Fabi-code-gen/lists"}